text string | label_name string | labels int64 |
|---|---|---|
truct_19279() -> None:
df = pl.select(
pl.struct(s=pl.lit("abcd").str.split("").explode(), i=pl.int_range(0, 4))
)
df = pl.concat([df[:2], df[-2:]])
assert df.select(pl.concat_list("s")).to_dict(as_series=False) == {
"s": [
[{"s": "a", "i": 0}],
[{"s": "b", "i": 1... | Python | 1 |
7 5089.930
2016-07-21 120.61 738.63 25.51 13.690 49.25 5073.900
2016-07-22 121.00 742.74 25.50 13.510 49.21 5100.160
2016-07-25 121.63 739.77 25.57 13.390 49.84 5097.628
2016-07-26 121.64 740.92 24.75 13.655 50.36 ... | Python | 1 |
1'].append(train_acc_1)
results['train_acc@5'].append(train_acc_5)
test_loss, test_acc_1, test_acc_5 = self.linear_train_val(args, epoch, optimizer, loss_criterion, is_train=False)
results['test_loss'].append(test_loss)
results['test_acc@1'].append(test_acc_1)
... | Python | 1 |
rue, false or inline");
true
}
}
}
}
impl Default for SourceMapsConfig {
fn default() -> Self {
SourceMapsConfig::Bool(true)
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum InputSourceMap {
Bool(bool),
Str(String),
}
impl... | Rust | 0 |
assert!(envmnt::is_equal("MY_ENV_VAR", "SOME VALUE"));
///
/// let value = envmnt::get_or_panic("MY_ENV_VAR");
/// assert_eq!(value, "SOME VALUE");
/// }
/// ```
pub fn get_or_panic<K: AsRef<OsStr>>(key: K) -> String {
environment::get_or_panic(key)
}
/// Returns the first environment variable found.
... | Rust | 0 |
", encoding="utf-8") as raw_json_f:
raw_json = json.load(raw_json_f)
for _raw_info in raw_json["data"]["photoList"]:
raw_list.append(_raw_info)
# find downloaded folder and file list within
downloaded_dir = os.path.join(album_dir, ... | Python | 1 |
niqueOwner(where:{ownerName:"gargamel"}){ownerName, cat{catName}}}"#),
@r###"{"data":{"findUniqueOwner":{"ownerName":"gargamel","cat":null}}}"###
);
//change owner
insta::assert_snapshot!(
run_query!(&runner, r#"mutation {updateOneCat(where: {catName: "garfield"},
... | Rust | 0 |
import requests
from dotenv import load_dotenv
import os
# Load environment variables
load_dotenv()
# Make a GET request to the URL
response = requests.get('https://poligon.aidevs.pl/dane.txt')
# Check if the request was successful
if response.status_code == 200:
# Parse the JSON response
# data = response.j... | Python | 1 |
pub use self::core::default::{self, Default};
pub use self::core::fmt::{self, Debug, Display};
pub use self::core::marker::{self, PhantomData};
pub use self::core::ops::Range;
pub use self::core::option::{self, Option};
pub use self::core::result::{self, Result};
#[cfg(all(feature = "alloc", no... | Rust | 0 |
from src.domain.models.group import Group
from src.domain.use_cases.groups.group_list import GroupList as GroupListInterface
from src.domain.use_cases.relations.user_group import UserGroup as UserGroupInterfaces
from src.data.erros.domain_errors import BadRequestError, InternalServerError
from src.data.use_cases.relati... | Python | 1 |
{ String::from(std::ffi::CStr::from_ptr(args[directory_index+1].real as *const libc::c_char).to_str().expect("WhiteBeam: Unexpected null reference")) };
canonical_path.into_os_string().into_string().expect("WhiteBeam: Unexpected null reference")
}
},
_ => {
... | Rust | 0 |
ative to start-to-end vector
const SIN_COS_45: Coordinate = std::f64::consts::FRAC_1_SQRT_2 as Coordinate;
// Generate full curves
let mut vector = start_point - center_point;
let angle_direction = angle.signum() as Coordinate;
for _ in 0..full_curves_n {
// Calculate... | Rust | 0 |
#
# For example, the following expression:
# python_version > "3.6" or (python_version == "3.6" and os_name == "unix")
#
# is parsed into:
# [
# (<Variable('python_version')>, <Op('>')>, <Value('3.6')>),
# 'and',
... | Python | 1 |
import json
import numpy as np
from lag.models import RenewalCoalescentModel
from pipeline.fit_lag import BHSQI
from pipeline.utils import construct_seed, parser, read_config
def simulate_sampling_times(
weekday_effect, n_sampled_weeks, n_samples, rng: np.random.Generator
) -> np.typing.NDArray:
"""
Sam... | Python | 1 |
eadable for US_IMR_USART_LIN_MODE {}
#[doc = "Interrupt Mask Register"]
pub mod us_imr_usart_lin_mode;
#[doc = "Interrupt Mask Register\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 [us_imr_spi_mo... | Rust | 0 |
/// let b = r!(1);
/// let c = r!(vec![1]);
/// let d = r!(non_na);
/// let e = r!([1]);
/// assert_eq!(a, b);
/// assert_eq!(a, c);
/// assert_eq!(a, d);
/// assert_eq!(a, e);
///
/// // Different ways of making boolean scalar TRUE.
/// let a : Robj = true.into();
/// let b ... | Rust | 0 |
#
# Copyright (c) 2019 Intel Corporation
#
# 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... | Python | 1 |
# Based on: https://stackoverflow.com/a/72735401/13452914
import logging
import sys
from types import FrameType
from loguru import logger
class InterceptHandler(logging.Handler):
"""
Add logging handler to augment python stdlib logging.
Logs which would otherwise go to stdlib logging are redirected thro... | Python | 1 |
piece_size: PieceSize<T>,
) -> Result<PieceOffset<T>> {
let free_1st = self.read_free_piece_offset_on_header(new_piece_size)?;
if !new_piece_size.is_large_piece_size(&self.piece_mgr) {
if !free_1st.is_zero() {
let free_next = {
let (piece_size, free_ne... | Rust | 0 |
collect();
let mut signature = i.sig.inputs.clone();
if !has_self {
signature.insert(0, syn::parse_quote! { &self })
}
let old_return_type: syn::Type = match &i.sig.output {
syn::ReturnType::Default => syn::parse_quote! { () },
syn::ReturnType::Type(_, t) => syn::parse_q... | Rust | 0 |
from django.apps import AppConfig
class CostumerappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'costumerapp'
| Python | 1 |
r): Don't bind to 0.0.0.0 by default
# https://github.com/pdreker/fritz_exporter/issues/402
listen_address = config.get("listen_address", "0.0.0.0") # noqa: S104
return cls(
exporter_port=exporter_port,
log_level=log_level,
devices=devices,
liste... | Python | 1 |
'a> {
App::new("VIM Padre")
.version("0.1.0")
.author("<NAME> <<EMAIL>>")
.about("A tool for building, debugging and reverse engineering in VIM")
.long_about("Interfaces with 'lldb' or a similar debugger to debug programs and communicate with the Vim PADRE plugin in order to effectiv... | Rust | 0 |
},
"ConstantData" => {
AttributeData::ConstantData(r.read_u16::<BigEndian>()?)
},
"LineNumberTable" => {
let len = r.read_u16::<BigEndian>()?;
let mut table = Vec::with_capacity(len as usize);
for _ in 0..len {
let bc = r.r... | Rust | 0 |
# ACRL hyperparameters configuration
config = {
# --- CURRICULUM ---
'step_size': 0.9,
'return_delta': 0.4, # select traj sample which return is greater than return_delta
'update_delta': 0.3, # if mean of return > update_delta, then update context dist
'target_return_threshold': 0.4,
'lambda'... | Python | 1 |
ib()
if _USE_SYSCONFIG:
return new
old = _distutils.get_purelib()
if _looks_like_deb_system_dist_packages(old):
return old
if _warn_if_mismatch(pathlib.Path(old), pathlib.Path(new), key="purelib"):
_log_context()
return old
def get_platlib() -> str:
"""Return the defau... | Python | 1 |
_rule::<_, _, DefaultScalarValue>(
factory,
r#"
{
dog @include {
name @skip
}
}
"#,
&[
RuleError::new(
&directive_error_message("include", "if", "Boolean!"),
... | Rust | 0 |
class Car:
"""
Car osztaly, a járművek tulajdonságaival.
"""
def __init__(self, brand, model, year):
self.brand = brand
self.model = model
self.year = year
self.mileage = 0
self.fuel_level = 100
def drive(self, kilometers):
"""
A megtett ki... | Python | 1 |
to_room.append(&mut room_to_halls);
room_to_room
}
pub fn p1_to_p2(s: &State) -> State {
use Amphipod::*;
let mut news = s.clone();
let last_val = news.0[0].pop().unwrap();
news.0[0].push(D);
news.0[0].push(D);
news.0[0].push(last_val);
let last_val = news.0[1].pop().unwrap();
news... | Rust | 0 |
orthogonal of key management issues.
///
/// If you're implementing a custom signer, you almost certainly want to implement
/// Readable/Writable to serialize out a unique reference to this set of keys so
/// that you can serialize the full ChannelManager object.
///
/// (TODO: We shouldn't require that, and should ha... | Rust | 0 |
x(dm.flatten())
for i in range(len(pos1)):
match = dm[i, :].argmin()
# print " %3s %3d %9.3f %9.3f %9.3f" % (ispecie, match, np.linalg.norm(pos1[i]),
# np.linalg.norm(pos1[match]), dm[i,match])
match_list[i] = match
dm[:, match]... | Python | 1 |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2025 PyMeasure Developers
#
# 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 limit... | Python | 1 |
,
ss_size: stack_size,
ss_flags: 0,
};
let stack = nix::libc::sigaltstack(&signal_stack, std::ptr::null_mut());
if stack == -1 {
panic!("could not set alternate stack for handling signals");
}
let handler = signal::SigHandler::Handler(os_handler);
let mut flags = signa... | Rust | 0 |
import socket
import json
import os
import subprocess
import re
def converte_workload(workload_file_name):
# 构建复合命令
command = f'cd /app/astra-sim/tests/text && bash text_converter.sh {workload_file_name}'
# 使用subprocess.Popen()执行复合命令
process = subprocess.Popen(command, shell=True, stdout=subprocess.P... | Python | 1 |
y:
response = await self.http_client.put(
self.settings.registration_client_uri,
json=filtered_updates,
headers={
"Authorization": f"Bearer {self.settings.registration_access_token}", # TODO: Break long line
"Content-Ty... | Python | 1 |
import shutil
from Input import get_info
def band(encut, pressure, spin, fd, fun, u_atom, u_value, lmaxmix):
incar = """# INCAR for band
EDIFF = 1E-6
EDIFFG = -0.005
ISTART = 1
ICHARG = 11
ISMEAR = 0
SIGMA = 0.03
IBRION = -1
PREC = Accurate
ENCUT = {}
ISIF = 2
LORBIT = 11
LWAVE = .FALSE.
LCHARG = .FALSE.
NPAR = ... | Python | 1 |
0007;
pub const IMAGE_REL_IA64_PCREL21F: u16 = 0x0008;
pub const IMAGE_REL_IA64_GPREL22: u16 = 0x0009;
pub const IMAGE_REL_IA64_LTOFF22: u16 = 0x000A;
pub const IMAGE_REL_IA64_SECTION: u16 = 0x000B;
pub const IMAGE_REL_IA64_SECREL22: u16 = 0x000C;
pub const IMAGE_REL_IA64_SECREL64I: u16 = 0x000D;
pub const IMAGE_REL_IA... | Rust | 0 |
b fn set_intensity_compensation(&mut self,
val: ::std::os::raw::c_uint) {
self._bitfield_1 &= !(256usize as u16);
self._bitfield_1 |= ((val as u32 as u16) << 8u32) & (256usize as u16);
}
}
#[test]
fn bindgen_test_layout__VAPictureParameterBufferVC1__bindgen_ty_4... | Rust | 0 |
ional_slopes.as_ref();
let mut grid = grid.into();
if values.len() < 2 {
return Err(LessThanTwoValues);
}
if values.len() != optional_slopes.len() {
return Err(SlopesVsValues {
slopes: optional_slopes.len(),
values: values.len(),
... | Rust | 0 |
#!/usr/bin/env python
"""
Convert a URL or a path into different formats, e.g., Jupyter URL, GitHub, Git
path.
> url.py https://github.com/.../.../Task229_Exploratory_analysis_of_ST_data.ipynb
file_name=
/Users/saggese/src/.../.../oil/ST/Task229_Exploratory_analysis_of_ST_data.ipynb
github_url=
https://github.com/..... | Python | 1 |
nodename.clone()).unwrap(), t);
match tc.get("oihaoih") {
Some(_) => panic!("string lookup should return None"),
_ => (),
}
}
#[fuchsia_async::run_singlethreaded(test)]
async fn test_target_collection_merge() {
let tc = TargetCollection::new_with_queue();
... | Rust | 0 |
UNSIGNED_SHORT, 0 as _);
gl::BindBuffer(gx::BufferTarget::ElementArray as _, 0);
}
}
} else {
unsafe {
gl::DrawArrays(mesh.topology, 0, mesh.vposition.len() as _);
}
}
}
fn pump_scene_draw_commands(&mut self,... | Rust | 0 |
return found for instruction at {}", _0)]
NoReturnValue(InstructionPointerType),
#[fail(display = "Attempting to add {} to current IP({}) results in underflow", addition, current)]
IPUnderflow {
current: InstructionPointerType,
addition: i64,
},
#[fail(display = "Attempting to add... | Rust | 0 |
#!/usr/bin/env pytest
# This test (test_dagman_check_q_and_exit.py) verifies that
# DAGMan will check the local schedd queue for associated jobs
# and rescue/abort if a job pending nodes jobs is not found
from ornithology import *
import htcondor2 as htcondor
import os
#----------------------------------------------... | Python | 1 |
pl InstanceConfig for ServerConfig {
type ServiceConfig = ServerServiceConfig;
fn equal_without_service(&self, rhs: &Self) -> bool {
let left = ServerConfig {
services: Default::default(),
..self.clone()
};
let right = ServerConfig {
services: Default... | Rust | 0 |
// Calling .unwrap() is safe here because "INPUT" is required
let input = matches.value_of("INPUT").unwrap();
let transpile_target = generate_target(input)?;
let explicit_target_file = matches
.value_of("file")
.map(to_file_path_buf)
.map_or(Ok(None), |v| v.map(Some))?;
le... | Rust | 0 |
};
#[derive(Debug, Error)]
pub enum ParseError {
#[error("Unclosed delimiter at character {location}")]
UnclosedDelimiter { location: usize, eof: usize },
#[error("Unexpected closing delimiter at character {0}")]
UnexpectedCloseDelimiter(usize)
}
/// A keyword
#[derive(Clone, Copy, Debug, Eq, Partial... | Rust | 0 |
srf {
type Error = actix_web::Error;
type Future = ReadyOrNot<'static, Result<Self, Self::Error>>;
type Config = ();
fn from_request(
req: &actix_web::HttpRequest,
_payload: &mut actix_web::dev::Payload,
) -> Self::Future {
let db: &Data<PgPool> = req.app_data().unwrap();
... | Rust | 0 |
"xminymin slice",
"xmidymin slice",
"xmaxymin slice",
"xminymid slice",
"xmidymid slice",
"xmaxymid slice",
"xminymax slice",
"xmidymax slice",
"xmaxymax slice",
"none",
):
for node in elem... | Python | 1 |
SyncedCalendar};
pub use date::format_date;
pub use event::{CalendarEvent, CalendarEventReminder, SyncedCalendarEvent};
pub use event_instance::{
get_free_busy, CompatibleInstances, EventInstance, EventWithInstances, FreeBusy,
};
pub use reminder::{EventRemindersExpansionJob, Reminder};
pub use schedule::{Schedule... | Rust | 0 |
cloned()
.unwrap_or_default()
.as_str(),
"192.168.1.2" | "192.168.1.3"
));
let key: String = client.iter_recents().nth(1).unwrap().to_string();
assert!(matches!(
client
.hosts
.recents
.get(&k... | Rust | 0 |
#[doc = "PWM Sync Channels Mode Register"]
pub mod pwm_scm;
#[doc = "PWM DMA Register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor in... | Rust | 0 |
elf, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GeeLinkedListClass @ {:?}", self as *const _))
.finish()
}
}
#[repr(C)]
pub struct _GeeLinkedListPrivate(c_void);
pub type GeeLinkedListPrivate = *mut _GeeLinkedListPrivate;
#[repr(C)]
#[derive(Copy, Clone)]
pub... | Rust | 0 |
Element-wise class probabilities.
"""
# Be graceful to shape (n_samples, 1) -> (n_samples,)
if raw_prediction.ndim == 2 and raw_prediction.shape[1] == 1:
raw_prediction = raw_prediction.squeeze(1)
proba = np.empty((raw_prediction.shape[0], 2), dtype=raw_prediction.dtype)
... | Python | 1 |
# 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 u... | Python | 1 |
base()
if db2:
return db
else:
return db2
except psycopg2.Error as e:
well_data.connect_in_base = False
print(f'Ошибка подключения к базе данных, проверьте наличие интернета {type(e).__name__}\n\n{str(e)... | Python | 1 |
not found: {flags_path}")
if rules_path.exists():
parse_collision_mask_rules(rules_path)
else:
print(f"Collision rules file not found: {rules_path}")
def apply_rule_to_mask(rule: CollisionRule, is_trigger: bool) -> dict[str, str]:
"""Apply a collision rule based on the `isTrigger` conditi... | Python | 1 |
import os
from opts import parse_opts
from core.model import generate_vaaerase_model, generate_visual_Erase_model
from core.loss import get_loss
from core.optimizer import get_optim
from core.utils import local2global_path, get_spatial_transform
from core.dataset import get_training_set, get_validation_set, get_data_lo... | Python | 1 |
cur_ptr = q.indexes()[i].opt();
if cur_ptr.is_none() {
if w {
return lab46(t, n, q.ptr(), i);
} else {
return;
}
}
let q = Index(cur_ptr.unwrap());
let i = (n / 4096 % 64) as usize;
cur_ptr = q.indexes()[i].opt();
if cur_ptr.is_none() {
... | Rust | 0 |
logger.info(f"✅ Gráfico de barras gerado: {filename}")
except Exception as e:
logger.error(f"❌ Erro ao gerar gráfico para {col}: {e}")
return resultados
def gerar_relatorio(df, resultados):
"""Gera relatório textual sobre as distribuições"""
relatorio = []
... | Python | 1 |
from datetime import datetime
from typing import List
from dateutil.parser import parse
from pyot.conf.model import models
from .base import PyotCore, PyotStatic
# PYOT STATIC OBJECTS
class StatusContentData(PyotStatic):
locale: str
content: str
class StatusUpdateData(PyotStatic):
id: int
author: ... | Python | 1 |
"transactional-test".to_string(),
rerooted_path.join("spectests").display().to_string(),
r".*\.move".to_string(),
);
if cmd.update_baseline {
std::env::set_var(UPDATE_BASELINE, "true");
}
datatest_stable::runner_with_opts(&[requirements], cmd.test_opts);
Ok(())
}
<g... | Rust | 0 |
import re
# This program is to aid making a release
# It patches a number of files that have version numbers and/or dates
# in them.
#
# configure.ac:6:AC_INIT([robodoc], [4.99.44])
# INSTALL.md:15:the official source distribution (robodoc-4.99.44.zip) you can build ROBODoc using:
# INSTALL.md:18: unzip robodoc-4.9... | Python | 1 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
import find_unused_disk
import os
blkid_data_pttype = [('/dev/sdx', '/dev/sdx: PTTYPE=\"dos\"'),
('/dev/sdy', '/dev/sdy: PTTYPE=\"test\"')]
blkid_data = [('/dev/sdx', 'UUID=\"hello-1234-56789\" ... | Python | 1 |
::from("addr0000"),
block_height: Some(12345 + 120),
},
)
.unwrap()
)
.unwrap(),
StakerInfoResponse {
staker: HumanAddr::from("addr0000"),
reward_index: Decimal::from_ratio(25000u64, 1u64),
pending_re... | Rust | 0 |
t(
'{count} entity updated.',
'{count} entities updated.',
updated
).format(count=updated),
)
)
def get_description(self, job):
dcom = DeletionCommand.objects.get(job=job)
model = dcom.content_type.model... | Python | 1 |
opts = MakeQueueOpts::from_args();
let config = Config::with_config()?;
let stdout = StdoutChannel::new();
let patterns: Vec<_> = opts.patterns.iter().map(StackString::as_str).collect();
make_queue_worker(
&config,
&opts.add,
&opts.remove,
opts.time,
&patterns,
... | Rust | 0 |
pub fn close(&self) {
self.inner.semaphore.close();
self.inner.size_semaphore.close();
self.inner.clear();
}
/// Indicates whether this [`Pool`] has been closed.
pub fn is_closed(&self) -> bool {
self.inner.is_closed()
}
/// Retrieves [`Status`] of this [`Pool`].
... | Rust | 0 |
el prev_symbols[-1]
# Once first element has properly been merged with prev_morse, continue stream as normal
for index, magnitude in stream:
#print((index, magnitude), (prev_index, prev_symbol), result)
# if magnitude exceeds invalid threshold do not consider any ... | Python | 1 |
ubemapLayeredLayers = 54,
cudaDevAttrMaxSurface1DWidth = 55,
cudaDevAttrMaxSurface2DWidth = 56,
cudaDevAttrMaxSurface2DHeight = 57,
cudaDevAttrMaxSurface3DWidth = 58,
cudaDevAttrMaxSurface3DHeight = 59,
cudaDevAttrMaxSurface3DDepth = 60,
cudaDevAttrMaxSurface1DLayeredWidth = 61,
cudaDevA... | Rust | 0 |
t!("Failed to read code: {}", e))?;
code.push(c);
}
code_source = CodeSource::Owned(code);
}
Ok(StatusElement {
location_x,
location_y,
step_x,
step_y,
cycle,
param1,
param2,
param3,
follower,
leader,
under_element_id,
under_colour,
code_current_instruction,
code... | Rust | 0 |
if self.hybrid_engine:
assert Role.ActorRollout in role_worker_mapping, (
f"ActorRollout should be included in {role_worker_mapping.keys()}."
)
else:
raise NotImplementedError
self.role_worker_mapping = role_worker_mapping
self.resource_pool_... | Python | 1 |