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
}xj|D]b\}}|dkrt}n|d krt}n|d krt}n|d krt dSqW|r:|dd kr:t |dd }|||jWdQXn||j |jdS(sSmall test programiNitdeutsusage: %s [-d|-e|-u|-t] [file|-] -d, -u: decode -e: encode (d...
Python
1
hex::decode(ed25519_address.address) .map_err(|_| crate::Error::InvalidAddress)? .try_into() .map_err(|_| crate::Error::InvalidAddressLength)?, )), }; (address, outpu...
Rust
0
CLIENT_ID = "08cb230a331944c7bfa503dfc73dd46c" CLIENT_SECRET = "f78338ef85e74cf2be80970a90406b69" REDIRECT_URI = "http://127.0.0.1:8000/spotify/redirect"
Python
1
._build_networks() # 扩散调度器 self._setup_diffusion_schedule() self.logger = logging.getLogger(__name__) def _build_networks(self): """构建网络""" # U-Net网络 self.unet = UNet1D( input_dim=self.pose_dim, time_embed_di...
Python
1
*const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(bntamb1_t), "::", stringify!(len) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<bntamb1_t>())).amb as *const _ as usize }, 12usize, concat!( ...
Rust
0
atio = 1000 * 5 / 8 # , not 1000*1000/8, because this is for 5 ms self.__capaMatrix[enode1][enode2] = float(lineList[3]) * scale_ratio self.__capaMatrix[enode2][enode1] = float(lineList[3]) * scale_ratio def initFlowMap(self): for i in range(self.__nodenum): self.__flo...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class SaleOrderLine(models.Model): _inherit = 'sale.order.line' is_delivery = fields.Boolean(string="Is a Delivery", default=False) product_qty = fields.Float( string='Product Qty', co...
Python
1
ew(3556, "Ethiopia", "Lalibela", 12.0333333, 39.0333328, 2236.0), City::new(3557, "Ethiopia", "Gidole", 5.6500000, 37.3666649, 2045.0), City::new(3558, "Ethiopia", "<NAME>", 8.6666667, 38.2166672, 2193.0), City::new(3559, "Ethiopia", "Sire", 8.3166667, 39.4833336, 1736.0), City::new(3560, "Ethiopia", "<NAME>", 9.03...
Rust
0
e) => sub_pop(&**e, refs), Superscript(e) => sub_pop(&**e, refs), Subscript(e) => sub_pop(&**e, refs), Inline(e) => sub_pop(&**e, refs), Problematic(e) => sub_pop(&**e, refs), Generated(e) => sub_pop(&**e, refs), Math(_) => {}, TargetInline(_) => { unimplemented!(); }, RawInline(_) => {},...
Rust
0
personalization: Some(cust.to_vec()), block_len: None, exp, }) } fn b3(&mut self, data: &[u8], dk_len: usize) { let mut h = blake3::Hasher::new(); h.update(data); let mut exp = vec![0u8; dk_len]; let mut output_reader = h.finalize_xof(); ...
Rust
0
n -= len; unsafe { ptr::copy_nonoverlapping(ptr_src, ptr_dst, len); ptr_dst = ptr_dst.offset(len as isize); } let pos = block.write_pos(); block.set_read_pos(pos); } Err(Error::Underflow) } #[inline] pub fn get(chain: &mut GetIter) -> Result<Vec<u...
Rust
0
use util::{Rect, Color}; fn fmin(a: f32, b: f32) -> f32 { if b < a { b } else { a } } fn fmax(a: f32, b: f32) -> f32 { if b > a { b } else { a } } struct State { camera: Camera, aspect_ratio: f32, active_model_idx: usize, } impl State { fn new() -> Self { Self { aspect_ra...
Rust
0
]]), np.array([new_goal - next_position]), new_task, np.array(next_state[3:])]) finish = (cur_state[-2] == 1) if args.HER_only_success: if done: if args.early_stop: repla...
Python
1
def sort_third(l: list): """This function takes a list l and returns a list l' such that l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal to the values of the corresponding indicies of l, but sorted. >>> sort_thi...
Python
1
terminated, tuple}; use nom::IResult; use nalgebra::{Matrix3, Point3, Vector3}; const ROTATION_MATRICES: [[[i64; 3]; 3]; 24] = [ [[1, 0, 0], [0, 1, 0], [0, 0, 1]], [[1, 0, 0], [0, 0, -1], [0, 1, 0]], [[0, 0, -1], [-1, 0, 0], [0, 1, 0]], [[-1, 0, 0], [0, 0, 1], [0, 1, 0]], [[0, 0, 1], [1...
Rust
0
= encoder_type self.GE1 = GraphEncoder( num_layers=layers_graph[0], num_node=num_chan, in_features=num_feature, out_features=hidden_graph, K=K, graph2token=graph2token, encoder_type=encoder_type ) self.GE2 = GraphEncoder( num_layers=layers_graph[1], num_node=...
Python
1
': title }) elif "chapter" in element_class: data_level = li.attrib.get('data-level') level = len(data_level.split('.')) if 'data-path' in li.attrib: data_path = li.attrib.get('data-path') url = urljoin(s...
Python
1
step self.optimizer_actor.zero_grad() self.optimizer_critic.zero_grad() loss.backward() # Optional: Gradient clipping for stability # nn.utils.clip_grad_norm_(self.actor.parameters(), max_norm=0.5) # nn.utils.clip_grad_norm_(self.critic.parameters...
Python
1
s_mix[-per_page:] # if the last page was not full, fill it with blanks and add the back side if page_used: badges_mix += ([None] * (per_page - page_used)) + badges_mix[-page_used:] positioned_badges = zip(badges_mix, self._iter_position(canvas, n_horizontal, n_vertical), strict=Fal...
Python
1
git_repo: "https://github.com/pontem-network/move-stdlib", rev: Some("release-v1.0.0"), path_to_clone: "./move/move-stdlib", build_with_dove: true, }) .unwrap(); fetch(FetchConfig { git_repo: "https://github.com/pontem-network/pont-stdlib.git", rev: Some("relea...
Rust
0
ai/configuration/open-ai-compatibility/ cloudflare_api = "https://api.cloudflare.com/client/v4/accounts" base_url = f"{cloudflare_api}/{account}/ai/v1/" return Chat( provider=CloudflareProvider( api_key=api_key, model=model, base_url=base_url, seed=se...
Python
1
}'.format(numero, fatorial)) """8. Faça um programa que solicite ao usuário números indefinidamente até que ele digite 0. Em seguida, o programa deve imprimir a média dos números digitados """ soma = 0 contador = 0 while True: numero = float(input('Digite um número (ou 0 para sair): ')) if numero == 0: brea...
Python
1
[cfg(test)] mod tests { use super::*; use pest::*; #[test] // fn test_strs() { // let e: Expr = "3 + 5 *(7-3)".parse().unwrap(); // assert_eq!( // e, // op( // Oper::Add, // Expr::Num(3), // op( // ...
Rust
0
, 0.5) ]) } } impl<T> FiniteElement<T> for Tet4Element<T> where T: RealField, { type GeometryDim = U3; #[allow(non_snake_case)] fn reference_jacobian(&self, xi: &Vector3<T>) -> Matrix3<T> { // TODO: Could store this matrix directly in the element, in order // to avoid repea...
Rust
0
#Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu> # #This Source Code Form is subject to the terms of the Mozilla Public #License, v. 2.0. If a copy of the MPL was not distributed with this #file, you can obtain one at http://mozilla.org/MPL/2.0/. #Exhibit B is not attached; this software is compatible with the #lic...
Python
1
from utils.board import Board def minimax( position: Board, depth: int, alpha: int, beta: int, isMaximizingPlayer: bool ) -> int: if depth == 0 or position.check_game_over() is True: return position.evaluate_board() if isMaximizingPlayer: maxEval = float("-inf") legal_moves = posi...
Python
1
(crate::FieldReader<u8, u8>); impl TX_BCK_IN_DELAY_R { #[inline(always)] pub(crate) fn new(bits: u8) -> Self { TX_BCK_IN_DELAY_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for TX_BCK_IN_DELAY_R { type Target = crate::FieldReader<u8, u8>; #[inline(always)] fn deref(&self) ->...
Rust
0
rix_High_2 = ctx.saved_variables grad_L = torch.matmul(matrix_Low_0, grad_output) grad_H = torch.matmul(matrix_High_0, grad_output) grad_LL = torch.matmul(grad_L, matrix_Low_1).transpose(dim0 = 2, dim1 = 3) grad_LH = torch.matmul(grad_L, matrix_High_1).transpose(dim0 = 2, dim1 = 3) ...
Python
1