text
string
label_name
string
labels
int64
from trackBuilder import Track from numpy import * from matplotlib.pyplot import * #define our track based on a list of length values and a list of angle values. #for a straight, the entry in lengths means how long the straight is, and #the corresponding angles entry should be 0. For a turn, the length value #is the t...
Python
1
from typing import Optional from pydantic import Field, field_validator from woningwaardering.vera.bvg.generated import Referentiedata class _Referentiedata(Referentiedata): # https://github.com/Aedes-datastandaarden/vera-openapi/issues/53 parent: Optional[Referentiedata] = Field(None, exclude=True) """...
Python
1
(s.with_pipeline_stage(DistinctUntilChangedStage::new()), r) } } #[cfg(test)] mod tests { use crate::{operators::distinct_until_changed::DistinctUntilChangedStage, PipelineStage}; #[test] fn stage_holds_state_when_cloned() { let s1 = DistinctUntilChangedStage::<i32>::new(); let s2 = s1...
Rust
0
return value """ self.symbol = symbol self.a = numpy.asarray(a, dtype=float) self.b = numpy.asarray(b, dtype=float) self.c = float(c) def atstol(self, stol): """ Calculate x-ray scattering factors at specified sin(theta)/lambda *stol* : float or [fl...
Python
1
} fn spawn_rabbit( mut commands: Commands, textures: Res<TextureAssets>, mut burrows: Query<(&Transform, &mut Burrow)>, ) { for (transform, mut burrow) in burrows.iter_mut() { if burrow.state == BurrowState::Spawn { commands .spawn_bundle(SpriteBundle { ...
Rust
0
alue_get_boxed(value.to_glib_none().0); assert!(!ptr.is_null()); Some(&*(ptr as *mut Boxed<T>)) } } impl<'a, T: BoxedType> FromValue<'a> for &'a Boxed<T> { unsafe fn from_value(value: &'a Value) -> Self { let ptr = gobject_ffi::g_value_get_boxed(value.to_glib_none().0); assert!(...
Rust
0
/// Clears the vector, removing all nibbles. pub fn clear(&mut self) { self.inner.clear(); self.has_right_lo = true; } /// Intreprets this array as a slice. pub fn as_slice(&self) -> NibSliceAligned { if self.has_right_lo { NibSliceAligned::Even(unsafe { &*(&sel...
Rust
0
urs = distance / speed if speed > 0 else 0 time_str = f"{int(time_hours)}:{int((time_hours % 1) * 60):02d}" # Calculate power estimate (rough) ftp_estimate = 220 if is_demo else 200 # Default estimates if effort_level == 'zone2': power_estima...
Python
1
, Criterion}; use json_event_parser::{JsonEvent, JsonReader}; use std::fs::{read_dir, File}; use std::io::{Cursor, Read}; fn bench_json_parse(c: &mut Criterion) { let examples = load_testsuite_examples(); c.bench_function("JSON test suite", |b| { b.iter(|| { let mut buffer = Vec::new(); ...
Rust
0
t(30) print("waiting") def likePost(): # time.sleep(2) # like = driver.find_element(By.CLASS_NAME,'fr66n') # soup = bs(like.get_attribute('innerHTML'),'html.parser') # if(soup.find('svg')['aria-label'] == 'Like'): # like.click() # time.sleep(2) time.sleep(2) print("almost li...
Python
1
es: [Option<usize>; 3], pub vertex_normals: [usize; 3], } named!(face_index<CompleteStr, (usize, Option<usize>, usize)>, do_parse!( v: digit >> opt!(tag!("/")) >> t: opt!(digit) >> opt!(tag!("/")) >> vn: digit >> (v.parse::<usize>().unwrap(), match t { ...
Rust
0
= include_bytes!( "fonts/OpenSans-ExtraBold.ttf"); return ttf1;}, Fonts::RobotoCondensedItalic=>{ let ttf1 = include_bytes!( "fonts/RobotoCondensed-Italic.ttf"); return ttf1;}, Fonts::OpenSansExtraBoldItalic=>{ let ttf1 = include_bytes!( "fonts/OpenSans-ExtraBoldItalic.ttf"); return ttf1;}, Fonts::RobotoThinItal...
Rust
0
_compile( current_dir: &Path, path_to_c_src: &Path, output_name: &Path, ) -> anyhow::Result<()> { #[cfg(not(windows))] let c_compiler = "cc"; #[cfg(windows)] let c_compiler = "clang++"; let output = Command::new(c_compiler) .current_dir(current_dir) .arg("-O2") ....
Rust
0
rieving DaaS document {} ...", path.clone()); let serialized: String = match fs::read_to_string(path.clone()) { Ok(c) => { c }, Err(e) => { error!("Could not read the DaaS document {} from storage. {}", path, e); ...
Rust
0
ay14_p1_large_2() { let input = "2 VPVL, 7 FWMGM, 2 CXFTF, 11 MNCFX => 1 STKFG 17 NVRVD, 3 JNWZP => 8 VPVL 53 STKFG, 6 MNCFX, 46 VJHF, 81 HVMC, 68 CXFTF, 25 GNMV => 1 FUEL 22 VJHF, 37 MNCFX => 5 FWMGM 139 ORE => 4 NVRVD 144 ORE => 7 JNWZP 5 MNCFX, 7 RFSQX, 2 FWMGM, 2 VPVL, 19 CXFTF => 3 HVMC...
Rust
0
er. pub fn format_modifier(&self) -> u64 { // This is always safe to call with a valid gbm_bo pointer. unsafe { gbm_bo_get_modifier(self.0) } } /// Number of planes present in this buffer. pub fn num_planes(&self) -> usize { // This is always safe to call with a valid gbm_bo poi...
Rust
0
from Graph import Graph def greedy2(graph: Graph, number_of_deleted_nodes, goal_function): _, s = graph.vertex_cover() while len(s) > number_of_deleted_nodes: keep = None best_value = float("-inf") for element in s: residual = graph.clone_graph() residual.delete...
Python
1
from jax import Array from jax import numpy as jnp from src.covariance_update_functions.covariance_update_function import ( CovarianceUpdateFunction, CovarianceUpdateFunctionBuilder, ) from src.utils import sqrt_L_sum_qr class OuterCovarianceUpdate(CovarianceUpdateFunctionBuilder): """Outer covariance up...
Python
1
8468544015731954, |x| x.variance()); test_case(-1.0, 2.5, 36245.39726189994988081, |x| x.variance()); test_almost(-1.0, 5.5, 2.5481629178024539E+25, 1e10, |x| x.variance()); test_almost(-0.1, 0.1, 0.008311077467909703803238, 1e-16, |x| x.variance()); test_case(-0.1, 1.5, 65.9318925932890...
Rust
0
Pixels(5.0)); self.textbox_w.set_right(state, Units::Pixels(5.0)); self.num_of_dims = 4; state.insert_event( Event::new(VectorEditEvent::Dim4( self.x, self.y, self.z, self.w, ...
Rust
0
""" ****************************************************** nazwa klasy: Film pola: __tytul - przechowuje tytuł filmu __liczba_wypozyczen - przechowuje liczbę wypożyczeń metody: ustaw_tytul, None – ustawia tytuł filmu pobierz_tytul, str – pobiera tytuł filmu pobierz_liczba_wypozycze...
Python
1
c = cell_value.lower() if tolerance < 1.0: similarity = self.similarity_algorithm.normalized_similarity(c, p) return similarity >= tolerance, similarity else: # as in these cases the result is anyway irrelevant (we require an exact match), we can also just s...
Python
1
import numpy as np import matplotlib.pyplot as plt from skimage import io import math import numpy.matlib file_name='D:/Visual Effects/PS Algorithm/4.jpg'; img=io.imread(file_name) row, col, channel=img.shape base_noise = np.random.randn(row, col) octave = 4.0 samplePeriod = math.pow(2, octave) sampleFrequency = 1....
Python
1
mpletions(file_id, offset) { None => return Ok(None), Some(items) => items, }; let items = items.into_iter() .map(|item| { let mut res = CompletionItem { label: item.label, filter_text: item.lookup, .. Default::default() ...
Rust
0
B: ?Sized, { /// Replace the epsilon value with the one specified. pub fn epsilon(self, epsilon: A::Epsilon) -> Relative<A, B> { Relative { epsilon, ..self } } /// Replace the maximum relative value with the one specified. pub fn max_relative(self, max_relative: A::Epsilon) -> Relative<...
Rust
0
/ # ALL PIXELS OFF (BLACK) /// /// This command sets all pixel values to black. /// /// ALLPOFF may be used in Sleep Mode, Normal Mode, or Partial Mode. pub fn all_pixels_off() -> Result<Command, &'static str> { Ok(Command::new(Self::ALLPOFF as u8)) } /// # ALL PIXELS ON (WHITE) ...
Rust
0
9: (1, 3, [expected_task_sched[8].task]) # } # # dag = peft.readDagMatrix('test/canonicalgraph_task_connectivity.csv') # comm = peft.readCsvToNumpyMatrix('test/canonicalgraph_resource_BW.csv') # comp = peft.readCsvToNumpyMatrix('test/canonicalgraph_task_exe_time.csv') # # inf_comp = np.concatenate(...
Python
1
ict[int, int]]: """Format the question and choices into a prompt for Claude. Returns: tuple: (formatted_prompt, answer_index, position_mapping) """ formatter = MMLUPromptAlternative( question=question, choices=choices, answer=answer ...
Python
1
from importlib import import_module from aiogram import Dispatcher from aiogram_dialog import setup_dialogs import pathlib def include_routers(dp: Dispatcher, root_str="handlers"): setup_dialogs(dp) root = pathlib.Path(root_str) root_str = root.as_posix().replace("/", ".") files = root.glob("*.py...
Python
1
src, vec![]); distances.push(src, 0); loop { let (cur, _) = distances.pop().unwrap(); let path = paths.get(&cur).unwrap().clone(); visited.insert(cur); for n in self.get_neighbors(cur) { if visited.contains(&n) { con...
Rust
0
impl R { #[doc = "Bit 0 - BOD33 Ready"] #[inline(always)] pub fn bod33rdy(&self) -> BOD33RDY_R { BOD33RDY_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - BOD33 Detection"] #[inline(always)] pub fn bod33det(&self) -> BOD33DET_R { BOD33DET_R::new(((self.bits >> 1) & 0x01) !...
Rust
0
from typing import List import numpy as np from matplotlib.patches import PathPatch from matplotlib.path import Path def _merge_dict(source, destination): """deeply merges two dicts""" for key, value in source.items(): if isinstance(value, dict): # get node or create one node ...
Python
1
lues.cert "genCa" .ca) }} {{- end }} """, ), ), ], "domaingroupmapping-crd.yaml": [ ( "controller-gen.kubebuilder.io/version: v0.14.0", "controller-gen.kubebuilder.io/version: v0.14.0\n helm.sh/resource-policy: keep", ...
Python
1
from numpy import array from scipy.cluster.vq import vq, kmeans, whiten from dml.CLUSTER.kmeans_iter import KMEANSC import matplotlib.pyplot as plt features=array([ [13.45,11.95], [14.15,11.75], [14.8,11.25], [15.35,10.35], [15,9.55], [14.05,9.3], [13.05,10.2], [13.5,11.3], [14.4,10.95], [14.85,10.05], [13.75,9.65], [1...
Python
1
import os def combine_chapters(start_chapter, end_chapter, folder, output_file): with open(output_file, 'w') as outfile: # Write the HTML header outfile.write("<html>\n<body>\n") for chapter_number in range(start_chapter, end_chapter + 1): chapter_file = os.path.join(folder, f'...
Python
1
Open { peer_id, handshake, nonce, .. } => self.on_protocol_open(peer_id, nonce, handshake), NetworkOutMessage::ProtocolClose { peer_id, .. } => self.on_protocol_close(peer_id), NetworkOutMessage::Message { peer_id, message } => self.on_message(peer_id, message), } } fn on_in_message(&mut s...
Rust
0
.print_screen(x, y, source) } /// Prints another screen on specified coordinates, ignoring a specific character while printing /// Ignoring a character will behave like transparency /// /// see [print_screen](#method.print_screen) for usage pub fn print_screen_alpha(&mut self, x: i32, y: i32, s...
Rust
0
db_path = os.path.join(in_dir, db) res[db] = set() c = sqlite3.connect(db_path) for row in c.execute("select id, flags, mtime, labels from status"): res[db].add( (row[0], row[1], row[2], row[3]) ) return res res = dict() ...
Python
1
import numpy as np import torch def get_metric_voxel_center_coords(bev_range_x, bev_range_y, dataset_img_shape): bev_extent_m = 0.5 * np.array( [-bev_range_x, -bev_range_y, bev_range_x, bev_range_y] ) voxel_center_metric_coordinates = get_voxel_center_coords_m( bev_extent_m=bev_extent_m, n...
Python
1
info = WINDOW_MAP[title] # dynamically fetch the class from the module try: cls = getattr(info.module, info.cls_name) ## info.module.__dict__[info.cls_name] #invoke the create_instance method of the class instance_method = getattr(cls, "crea...
Python
1
str = "Gaurav singh" print(str[1:3]) #print from index 1 to 3-1 print(str[ :len(str)]) #print from index 0 to till last index of element print(str[0:]) # print from index 0 to last
Python
1
import re import sys import os def process_file(filepath, replacements): """Reads a file, applies a series of regex replacements, and writes it back.""" try: # Create a backup before modifying backup_path = filepath + '.bak' with open(filepath, 'r') as f_in, open(backup_path, 'w') as f_...
Python
1
# coding = utf-8 import random from api.src.CorpApi import * from configobj import ConfigObj config = ConfigObj('../../config.ini', encoding='utf-8') api = CorpApi(config['wechat']['CorpID'], config['wechat']['Secret']) to_user = "momeak" markdownContent = """ 您的会议室已经预定,稍后会同步到`邮箱` >**事项详情** >事 项:<font color=\"inf...
Python
1
assert_eq!(electrum_xprv.electrum_xprv().unwrap(), elxprv); assert_ne!(electrum_xprv.xprv.to_string(), elxprv); } } <gh_stars>1-10 use serde::{de, Deserialize, Deserializer}; use std::marker::PhantomData; use std::{collections::HashMap, fmt, hash::Hash}; pub(crate) fn deserialize_alternating_key_va...
Rust
0
later we can enforce the correctness of y_bit. let y_adjusted = FpGadget::<F>::alloc(cs.ns(|| "alloc y adjusted"), || { let value = y.get_value().get()?; let adjusted = if value > half { value - &half } else { value }; Ok(adjusted) })?; // Enforces the foll...
Rust
0
main argument. pub fn end_tester_eq_block(&self, pat_ref_id: usize, prog_ref_id: usize) -> Result<()> { TEST.close(pat_ref_id)?; FLOW.close(prog_ref_id)?; crate::STATUS.pop_testers_eq()?; Ok(()) } /// Like start_tester_eq_block, but the contained block will be included for ...
Rust
0
RULES'].fields_by_name['within']._loaded_options = None _globals['_TIMESTAMPRULES'].fields_by_name['within']._serialized_options = b'\302H\210\001\n\205\001\n\020timestamp.within\032qthis < now-rules.within || this > now+rules.within ? \'value must be within %s of now\'.format([rules.within]) : \'\'' _globals['_TIM...
Python
1
/// /// # Example /// /// ``` /// use cfd_rust::{HDWallet, Network}; /// let seed = [1; 32]; /// let hdwallet = HDWallet::from_slice(&seed).expect("Fail"); /// let derive_key = hdwallet.get_pubkey_from_number(&Network::Testnet, 2, true).expect("Fail"); /// ``` pub fn get_pubkey_from_number( &sel...
Rust
0
np) var1 = resource_variable_ops.ResourceVariable(var1_np) grads0 = constant_op.constant(grads0_np) grads1 = constant_op.constant(grads1_np) opt = adamax.AdaMaxOptimizer(constant_op.constant(0.001)) update = opt.apply_gradients(zip([grads0, grads1], [var0, var1])) variabl...
Python
1
; let width0 = lerp(self.u_min, self.common.width[0], self.common.width[1]); let width1 = lerp(self.u_max, self.common.width[0], self.common.width[1]); let avg_width = (width0 + width1) * 0.5; let approxLength = 0.0; for i in 0..3 { approxLength += cp_obj[i].distance(...
Rust
0
XK_overline = 0x47e XK_kana_fullstop = 0x4a1 XK_kana_openingbracket = 0x4a2 XK_kana_closingbracket = 0x4a3 XK_kana_comma = 0x4a4 XK_kana_conjunctive = 0x4a5 XK_kana_middledot = 0x4a5 XK_kana_WO = 0x4a6 XK_kana_a = 0x4a7 XK_kana_i = 0x4a8 XK_kana_u = 0x4a9 XK_kana_e = 0x4aa XK_kana_o = 0x4ab XK_kana_ya = 0x4ac XK_kana_y...
Python
1
pe; use crate::Configuration; use crate::Renderer; use crate::WavData; use crate::CONFIG; use fltk::{ app, button::{CheckButton, LightButton}, enums::{Align, Color, Event, FrameType}, frame::Frame, group::{Pack, PackType}, image::SvgImage, input::IntInput, menu::MenuButton, misc::Pro...
Rust
0
o; } f(last_end, len(s)); } /** * Splits a string into a vector of the substrings separated by a given string * * # Example * * ~~~ * assert ["", "XXX", "YYY", ""] == split_str(".XXX.YYY.", ".") * ~~~ */ pub pure fn split_str(s: &a/str, sep: &b/str) -> ~[~str] { let mut result = ~[]; do iter_be...
Rust
0
:PhantomData, str}; #[pallet::config] pub trait Config: frame_system::Config { type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>; type LocalAssetId: FullCodec + Eq + PartialEq + Copy + MaybeSerializeDeserialize + From<u128> + Into<u128> + Debug + Default + T...
Rust
0
_version=t._version+1 FROM t WHERE feed.id=t.id AND feed._version=t._version RETURNING feed.id, url, etag, last_modified, use_proxy, checksum_data ; """ params = [ statuses, outdate_seconds, timeout_seconds, statuses, ...
Python
1
A), 120u32); TaiA::add( &mut deadline as (*mut TaiA), &mut deadline as (*mut TaiA) as (*const TaiA), &mut stamp as (*mut TaiA) as (*const TaiA), ); DnsTramsit::io( &mut tx as (*mut DnsTransmit), x.as_mut_...
Rust
0
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ from frappe.model.document import Document class OverlapError(frappe.ValidationError): pass class ClosedAccountingPeriod(frappe.ValidationError): pass class...
Python
1
0: GenericQuery(query_id='1907320', text='How do I get college money?'), 9: GenericQuery(query_id='3083719', text='How do you safely wean a person off Risperidal?'), 199: GenericQuery(query_id='2573745', text='How did African American women get the right to Vote?'), }) self...
Python
1
let sphere = Geometry::new(Box::new(Sphere::new(vec3(0.0, 2.5, 0.0), 2.5)), sphere_mat.clone()); primitives.push(Box::new(sphere)); let scene = Scene::new(primitives); scene } fn create_camera(width: u32, height: u32) -> Camera { let cam_origin = vec3(0.0, 5.0, -14.0); let cam_tar...
Rust
0
::um::minwinbase::{ EXCEPTION_ACCESS_VIOLATION, EXCEPTION_FLT_DENORMAL_OPERAND, EXCEPTION_FLT_DIVIDE_BY_ZERO, EXCEPTION_FLT_INEXACT_RESULT, EXCEPTION_FLT_INVALID_OPERATION, EXCEPTION_FLT_OVERFLOW, EXCEPTION_FLT_STACK_CHECK, EXCEPTION_FLT_UNDERFLOW, EXCEPTION_ILLEGAL_INSTRUCTION, EXCEPTION_INT_DIVIDE_BY_...
Rust
0
# -*- coding: utf-8 -*- import os import time from datetime import datetime, timedelta from zoneinfo import ZoneInfo from curl_cffi import requests from yescaptcha import YesCaptchaSolver, YesCaptchaSolverError from turnstile_solver import TurnstileSolver, TurnstileSolverError # ---------------- 通知模块动态加载 -------------...
Python
1
NAME> // [This program is licensed under the "MIT License"] // Please see the file LICENSE in the source // distribution of this software for license terms. ///! Functions to compute various statistics on a slice of ///! floating-point numbers. /// Type of statistics function. If the statistic /// is ill-defined, `No...
Rust
0
chksum( p: *mut pbuf, start_offset: u16_t, dataptr: *const ::std::os::raw::c_void, len: u16_t, chksum: *mut u16_t, ) -> err_t; } extern "C" { pub fn pbuf_get_at(p: *const pbuf, offset: u16_t) -> u8_t; } extern "C" { pub fn pbuf_try_get_at(p: *const pbuf, offset: u16_t...
Rust
0
class Solution(object): def bestClosingTime(self, customers): """ :type customers: str :rtype: int """ prefix_sum = [0] * (len(customers)+1) suffix_sum = [0] * (len(customers)+1) for i in range(1, len(customers)+1): if customers[i-1] == "N": ...
Python
1
op: &EqOp) -> Result<()> { w.write_all(match op { EqOp::PlusEqual => b"PlusEqual", EqOp::MinusEqual => b"MinusEqual", EqOp::MulEqual => b"MulEqual", EqOp::ConcatEqual => b"ConcatEqual", EqOp::DivEqual => b"DivEqual", EqOp::PowEqual => b"PowEqual", EqOp::ModEq...
Rust
0
Map<(i16, i16), Arc<_>> = rasters.into_iter().filter_map(|v| Some((v.0, v.1?))).collect(); heightmap.par_iter_mut().zip(coordinates.into_par_iter()).for_each( |(h, (lat, long))| { *h = match rasters.get(&(lat.floor() as i16, long.floor() a...
Rust
0
# ABOUTME: Simple protocol interface for extracting raw NPC data from sources # ABOUTME: Phase 1 focus - extract markdown and image URLs without LLM processing from typing import Protocol from pydantic import BaseModel, ConfigDict class RawNPCExtractor(Protocol): """Protocol for extracting raw NPC data by ID. S...
Python
1
in(), stdout()) } } impl<R: Read + AsRawFd, W: Write + AsRawFd> Connected for StdioSocket<R, W> { fn remote_addr(&self) -> Option<SocketAddr> { Some(SocketAddr::new(IpAddr::from(Ipv4Addr::UNSPECIFIED), 8080)) } } impl<R: Read + AsRawFd, W: Write + AsRawFd> StdioSocket<R, W> { pub fn try_new_rw...
Rust
0
ds = callback_outputs.pop("prompt_embeds", prompt_embeds) negative_prompt_embeds = callback_outputs.pop("negative_prompt_embeds", negative_prompt_embeds) prompt_embeds_2 = callback_outputs.pop("prompt_embeds_2", prompt_embeds_2) negative_prompt_embeds_2 = call...
Python
1
r item_827 in var_826 { #[allow(unused_mut)] let mut entry_829 = list_828.entry(); crate::query_ser::serialize_structure_filter(entry_829, item_827); } list_828.finish(); } #[allow(unused_mut)] let mut scope_830 = writer.prefix("Marker"); if let Some(v...
Rust
0
(ptr: *const c_void) { unsafe { let mut tag = (ptr.offset(8)) as *const Tag; while (*tag).type_ != TAG_TYPE_END { handle_tag(&mut BOOT_INFO, tag); tag = (*tag).next(); } } } //! For handling Minecraft's region format, Anvil. //! //! `anvil::Region` can be given a `Read` and `Seek` type eg a file in order ...
Rust
0
afe impl SimdVector for $v128 { type Element = $scalar; type BoolV = $bool128; type Elements = ElementsCopy<Self>; type Reverse = Self; fn len(&self) -> usize { $len } fn reverse(self) -...
Rust
0
#! /usr/bin/env python # Example app import os import dash_core_components as dcc import dash_html_components as html from dash import Dash from dash.dependencies import Input, Output from flask import Flask, session from dash_google_auth import GoogleOAuth # configure app server = Flask(__name__) app = Dash( ...
Python
1
Exceeded, metrics::FetchBlobMetricDimensionResumed::False ); 2 ], ) .await; env.stop().await; } #[fasync::run_singlethreaded(test)] async fn download_blob_body_timeout() { let pkg = PackageBuilder::new("test").build().await.unwrap(); let repo = Arc::n...
Rust
0
import airflow from include.subdags.subdag import factory_subdag from airflow.models import DAG from airflow.operators.empty import EmptyOperator from airflow.operators.subdag import SubDagOperator from airflow.utils.task_group import TaskGroup from airflow.decorators.task_group import task_group from airflow.executors...
Python
1
#!/usr/bin/env python #-*- coding: utf-8 -*- ''' Copyright (c) 2014 Feng Wang <wffrank1987@gmail.com> 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 ...
Python
1
formatted_sum = "0.00".to_string() } else { formatted_sum = movements_sum.to_string() } if acct.list_of_lots.borrow().len() > 0 { writeln!(file, " Lot {:>3} created {} w/ basis date {} • Σ: {:>12}, and cost basis of {:>10.2}", (lot_idx+1), ...
Rust
0
and GT_Dev.Y[0] < 242): print("Refresh photo ...\r\n") SelfFlag = 1 ReFlag = 1 if(ReFlag == 2): # Refresh large photo ReFlag = 1 Show_Photo_Large(image, Photo_L) except IOError as e:...
Python
1
MockCurrentPlatformRetrieverTrait::new(); let platform_filter = PlatformFilter::new(Arc::new(current_platform_retriever)); assert_eq!(platform_filter.current_platform_is_match(&Vec::new()), true); } #[test] fn one_item_that_does_not_match_current_operating_system_returns_false() { ...
Rust
0
, "")), Ok(b"\x00\x00\x00\x00".to_vec()), Ok(b"\x00\x00\x00\x01".to_vec()), }; let mut framed = FramedRead::new(mock, U32Decoder); task.enter(|cx| { assert!(pin!(framed).poll_next(cx).is_pending()); assert_read!(pin!(framed).poll_next(cx), 0); assert_read!(pin!(frame...
Rust
0
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt class MatrizCorrelacaoPlotter: def __init__(self, caminho_arquivo: str, colunas_interesse: list): """ Inicializa um objeto MatrizCorrelacaoPlotter. Args: caminho_arquivo (str): O caminho do arquivo CSV co...
Python
1
# 碰撞检测 from dmdownloader.converter.asslib.display import DisplayBase class Collision: def __init__(self, line_count): self.tracks = [ [0]*line_count, # flow [0]*line_count, # top [0]*line_count, # buttom ] def detect(self, display: DisplayBase) -> tuple[int...
Python
1
/// Configuration register. pub cr: Reg<Cr>, /// Number of data to transfer register. pub ndtr: Reg<Ndtr>, /// Peripheral address register. /// /// Note that this register holds the address for the "peripheral" side of /// the transfer -- the one where activity is governed by DRQs -- ...
Rust
0
(arg1[6])); let x8: u64 = (0x1fffffffffffffe - (arg1[7])); out1[0] = x1; out1[1] = x2; out1[2] = x3; out1[3] = x4; out1[4] = x5; out1[5] = x6; out1[6] = x7; out1[7] = x8; } /// The function fiat_p448_selectznz is a multi-limb conditional select. /// /// Postconditions: /// eval out1 = (if arg1 = 0...
Rust
0
import gtsam import numpy as np from math import pi, cos, sin def circlePose3(numPoses=8, radius=1.0, symbolChar=0): """ circlePose3 generates a set of poses in a circle. This function returns those poses inside a gtsam.Values object, with sequential keys starting from 0. An optional character may be ...
Python
1
t_pdf # ----------- Streamlit-grensesnitt ----------- st.title("Splitt målebrev med vedlegg") pdf_file = st.file_uploader("Last opp PDF-filen med målebrev", type="pdf") vedlegg_files = st.file_uploader("Last opp vedlegg", type="pdf", accept_multiple_files=True) if pdf_file: st.write(f"PDF med målebrev lastet op...
Python
1
connected on \"{}\" using netctl!", interface_name))?; Ok(()) } #[test] fn test_netctl_manual_profile_name() -> Result<()> { let interface_name = "SO_FAKE_PART_TWO"; let netctl_profile = "MUH_PROFILE"; let mut p = spawn_dryrun( &format!("wired -i {} connect -c netctl -p {}", interface_name, ne...
Rust
0
) responses = self.load_eval_results() if responses is not None and len(responses): if self.task == "EA": responses["accuracy"] = responses["label"] == responses["answer"] results = responses.groupby("category")["accuracy"].mean().reset_index() ...
Python
1
question = self.get_question(question_type, intensity) st.write(f"**{question_type.capitalize()}:** {question}") # Handle responses and commentary for truths if question_type == "truth": response = st.text_input("Your Answer:") if st.button("Sub...
Python
1
# while """ Ini adalah sala satu penggunaan cara penulisan matriks dalam python """ print("\n") n = 0 while n < 5 : print(n) n=n+2 print() for x in range(1,7,2) : print (x) print("\n") arr = [5,6,3,2,2,3,1] for x in arr : print(x) print("\n") # Ini adalah cara melakukan deklarasi matriks 3X3 ...
Python
1
a.modify(|_, w| w.wgm3().bits(0b01)); tim.tccr3b.modify(|_, w| { w.wgm3().bits(0b01); match prescaler { Prescaler::Direct => w.cs3().direct(), Prescaler::Prescale8 => w.cs3().prescale_8(), Prescaler::Prescale64 => w....
Rust
0
from_str(s, format)) { Ok(dt) => ddlog_std::Result::Ok { res: TzDateTime { val: dt }, }, Err(e) => ddlog_std::Result::Err { err: format!("{}", e), }, } } pub fn tz_datetime_parse_from_rfc3339(s: &String) -> ddlog_std::Result<TzDateTime, String> { match (:...
Rust
0
from woodwork.column_schema import ColumnSchema from woodwork.logical_types import Double, Integer from featuretools.primitives.base import AggregationPrimitive class MaxConsecutiveZeros(AggregationPrimitive): """Determines the maximum number of consecutive zero values in the input Args: skipna (boo...
Python
1
; return true; } template<typename Function> static bool functional(Function *function, F data) { return (*function)(data); } Callback() = default; template<typename OT, typename = decltype(std::declval<OT>().push_back(std::declval<F>()))> Callback(OT *cont) : cont...
Rust
0
# -*- coding: utf-8 -*- """ ZUGBRUECKE Calling routines in Windows DLLs from Python scripts running on unixlike systems https://github.com/pleiszenburg/zugbruecke tests/test_string_strsxp.py: R-style strings Required to run on platform / side: [UNIX, WINE] Copyright (C) 2017-2023 Sebastian M. Ernst <er...
Python
1
(ShearX, 0.3, 0), (ShearY, 0.3, 0), (Solarize, 256, 0), (SolarizeAdd, 110, 0), (TranslateX, 0.45, 0), (TranslateY, 0.45, 0)] return augs class RandAugmentPC(object): def __init__(self, n, m): assert n >= 1 assert 1 <= m <= 10 ...
Python
1
.mempool.GetBlockResponse\"\0\x12_\n\x12CommitTransactions\x12\".mem\ pool.CommitTransactionsRequest\x1a#.mempool.CommitTransactionsResponse\"\ \0\x12J\n\x0bHealthCheck\x12\x1b.mempool.HealthCheckRequest\x1a\x1c.memp\ ool.HealthCheckResponse\"\0b\x06proto3\ "; static mut file_descriptor_proto_lazy: ::proto...
Rust
0
} impl PointLight { pub fn new(position: (i32, i32, i32), intensity: (i32, i32, i32)) -> Self { Self { position: Tuple::point(position.0, position.1, position.2), intensity: Color::new(intensity.0, intensity.1, intensity.2), } } } <filename>src/main.rs<gh_stars>1-10 use ...
Rust
0
v_t # matrix[0][1] = -psi * d32 / x_env # matrix[1][0] = d41 / x_env_t # matrix[1][1] = -psi * d42 / x_env # rhs_L[0] = psi * d3L / x_env # rhs_L[1] = psi * d4L / x_env # rhs_N[0] = -d3N / x_env_t # rhs_N[1] = -d4N / x_env_t # sol_L = np.linalg.solve(matrix, rhs_L) # res[0] = sol_L[1] # re...
Python
1
.into(); } Ok(call.name) }) .collect() }) .collect() } fn build(self) -> ExecIR { ExecIR { data: IRData::with_no_shapes(self.name, self.graph), links: self.links, ...
Rust
0