text
string
label_name
string
labels
int64
d, Seek, Write}; use crate::mp4box::*; #[derive(Debug, Clone, PartialEq, Default, Serialize)] pub struct TrunBox { pub version: u8, pub flags: u32, pub sample_count: u32, pub data_offset: Option<i32>, pub first_sample_flags: Option<u32>, #[serde(skip_serializing)] pub sample_durations: Ve...
Rust
0
} } } } macro_rules! impl_decodable_for_hash { ($name: ident, $size: expr) => { impl Decodable for $name { fn decode(rlp: &UntrustedRlp) -> Result<Self, DecoderError> { rlp.decoder().decode_value(|bytes| match bytes.len().cmp(&$size) { cmp::Ordering::Less => Err(DecoderError::RlpIsTooShort), cmp...
Rust
0
pub const MUTE_NO_SLEW_ALG_7MUTE: u16 = 884; pub const MUTE_NO_SLEW_ALG_8MUTE: u16 = 885; pub const GAIN_1940_ALG_NS9: u16 = 886; pub const GAIN_1940_ALG_NS10: u16 = 887; pub const MUTE_NO_SLEW_ALG_4MUTE: u16 = 888; pub const GAIN_1940_ALG_NS4: u16 = 889; pub const GAIN_1940_ALG_NS5: u16 = 89...
Rust
0
)+ }; } macro_rules! features { ($($feature:literal,)+) => { &[ $( #[cfg(target_feature = $feature)] $feature, )+ ] } } pub fn arch() -> &'static str { value! { target_arch, "aarch64", "arm", "asmjs", "avr", "hexagon", "le32", "mips...
Rust
0
#listas listcpf=[] listcnpj=[] #classe pai class Pessoa: def __init__(self,nome,idade): self.nome=nome self.idade=idade #classe filho cpf class Pessoacpf(Pessoa): def __init__(self, nome, idade,cpf): super().__init__(nome, idade) self.cpf=cpf def __str__(self): retu...
Python
1
import os import sys from yaku.task_manager \ import \ extension, get_extension_hook from yaku.task \ import \ task_factory from yaku.compiled_fun \ import \ compile_fun from yaku.utils \ import \ ensure_dir, find_program import yaku.errors @extension(".pyx") def cython...
Python
1
Speed::MTs(speed) => assert_eq!(speed, 2666), MemorySpeed::Unknown => panic!("expected speed"), MemorySpeed::SeeExtendedSpeed => panic!("expected speed"), } assert_eq!(test_struct.minimum_voltage(), Some(1200)); assert_eq!(test_struct.maximum_voltage(), Some(1200)); ...
Rust
0
x * r / z, y / z]; } fn to_screen([x0, y0]: [f64; 2], w: f64, h: f64) -> [f64; 2] { let half_w = w * 0.5; let half_h = h * 0.5; let x = x0 * half_w + half_w; let y = y0 * half_h + half_h; [x, y] } fn epic_rotate(p: [f64; 3], theta: f64) -> [f64; 3] { let pq = Quaternion::from_v3(p); let ro...
Rust
0
# -*- coding: utf-8 -*- # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt) # Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016 import numpy as np import pandas as pd import pytest from tsfresh.feature_selection.selection import select_features cl...
Python
1
= 0.0, norm_layer=nn.InstanceNorm2d, num_experts=8, noisy_gating=True, k=2, dim_reduction: float = 4, pregate: bool = False, **norm_kwargs): super(MoEBottleNeckKAGNConv2DLayer, self).__init__(nn.Conv2d, conv2d, norm_layer, input_dim, ou...
Python
1
ec4::new(x as f32, y as f32, z as f32, w as f32)) } declare_optional!(graphene::Vec4); } use iron::{Iron, IronResult, Listening, status}; use iron::error::HttpResult; use iron::response::Response; #[cfg(feature = "gzip")] use iron::response::WriteBody; use iron::request::Request; use iron::middleware::Handler;...
Rust
0
mplates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. html_use_modindex = False # If false, no index is generated. #html_use_index = True ...
Python
1
"""Shows how to implement custom archetypes and components.""" from __future__ import annotations import argparse from typing import Any import numpy as np import numpy.typing as npt import pyarrow as pa import rerun as rr class ConfidenceBatch(rr.ComponentBatchMixin): """A batch of confidence data.""" de...
Python
1
Raises: ValueError: If input dimensions do not match or if neither x and t nor xt are provided. """ if xt is not None: if xt.shape[1] != self.dim + 1: raise ValueError("Input dimension mismatch") return xt elif x is not None and t is not Non...
Python
1
Vec::new(); if contains_extension(physical_device.extensions(), KhrPortabilitySubsetFn::name()) { extension_names.push(KhrPortabilitySubsetFn::name()); } let families = physical_device.queue_families(); let main_queue_family_index = match families .iter() ...
Rust
0
return; } NetlinkPayload::Error(_) | NetlinkPayload::Overrun(_) | _ => return, } offset += rx_packet.header.length as usize; if offset == size || rx_packet.header.length == 0 { offset = 0; break; } }...
Rust
0
yCode": "2", "adminAreaCode": "山东;青岛;市北区", "contactAddr": "", "contactName": "", "contactPhone": "", "contactTel": "", "creator": "李鸿宾", "buyer": "李鸿宾",...
Python
1
mits) # pdp.fit(feat) # # # find the interaction index # start = axis_limits[:, feat][0] # stop = axis_limits[:, feat][1] # x = np.linspace(start, stop, 21) # x = 0.5 * (x[:-1] + x[1:]) # mu, std, stderr = pdp.eval( # feature=feat, xs=x, uncertainty=Tr...
Python
1
t}" return user_prompt def mix_evals_audio2text_process_results_freeform(doc, result): pred = result[0] ground_truth_str = doc["reference_answer"][0] content = eval_prompt.format(model_response=pred, ground_truth=ground_truth_str) eval_answer, model_name = get_eval(model_response=pred, ground_trut...
Python
1
n = str(input('digite seu nome completo: ')).strip().split() n1 = n[0] nu = n[-1] print(' o primeiro nome é {}.'.format(n1)) print(' o último nome é {}.'.format(nu)) #outro jeito print('o último nome é {}.'.format(n[len(n)-1])) #len de nome mostra quantas posições tem o nome que já tá dividido em listas
Python
1
gle_derivative,angle_sec_derivative,\ theta_r,theta_f0,theta_f1,\ M,m,mu,pho_air,A0,Cx,J,width,L,Wf,h,n_wheels): #discretization lenght deltatheta = 1/(M-1) #midpoints discretization discretization=np.linspace(deltatheta/2,1-deltatheta/2,num = M-1) #Force matrix R t...
Python
1
######################################################################### ## This file is part of the α,β-CROWN (alpha-beta-CROWN) verifier ## ## ## ## Copyright (C) 2021-2025 The α,β-CROWN Team ## ## Primary contacts: H...
Python
1
rt" content="width=device-width, initial-scale=1"> <title>NetDash - داشبورد ترافیک شبکه</title> <!-- 1) اول: config مربوط به Tailwind --> <!-- Tailwind via CDN --> <script src="https://cdn.tailwindcss.com"></script> <script> tailwind.config = { darkMode: 'class', theme: { extend: { fontFamily...
Python
1
app. Does not return. pub fn run(window: T) -> ! { let app = Self { phantom: PhantomData::default(), }; Runtime::new(app).run(window.get_window_builder(), window) } } <reponame>dgoodlad/crabdac #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x0...
Rust
0
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str(&self.scope.name)?; f.write_char('/')?; f.write_str(&self.stream.name)?; Ok(()) } } impl Display for ScopedSegment { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str(&NameUtils::get_qua...
Rust
0
struct RecvParams { msg_signature: String, timestamp: u64, nonce: u64, } async fn validate<T: App>( info: web::Query<ValidateParams>, server: web::Data<Server<T>>, ) -> HttpResponse { info!("validate request: params: {:?}", info); let crypto = &server.crypto; let payload = match crypt...
Rust
0
tln!("Master {} is running on port {}", pid, port); task::block_on(async { let mut app = tide::new(); app.with(After(|response: Response| async move { let response = match response.status() { StatusCode::NotFound => Response::builder(404).body("404 Not Found").build(), ...
Rust
0
onst KECCAK_EMPTY: H256 = H256([ 0xc5, 0xd2, 0x46, 0x01, 0x86, 0xf7, 0x23, 0x3c, 0x92, 0x7e, 0x7d, 0xb2, 0xdc, 0xc7, 0x03, 0xc0, 0xe5, 0x00, 0xb6, 0x53, 0xca, 0x82, 0x27, 0x3b, 0x7b, 0xfa, 0xd8, 0x04, 0x5d, 0x85, 0xa4, 0x70, ]); /// The KECCAK of the RLP encoding of empty data. pub const KECCAK_NULL_RLP: H256 = H256...
Rust
0
"""A script for creating a S3 bucket.""" # Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE import logging import os import sys import boto3 from botocore.exceptions import ClientError logging.basicConfig(stream=sys.stdout, level=logging.INFO) logger = logging.getLogger(__name_...
Python
1
# USAGE # python3.6 liveness_demo.py --model liveness.model --le le.pickle --detector face_detector # import the necessary packages from imutils.video import VideoStream from keras.preprocessing.image import img_to_array from keras.models import load_model import numpy as np import argparse import imutils import pickl...
Python
1
ld fail let deposit_amount = Uint256::from(DEPOSIT_AMOUNT); let mut config = config::read(&deps.storage).unwrap(); config.deposit_config.total_cap = deposit_amount.div(Decimal256::from_str("2.0").unwrap()); config::store(&mut deps.storage, &config).unwrap(); let msg = ExecuteMsg::DepositInternal ...
Rust
0
dictionary EXCEPT, // throw exception ALLOC, // allocate record PUSHNIL, // push nil pointer RESETC, // reset cell PUSHPEG, // push pointer to external global JUMPTBL, // jump table CALLX, // call extension SWAP, // swap two top stack elements DROPN,...
Rust
0
alid; qed") .public() } /// The extensions for the [`ChainSpec`]. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)] #[serde(deny_unknown_fields)] pub struct Extensions { /// The relay chain of the Parachain. pub relay_chain: String, /// The id of the Parachain. pub pa...
Rust
0
to-macros.html#some-more-gotchas /// Assert that an expression returning a `Result` is a success. If it is, /// return the value contained in the result, i.e. `expr.unwrap()`. #[cfg(test)] macro_rules! assert_success { ($e: expr) => { { let res = $e; assert!(res.is_ok()); ...
Rust
0
# jobs/views.py from django.views import View from django.http import JsonResponse from .models import Job class JobList(View): def get(self, request): jobs = list(Job.objects.values()) # get all jobs as dicts return JsonResponse(jobs, safe=False)
Python
1
if end_fraction > 0: output_document.extend( doc[int(end_fraction * num_words):]) print ("{0} {1}".format(query, " ".join(output_document)), file=args.output_documents) except Exception: logger.e...
Python
1
ing * Contact: <EMAIL> * Generated by: https://openapi-generator.tech */ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct InvasionAllOf { #[serde(rename = "attacker", skip_serializing_if = "Option::is_none")] pub attacker: Option<Box<serde_json::Value>>, #[serde(rename =...
Rust
0
pub fn other_branch(&mut self) -> &mut Block { &mut self.other } /// formats the conditional pub fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result { write!(fmt, "if (")?; self.cond.fmt(fmt)?; writeln!(fmt, ") ")?; fmt.block(|f| self.then.fmt(f))?; if !sel...
Rust
0
Chemical.XA1) structural_class = Table4Dot3ConcreteStructuralClass(exposure_classes, 50, ConcreteMaterial(ConcreteStrengthClass("C20/25")), True, False) c_min_dur = Table4Dot5nMinimumCoverDurabilityPrestressingSteel( exposure_classes=exposure_classes, structural_class=structura...
Python
1
import numpy as np from graph_rl.graph_rl.spaces import BoxSpace from .box_subtask_spec_factory import BoxSubtaskSpecFactory class UR5ReacherSubtaskSpecFactory(BoxSubtaskSpecFactory): @classmethod def bound_angle(cls, angle): bounded_angle = np.absolute(angle) % (2*np.pi) if angle < 0: ...
Python
1
# Copyright 2025 Google LLC # # 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, s...
Python
1
) def ReferenceTestingTask(agent, requirement): return Task( description="""Consider the Architecture Planning for the Flask Application. Create a reference document that explains how to use the Flask application. Here is the Technical ...
Python
1
import streamlit as st import pandas as pd import matplotlib.pyplot as plt # Page Configuration st.set_page_config(page_title="Interactive Data Dashboard", layout="wide") # Custom Styling st.markdown( """ <style> .main { background-color: #f4f4f4; } h1 { color: ...
Python
1
begin()); let err = match result { Ok((rest, t)) => { if rest.eof() { return Ok(t); } else if rest == buf.begin() { // parsed nothing ParseError::new("failed to parse anything") } else { ParseError::new("fail...
Rust
0
Wnt j k r}|j t j dt|t|t|fnEtk r }|j tdt|t|t|fnXdS(s serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module s%s: '%s' when writing '%...
Python
1
<Self> { match value { 1 => Some(ContestType::Cool), 2 => Some(ContestType::Beauty), 3 => Some(ContestType::Cute), 4 => Some(ContestType::Smart), 5 => Some(ContestType::Tough), _ => None, } } } impl std::convert::From<ContestTy...
Rust
0
OR_DEVICE, NexusErrStore::WRITE_FLAG, 1, Some(1_000_000_000), ); nexus_err_query_and_test( BDEVNAME1, NexusErrStore::READ_FLAG | NexusErrStore::WRITE_FLAG, 0, Some(1_000_000_000), ); Reactor::block_on(async { inject_error( EE_E...
Rust
0
redictions, targets) return result def _get_predict_ops(self, features): """Method that builds model graph and returns prediction ops. Expected to be overriden by sub-classes that require custom support. This implementation uses `model_fn` passed as parameter to constructor to build model. ...
Python
1
ait; app_server .create_database(DatabaseRules::new( DatabaseName::new("MyOrg_MyBucket").unwrap(), )) .await .unwrap(); let server_url = test_server(Arc::clone(&app_server)); let client = Client::new(); let lp_data = "h2o_...
Rust
0
import json import sys sys.path.append("/starcal2") from scal3 import event_lib, logger, ui from scal3.cal_types import calTypes from scal3.date_utils import dateDecode def dataToPrettyJson(data): return json.dumps(data, sort_keys=True, indent=2) log = logger.get() GREGORIAN = calTypes.get("gregorian") DATE_JAL...
Python
1
if not value and not ( healthcheck.get("test_cli_compatible") and key == "test" ): continue if key == "retries": try: value = int(value) except ValueError: raise ValueError( ...
Python
1
for('userbp.reset', token=token, _external=True) # Render an HTML template to send by email html = render_template('email/reset.html', reset_url=resetUrl) # Send the email to user email.send(user.email, subject, html) # Send back to the home page f...
Python
1
< 0 && (r * y != x) { r = r - 1; } r } fn floor_mod(x: i64, y: i64) -> i64 { x - floor_div(x, y) * y } <gh_stars>0 // Copyright (c) 2019 - 2020 ESRLabs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // ...
Rust
0
import math import warnings import torch import torch.nn as nn import torch.nn.functional as F import collections.abc as abc from itertools import repeat class GELU(nn.Module): def forward(self, input): return F.gelu(input) def _ntuple(n): def parse(x): if isinstance(x, abc.Iterable): ...
Python
1
let ref mut w = BufWriter::new(file); let mut encoder = png::Encoder::new(w, 2, 1); // Width is 2 pixels and height is 1. encoder.set_color(png::ColorType::Rgba); encoder.set_depth(png::BitDepth::Eight); // Adding text chunks to the header encoder .add_text_chunk( "Testing tE...
Rust
0
} } pub fn account_address(&self) -> &AccountAddress { &self.account_address } pub fn validator_network_identity_pubkey(&self) -> &X25519StaticPublicKey { &self.validator_network_identity_pubkey } pub fn validator_network_address(&self) -> &Multiaddr { &self.vali...
Rust
0
() -> impl Iterator<Item = Self> { [ Bug::Queen, Bug::Grasshopper, Bug::Spider, Bug::Ant, Bug::Beetle, Bug::Mosquito, Bug::Ladybug, Bug::Pillbug, ] .iter() .copied() } pub fn from_cha...
Rust
0
t ratio = (2_f32.ln()/12_f32).exp(); for _ in 0..solfa_name { ap *= ratio; } ap *= (fine_tune*(2_f32.ln()/1200_f32)).exp(); ap } pub fn pseudo_sine(mut phase:f32) -> f32 { // Lagrange interpolation while phase > 1.0 { phase -= 1.0 } let nrm_pha...
Rust
0
x01\ H\x9aU\xd2\x11\xc0\xbfq\xe3off\xdd\xe3\x93\xc0\ \x1d\x92\xce\x924o\xee0\xfd:b\x04\xc0U\xfc\xcc\ \xcc\xacG\xbc\x0c\x1c\x02\x9c\x1b\x11\x13s\x06\xc9\xda\x01\ \x90\xb4<i\x9e\x7f\xa3l!\xcc\xcc\xcc\xda\xef\x0e\xd2\ \xb4\xc0\xad\xb9\x02d\x99\x02\xa8\xaa\xf8\x9d\x02\xdc\x8b\x1b\ \x7f33\xeb=k\x02\xb7H:OR\x96\xa2vm\ \x1d\x...
Python
1
def convert_link(old_link): # Check if the old link matches the expected format if "cad.onshape.com/documents/" in old_link: # Remove 'https://' if it exists in the link old_link = old_link.replace("https://", "") # Split the link to extract document id, workspace id, and elemen...
Python
1
ol_rx: mpsc::Receiver<ControlMessage>, solver_loop_rx: mpsc::Receiver<ControlMessage>, solver_stopped_tx: mpsc::Sender<ControlMessage>, ) { { let mut s = shared_data.write().unwrap(); s.stats[instance].set_plugin_name(ALGORITHM_NAME); } let mut last_solution_time = 0; let mut iter_count = 0; let m...
Rust
0
.bits >> 16) & 0xff) as u8) } #[doc = "Bits 8:15 - Number of regions supported by the MPU."] #[inline(always)] pub fn dregion(&self) -> DREGION_R { DREGION_R::new(((self.bits >> 8) & 0xff) as u8) } #[doc = "Bit 0 - Indicates support for separate instruction and data address maps. Reads a...
Rust
0
"G" | "g" => Ok(G), "GA" | "ga" => Ok(GA), "GN" | "gn" => Ok(GN), "GV" | "gv" => Ok(GV), "H" | "h" => Ok(H), "I" | "i" => Ok(I), "IA" | "ia" => Ok(IA), "IC" | "ic" => Ok(IC), "IN" | "in" => Ok(IN), "IV" | ...
Rust
0
a dictionary. Returns: LayersInBorehole: The LayersInBorehole object. """ return cls([Layer.from_json(layer_data) for layer_data in json_object]) @dataclass class ExtractedBorehole: """A class to store the extracted information of one single borehole.""" predictions: lis...
Python
1
import pyodbc from pyneoinstance import Neo4jInstance from pyneoinstance import load_yaml_file # Set up connections config = load_yaml_file('C:/Users/lschloemer/Nextcloud/MOBDA 2.0/VSCodeMOBDARepository/Python/a.yaml') db_info = config['db_infoneo'] graph = Neo4jInstance(db_info['uri'],db_info['database'],db_info['pa...
Python
1
) @{jcfmm73b6a5 for pc1pwsg1vrf in 0.0 if xxeg1yztdey if 0j} @eni3v18xxpd % None def hi5c_25s_9k(gpj2bctvg5n, lamznkg3i8w: lyo1f1equwc): global wqclewd5wod return q9wbehnyxkk raise None lftknrusyrm /= w1cenezif9j '# throttle_motels_definition -> program_exception_cakes' import k1w3snna_ut, grcwo...
Python
1
import os from dotenv import load_dotenv class SecretsService: def __init__(self, env: str): self.secrets = {} if env == "prod": self.fetch_secrets_from_aws() else: self.fetch_secrets_from_env() def fetch_secrets_from_env(self): load_dotenv() se...
Python
1
: *mut seL4_IPCBuffer, /// Empty slots (null caps) pub empty: seL4_SlotRegion, /// Frames shared between nodes pub sharedFrames: seL4_SlotRegion, /// Frame caps used for the loaded ELF image of the root task pub userImageFrames: seL4_SlotRegion, /// PD caps used for the loaded ELF imag...
Rust
0
(dyn error::Error + 'static)> { match *self { StartupError::InvalidConfiguration(_) => None, StartupError::Fail(ref e) => Some(e), } } } impl<E> From<E> for StartupError<E> where E: Error + fmt::Debug { fn from(err: E) -> StartupError<E> { StartupError::Fail(err) } } #[derive(Debug)] pub enu...
Rust
0
_user_mem_block_t() { assert_eq!( ::core::mem::size_of::<ble_user_mem_block_t>(), 8usize, concat!("Size of: ", stringify!(ble_user_mem_block_t)) ); assert_eq!( ::core::mem::align_of::<ble_user_mem_block_t>(), 4usize, concat!("Alignment of ", stringify!(ble_use...
Rust
0
self.capable_of(caps)?; Ok(&*self.file) } fn get_cap_mut(&mut self, caps: FileCaps) -> Result<&mut dyn WasiFile, Error> { self.capable_of(caps)?; Ok(&mut *self.file) } } bitflags! { pub struct FileCaps : u32 { const DATASYNC = 0b1; const READ ...
Rust
0
#[inline(always)] pub fn variant(&self) -> TRIGGERED10_A { match self.bits { false => TRIGGERED10_A::DISABLED, true => TRIGGERED10_A::ENABLED, } } #[doc = "Checks if the value of the field is `DISABLED`"] #[inline(always)] pub fn is_disabled(&self) -> bool { ...
Rust
0
ax_val > 0: zero_dominant = True # Estimate zero proportion from mean and max value zero_proportion = max(zero_proportion, 1 - (mean / max_val)) if zero_dominant: # Generate zero-dominated distribution n_zeros = int(num_rows * zero_proportion) ...
Python
1
li.x = (li.lp.x1 + li.li.y) >> POLY_SUBPIXEL_SHIFT; if lp.inc > 0 { di.dec_y(li.x - li.old_x); } else { di.inc_y(li.x - li.old_x); } li.old_x = li.x; let mut dist1_start = di.dist_start; ...
Rust
0
} } fn poll_flush_buf(&mut self, cx: &mut Context<'_>, stream: &mut Self::StreamW) -> Poll<Result<()>> { Pin::new(stream).poll_flush(cx) } } #[inline] fn splice_n(r: RawFd, w: RawFd, n: usize) -> isize { use libc::{loff_t, SPLICE_F_MOVE, SPLICE_F_NONBLOCK}; unsafe { libc::...
Rust
0
break except Exception: pass def verify_settings_json(): """Verify the settings.json has the correct format.""" print("\n=== Verifying Settings.json Format ===") project_root = find_project_root() if not project_root: print("❌ Could not find project root") return se...
Python
1
String; type Property = (); type Interface = (); type Method = (); type Signal = (); } static NAME: &str = "com.blah.sizecheck"; static PATH: &str = "/com/blah/sizecheck"; fn main() { let c = Connection::get_private(BusType::Session).unwrap(); c.register_name(NAME, NameFlag::ReplaceExisting a...
Rust
0
f32, IndexVar>::from_iter(tokens).unwrap(); assert_eq!(expr.evaluate_with_variables(&variables), Ok(500.0)); } #[test] fn simple_linkedlist_variable_expression() { use std::collections::LinkedList; let mut variables = LinkedList::new(); variables.push_back(3.0); var...
Rust
0
"from": "00:00:00", "to": "0:10:00" }], "thu": [{ "url": "https://www.youtube.com/watch?v=0wAtNWA93hM", "title": "Круг Жизни", "from": "00:00:00", "to": "0:10:00" ...
Rust
0
(|v| min(v, &1i8)) .map(|&v| 1i8 - v) .collect(); for sep_position in sep_indices { p_mask[sep_position] = 1; } p_mask } } pub fn squad_processor(file_path: PathBuf) -> Vec<QaInput> { let file = fs::File::open(file_path).expect("unable to open file");...
Rust
0
per(instr, OperandSize::Qword, output_dir, test_count)?; } Ok(()) } pub fn emit_tests_helper(instr: &InstructionDefinition, addr_size: OperandSize, output_dir: &str, test_count: &mut HashMap<String, u32>) -> io::Result<()> { if should_skip_instr(instr) { return Ok(()); } let test_instrs = build_test_...
Rust
0
.iter().max_by_key(|&(p, _)| p.y).unwrap().0.y as u32 + 1; Self { width, height, fields, } } pub fn find_shortest_path(&self) -> u32 { let (initial_node, _) = self.fields[0]; let mut best = self .fields .iter() ...
Rust
0
''' This dataset comes from the Department of Labor, specifically, the Women's Bureau. As it is a cleaned dataset, I will explore the data, answer analysis questions, and visualize the results. ''' import pandas as pd import matplotlib.pyplot as plt import numpy as np labor_df = pd.read_excel("Labor-force-participat...
Python
1
mut p: buffer::Buffer) -> Self::Pkt { CreateSuccess { object_id: p.read_i32(), char_id: p.read_i32(), } } } #[derive(Debug)] pub struct Update { pub tiles: Vec<types::GroundTile>, pub new_objs: Vec<types::ObjectData>, pub drops: Vec<i32>, } impl ServerPacket for...
Rust
0
.raises(ValueError): reconstruction(seed, mask, method='foo') def test_invalid_offset_not_none(): """Test reconstruction with invalid not None offset parameter""" image = np.array( [ [1, 1, 1, 1, 1, 1, 1, 1], [1, 2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1...
Python
1
_SIZE] results = [] with ThreadPoolExecutor(max_workers=THREADS) as executor: futures = [executor.submit(scrape_attendance, roll + "P") for roll in batch] for future in as_completed(futures): result = future.result() if result: ...
Python
1
impl From<xproto::LookupColorReply> for Reply { fn from(reply: xproto::LookupColorReply) -> Reply { Reply::LookupColor(reply) } } impl From<xproto::QueryBestSizeReply> for Reply { fn from(reply: xproto::QueryBestSizeReply) -> Reply { Reply::QueryBestSize(reply) } } impl From<xproto::QueryExtensionReply...
Rust
0
: usize, AMode: TLayoutAdjustmentPolicy, AFromPPI: i32, AToPPI: i32, AOldFormWidth: i32, ANewFormWidth: i32); pub fn ToggleBox_FixDesignFontsPPI(AObj: usize, ADesignTimePPI: i32); pub fn ToggleBox_ScaleFontsPPI(AObj: usize, AToPPI: i32, AProportion: *mut f64); pub fn ToggleBox_GetAllowGrayed(AObj: usize) -> bool;...
Rust
0
import uuid from django.db import models from django.utils import timezone from apps.core.managers.base import BaseManager class BaseModel(models.Model): class Meta: abstract = True id = models.UUIDField(primary_key=True, default=uuid.uuid4) created_at = models.DateTimeField(auto_now_add=True) ...
Python
1
u8::from_str_radix(&v["ledColorActive"].as_str()?[5..7], 16).ok()?, ], inactive: [ u8::from_str_radix(&v["ledColorInactive"].as_str()?[1..3], 16).ok()?, u8::from_str_radix(&v["ledColorInactive"].as_str()?[3..5], 16).ok()?, u8::from_str_radix(&v["ledColorInactive"].as_str()?[...
Rust
0
} => { and_mask = !zeros; or_mask = ones; } Instr::Mem { at, value } => mem.put(at, (value & and_mask) | or_mask), } } mem.sum() } #[inline(always)] fn set_bit(val: u64, bit: usize) -> u64 { val | 1 << bit } #[inline(always)] fn unset_bit(v...
Rust
0
:#X}: {:#X}.", // i, // self.mapper.borrow().get_byte_ppu(i)); // } // panic!(); //} } nmi } } #[doc = "Register `ANALOG_CNTL` reader"] pub struct R(crate::R<ANALOG_CNTL_SPEC>); impl core::ops::Deref for R { ...
Rust
0
_square_uniform_quad_mesh_2d, create_unit_square_uniform_tri_mesh_2d}; use fenris::mesh::{Mesh2d, Quad9Mesh2d, Tri6Mesh2d}; use fenris::nalgebra::coordinates::XY; use fenris::nalgebra::{OPoint, OVector, Point2, Vector1, Vector2, U1, U2}; use fenris::quadrature; use fenris::quadrature::QuadraturePair2d; use std::f64::co...
Rust
0
rectangle_request_t` struct. #[inline] pub unsafe fn xcb_poly_rectangle_rectangles( &self, r: *const xcb_poly_rectangle_request_t, ) -> *mut xcb_rectangle_t { sym!(self, xcb_poly_rectangle_rectangles)(r) } /// Returns `true` iff the symbol `xcb_poly_rectangle_rectangles` cou...
Rust
0
turn gradients, self.current_clipping_norm # クリッピング閾値の決定 effective_clipping_norm = clipping_norm if clipping_norm is not None else self.current_clipping_norm # numpy配列の場合の処理 if isinstance(gradients, np.ndarray): gradient_norm = np.linalg.norm(gradients) # 適応的クリ...
Python
1
strip_current_dir(Path::new("foo/bar/baz")), Path::new("foo/bar/baz") ); } } #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "wasm-bindgen" { # [wasm_bindgen (extends = HtmlElement , extends = Element , extends = Node , extends = Even...
Rust
0
cost pairs debug!(" About to return Knapsack {:?} ", result); Ok(result) } // end if non-empty line } /// This parser reads one problem from a "dot csv" file -- taken to be in "Pisinger format, /// where each file contains 100 knapsack problems -- /// and returns one problem -- or nothing, if no pr...
Rust
0
from django.db import migrations, models UPGRADE_SET_FORMAT_FOR_ROLE_REPOS = """ UPDATE main_repository SET "format" = 'role' WHERE id IN ( SELECT DISTINCT c.repository_id FROM main_content c JOIN main_contenttype ct on c.content_type_id = ct.id WHERE ct.name = 'role' AND c.repository_id IN ( SELE...
Python
1
import logging import os from os.path import join from typing import Any, Callable, Optional, Tuple from PIL import Image from torchvision.datasets import VisionDataset from torchvision.datasets.utils import check_integrity, download_and_extract_archive log = logging.getLogger(__name__) class Textures(VisionDataset...
Python
1
#3 a = input("Введите текст: ") def f(t): c = t.count('.') m = t.replace('.', '') return m, c r, p = f(a) print("Измененный текст:", r) print(f"Количество удалений: {p}")
Python
1