text
string
label_name
string
labels
int64
id().krate).as_str(); if crate_name == "core" || crate_name == "alloc" { flags |= ykpack::bodyflags::DO_NOT_TRACE; } Self { func: ykpack::Body { symbol_name, blocks, flags, trace_inputs_local: None, ...
Rust
0
n decode(bv: &BitVec, g: &mut Grammar) -> () { let mut zlen = 0; let mut z = BitVec::new(); let mut vbitslen = 0; let mut vbits = BitVec::new(); let mut dlen = 0; let mut max_first = BitVec::new(); let mut s = BitVec::new(); for i in 8..bv.len() { if i < 8 + 32 {zlen <<= 1; if ...
Rust
0
# -*- coding: utf-8 -*- import sys from .base import BaseMatcher try: from urlparse import parse_qs, urlparse except ImportError: from urllib.parse import parse_qs, urlparse isPY2 = (2, 6) <= sys.version_info < (3, 0) class QueryMatcher(BaseMatcher): # Matches based on the query of the request nam...
Python
1
se(|| fatal!(system, "Path to about.toml contains invalid unicode: {}", about_toml.display())); let about_out_txt = about_out_txt .to_str().unwrap_or_else(|| fatal!(system, "Path to about.out.txt contains invalid unicode: {}", about_out_txt.display())); TokenStream::from(quote!{ { // Ensu...
Rust
0
method]) .and_then(|(socket, _)| read_exact(socket, [0; 2])) .and_then(|(socket, response)| answer_hello(socket, response, creds)) .and_then(move |socket| write_addr(socket, req)) .and_then(|socket| read_exact(socket, [0; 3])) .and_then(|(socket, response)| read_response(socket,...
Rust
0
ors_nums // 2 - 1) bottom_strip_size = 1.0 / ((bottom_left_priors_nums + bottom_right_priors_nums) // 4 + 1) for i in range(left_priors_nums): #左 nn.init.constant_(self.prior_embeddings.weight[i, 0], i // 2 * left_strip_size) nn.init.constant_(self.prior_embeddings.weigh...
Python
1
### ### search.py ### # Change this to use the new WebCorpus type. def lookup(windex, keyword): if keyword in windex.index: return windex.index[keyword] else: return None def lucky_search(windex, keyword): pages = lookup(windex, keyword) if not pages: return None best_page...
Python
1
)) => (t, f), Err(t) => (t, FunctionList::new()), }; // let f: Spanned<Expr> = ( // Expr::Constant(Atom::String(filename.into())), // Span::default(), // ) // .into(); let args: Vec<Spanned<Expr>> = Vec::new(); // let mut args = if let Some(idx) = std::env::args().in...
Rust
0
writelines(path, lines, sep='\r'): f = open(path, 'wb') for line in lines: f.write(line + sep) f.close() if __name__ == "__main__": import macfs fss, ok = macfs.StandardGetFile('TEXT') if ok: path = fss.as_pathname() afm = AFM(path) char = 'A' if afm.has_char(char): print afm[char] # print char...
Python
1
Token::Minus => Some(UnaryOperator::Minus), Token::BitXorNot => Some(UnaryOperator::BitNot), Token::Len => Some(UnaryOperator::Len), _ => None, } } /// Operator associativity /// /// Associativity is only needed when the operators in an expression have the /// same precedence. #[derive(D...
Rust
0
'name': '绍兴', 'level': 2, 'pinyin': 'shaoxing', 'prefix': 'S', 'weight': 0, 'is_hot': 0, }, { 'id': 140, 'pid': 12, 'name': '金华', 'level': 2, 'pinyin': 'jinhua', 'prefi...
Python
1
----------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'DeepReplay', u'DeepReplay Documentation', author, 'DeepReplay', 'One line de...
Python
1
from django.db import models from django.urls import reverse # Create your models here. class Product(models.Model): product_name = models.CharField(max_length=200, unique=True) slug = models.SlugField(max_length=200, unique=True) description = models.TextField(max_length=255, blank=True) price = mode...
Python
1
ts[i] = ts[i].data.value else: # Sub-task had an exception. if return_exceptions: # Get the sub-task exception to return in the list of return values. ts[i] = ts[i].data elif isinstance(state, int): # Raise the sub-task ex...
Python
1
.basename(ulog_path)[:-4] + ".csv") if os.path.exists(csv_loc): print(f"{i+1} | File {csv_loc} already processed, skipping...") continue ulog = ULog(ulog_path, filter) px4ulog = PX4ULog(ulog) px4ulog.add_roll_pitch_yaw() cols = extract_mission_mode(ulog) if isinstance(cols, st...
Python
1
TileId::new(0, 0, 1).unwrap(); let b = g.tile_bbox(tid); assert_eq!(b.x_min(), -20037508.3427892480); assert_eq!(b.x_max(), 0.0); assert_eq!(b.y_min(), 0.0); assert_eq!(b.y_max(), 20037508.3427892480); let tid = TileId::new(1, 1, 1).unwrap(); let b = g.tile_bbox...
Rust
0
import numpy as np from ml.plot.newer.column_strategy_sim.plotlatex_lib import plot_list_latex from ml.plot.newer.column_strategy_sim.plotlatex_lib import plot_list labels = [4, 14, 24, 34, 44, 54, 64, 74, 84] percent1 = [0.0, 0.3112454283828841, 0.2971694971694972, 0.3186480186480186, 0.21888111888111889, 0.27932067...
Python
1
splitArr[2][:-9]: single_relation } else: utgSingleRelationDict[splitArr[0]].update( {splitArr[2][:-9]: single_relation} ) # print(utgHicRelationDict) # addTwoDict for willUtg in utgHicRelationDict.keys...
Python
1
.create_wallet("default", None, None, None, None) .unwrap(); break Client::new(&node_url_default, Auth::CookieFile(cookie_file.clone())) .unwrap(); } } }; Ok(BitcoinD { proces...
Rust
0
{ pub text: Text, #[serde(default, skip_serializing_if = "Option::is_none")] pub block_id: Option<String>, } #[derive(Debug, Deserialize, Serialize)] pub struct Image { pub image_url: String, pub alt_text: String, #[serde(default, skip_serializing_if = "Option::is_none")] pub title: Optio...
Rust
0
from documents.constants import * from documents.exporters import BaseExporter class SQLExporter(BaseExporter): """ A base class of all sql exporters. """ TYPE_MAPPING = { TYPES_INTEGER: "int", TYPES_BOOLEAN: "bool", TYPES_TEXT: "longtext", TYPES_TIME: "time", T...
Python
1
object selection and system settings from before the operator activation: class NPPMRestoreContext(bpy.types.Operator): bl_idname = "object.np_pm_restore_context" bl_label = "NP PM Restore Context" bl_options = {'INTERNAL'} def execute(self, context): selob = NP020PM.selob helper = NP...
Python
1
# --- Dado: Uma string s de até 1000 nucleotídeos --- # # --- Problema: A quantidade de quantas vezes cada nucleotídeo aparece na string (A, C, G e T) --- # # --- Indicar o arquivo --- # arquivo = '' # --- Ler o arquivo --- # with open(arquivo, 'r') as txt: # --- Obter a string --- # dna = txt.read() # --- C...
Python
1
# -*- coding: utf-8 -*- # Copyright (c) 2008 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the mdi area view manager plugin. """ import os from PyQt4.QtCore import QT_TRANSLATE_NOOP, QString, qVersion from PyQt4.QtGui import QPixmap # Start-Of-Header name = "Workspace Plugin" author ...
Python
1
font-family: 'Inter', system-ui, -apple-system, sans-serif; background: linear-gradient(to bottom right, #f0f9ff, #e0f2fe); min-height: 100vh; }} .highlight-card {{ break-inside: avoid; page-break-inside: avoid; height: 100%; ...
Python
1
+ 0.1)[0][0] # the azimuthal locations of the spirals approximated as # where the max occurs pi = pc[np.argwhere(sig[:, ii] == sig[:, ii].max())[0][0]] po = pc[np.argwhere(sig[:, io] == sig[:, io].max())[0][0]] # the analytic answers ...
Python
1
debug_image, debug_stats = test_cascade_visualization(scene, config) save_image(debug_image, args.out.replace('.png', '_cascade_debug.png')) # Test 5: Baseline vs shadows comparison comparison_image = create_comparison_image( {'base...
Python
1
#!/usr/bin/env python # Shove zvm_dispatch.js and gi_load.js together into a file # which can be packaged into Lectrote. This is a cheap hack. from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import re import subprocess def compress_source(targe...
Python
1
import sys from typing import TYPE_CHECKING if TYPE_CHECKING: from ._domain import Domain from ._imaginaryaxis import Imaginaryaxis from ._realaxis import Realaxis from . import imaginaryaxis from . import realaxis else: from _plotly_utils.importers import relative_import __all__, __getatt...
Python
1
orefOrPtrAdjustment>, pub self_ty: Ty<'tcx>, } #[derive(Clone, Debug, PartialEq, Eq)] pub enum PickKind<'tcx> { InherentImplPick, ObjectPick, TraitPick, WhereClausePick( // Trait ty::PolyTraitRef<'tcx>, ), } pub type PickResult<'tcx> = Result<Pick<'tcx>, MethodError<'tcx>>; #[...
Rust
0
# Copyright 2012-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models class MassReconcileHistory(models.Model): """Store an history of the runs per profile Each history stores the list of reconciliations done """ _name = "mass.re...
Python
1
) => { errors::set_errno_with_hadoop_error(e); -1 } } } const NO_TIME: i64 = -1; fn time_to_option(time: i64) -> Option<u64> { if time == NO_TIME { None } else { Some(time as _) } } /** hdfsUtime @param fs The configured filesystem handle. @param path ...
Rust
0
fields = collect_selected_fields(&nested_fields, &model); let nested = collect_nested_queries(nested_fields, &model)?; Ok(ReadQuery::RecordQuery(RecordQuery { name, alias, model, filter, selected_fields, nested, selecti...
Rust
0
, vs = k.split('=', 1) vs = vs.split(',') if k in field_names: incomplete = False for v in vs: if v not in field_names: incomplete = True break if not incomplete: ...
Python
1
import mlir.extras.types as T import pytest from mlir.extras.dialects.ext import linalg, memref, tensor # noinspection PyUnresolvedReferences from mlir.extras.testing import ( MLIRContext, filecheck, filecheck_with_comments, mlir_ctx as ctx, ) # needed since the fix isn't defined here nor conftest.py...
Python
1
_| ____|_ __ ___ _ _| | __ _| |_ ___ _ __ * | | _ / _` | '_ ` _ \ / _ \ _ \ / _ \| | | | _| | '_ ` _ \| | | | |/ _` | __/ _ \| '__| * | |_| | (_| | | | | | | __/ |_) | (_) | |_| | |___| | | | | | |_| | | (_| | || (_) | | * \____|\__,_|_| |_| |_|\___|____/ \___/ \__, |_____|_| |_| |_|\__,_|_|\__,_|\__\___/...
Rust
0
iew_kwargs={'session_id': '<id>'}, schema='EventSchemaPublic', type_='event') speakers = Relationship( attribute='speakers', many=True, self_view='v1.session_speaker', self_view_kwargs={'id': '<id>'}, related_view='v1.speaker_...
Python
1
irion AG nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,...
Rust
0
from setuptools import setup setup( name = 'sphinx-book-theme', version = '%%PORTVERSION%%', description = 'A clean book theme for scientific explanations and documentation with Sphinx', maintainer = 'Executable Books Team', maintainer_email = 'executablebooks@gmail.com', url = None, packag...
Python
1
GEST_INDENT.split_at(x.into()).0, // Unsupported indentation style. This should never happen, // but just in case fall back to the default of 4 spaces IndentStyle::Spaces(n) => { debug_assert!(n > 0 && n <= Self::LONGEST_INDENT.len() as u8); " " ...
Rust
0
if line.starts_with("#") { finish_val!(); if line == "#data" { finish_test!(); } key = Some(line[1..].to_string()); } else { val.push_str(&line); ...
Rust
0
()) { return Err(Error::HierarchyRequest); } match child { Some(ref child) => { if child .preceding_siblings() .any(|sibling| sibling.node_type_id.is_element()) { return Err(Error::HierarchyRequest); } }, None => { if parent.chil...
Rust
0
from typing import Optional, Sequence class EpochOrStepSelector: def __call__(self, epoch_or_step: int) -> bool: """Evaluate whether the given epoch or step is selected.""" raise NotImplementedError("Subclasses must implement this method.") class SpecificValuesSelector(EpochOrStepSelector): ...
Python
1
los(filein['th'][idx], filein['phi'][idx], filein['x0'][idx]*lnpb.boxlength, filein['y0'][idx]*lnpb.boxlength, z0, drc, dx, dy, nx, ny, parallel_los=True) print(filein['r_max'][idx]) print('Interpolate') lu.interp_lc(upgrade=2) lc = lu.fields_lc.copy() # check the 2D power spectrum with limb...
Python
1
dependent(self,dependent): if not dependent: return True dependents = dependent.split(',') status = True for dep in dependents: if not dep: continue if dep.find('|') != -1: names = dep.split('|') for name in names: ...
Python
1
G, mss as c_int, ) } } /// Returns `true` if `listen(2)` was called on this socket by checking the /// `SO_ACCEPTCONN` option on this socket. #[cfg(all( feature = "all", any( target_os = "android", target_os = "freebsd", ...
Rust
0
except Exception as e: QMessageBox.critical(self, "导出失败", f"导出配置失败:{e}") def save_config(self): """保存配置""" try: config_data = self.get_config_data() # 这里应该调用实际的配置保存逻辑 # 例如:save_to_database(config_data) ...
Python
1
, checks); } <gh_stars>1-10 //! The parsers module //! //! pub mod csv; use failure::Error; use regex::Regex; use std::str; use crate::{InputSource, ParsedContent}; pub trait InputService { // responsible for parsing the file, creating a description of each column in the file fn parse(&self, input: InputSourc...
Rust
0
'a mut self, x: S, y: S, z: S, s: S) ->&'a Quaternion<S> { self.v.x = x; self.v.y = y; self.v.z = z; self.s = s; self } } impl<S: BaseFloat> Quaternion<S> { #[inline] pub fn from_rotation_x(angle: Deg<S>) -> Quaternion<S> { let half: S = cast(0.5f64).un...
Rust
0
leTreeTrait>( config: PoRepConfig, cache_dir_path: &Path, sealed_sector_file: &NamedTempFile, prover_id: ProverId, sector_id: SectorId, ticket: [u8; 32], seed: [u8; 32], pre_commit_output: &SealPreCommitOutput, piece_infos: &[PieceInfo], ) -> Result<(SealCommitOutput, Vec<Vec<Fr>>, [...
Rust
0
# Copyright (c) Sebastian Raschka under Apache License 2.0 (see LICENSE.txt). # Source for "Build a Large Language Model From Scratch" # - https://www.manning.com/books/build-a-large-language-model-from-scratch # Code: https://github.com/rasbt/LLMs-from-scratch import os import sys import tarfile import time import ...
Python
1
words from * a wordlist is a common convention. */ #[derive(PartialEq, Eq, Clone, Debug, derive_more::Display, derive_more::Deref)] #[display(fmt = "{}", _0)] pub struct Code(pub String); impl Code { pub fn new(nameplate: &Nameplate, password: &str) -> Self { Code(format!("{}-{}", nameplate, password)) ...
Rust
0
# For demo purposes, we'll create mock product data # In a real app, you'd decode the actual value product_id = int(key_str.split("_")[1]) # Check if we have status info status = 0 # Default to Availab...
Python
1
absolute maximum of a list of items. fn abs_max(&self) -> Self::Item { self.iter() .map(|&x| (x.clone().abs(), x)) .max_by_key(|&(a, _)| a) .map(|(_, x)| x) } } impl AbsMax for Vec<i32> { type Item = Option<i32>; /// Return the absolute maximum of a list of ...
Rust
0
in version 3.0."] #[doc = ""] #[doc = " @ingroup window"] pub type GLFWwindowfocusfun = ::core::option::Option<unsafe extern "C" fn(arg1: *mut GLFWwindow, arg2: rs_ctypes::c_int)>; #[doc = " @brief The function signature for window iconify/restore callbacks."] #[doc = ""] #[doc = " This is the function signature ...
Rust
0
aStor<gh_stars>10-100 #![allow(clippy::vec_box)] use futures::{future::Future, FutureExt}; use std::pin::Pin; mod nexus_bdev; mod nexus_bdev_children; mod nexus_bdev_rebuild; mod nexus_bdev_snapshot; mod nexus_channel; mod nexus_child; mod nexus_io; mod nexus_io_subsystem; mod nexus_iter; mod nexus_module; mod nexus_...
Rust
0
height= 46, fg_color= "#096C82", bg_color="#5DA7B1", border_color= "#FFFFFF", border_width= 3, corner_radius= 20, font = (fontr, 22), text_color="#FFFFFF" ) lastname_entry = customtkinter.CTkEntry( master= sign_up_scr, width= 295, h...
Python
1
import numpy as np from bokeh.layouts import row from bokeh.models import BoxSelectTool from bokeh.palettes import Spectral11 from bokeh.plotting import figure, show N = 4000 x = np.random.random(size=N)*100 y = np.random.random(size=N)*100 radii = np.random.random(size=N)*1.5 colors = np.random.choice(Spectral11, si...
Python
1
{ VCDiffDecoder { original, target, state: DecoderInternalState::WantHeader, code_table: CodeTable::default(), window_header: WindowHeader { win_indicator: 0, source_segment: None, delta_encoding_size: 0...
Rust
0
d returns it in \p pTexObject. \p pResDesc describes /// the data to texture from. \p pTexDesc describes how the data should be sampled. /// \p pResViewDesc is an optional argument that specifies an alternate format for /// the data described by \p pResDesc, and also describes the subresource region ///...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2017-2025 The diffsims developers # # This file is part of diffsims. # # diffsims is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
Python
1
_post.post_process(outputs) dt[1] += time_sync() - t2 #ugly solution suit for different output format if outputs is not list: out = outputs if type(outputs) is tuple: out = outputs[0] if len(outputs) == 2: out = outputs[0] ...
Python
1
$)sReturns True if and only if an arbitrary remaining node can potentially be joined with some other remaining node. c3F># UHoTRT;v M g7f)Nr)rrxrrws rr:DegreeSequenceRandomGraph.suitable_edge.<locals>.<genexpr>6...
Python
1
_array_assume_init)] #![feature(trusted_len)] #![feature(once_cell)] #![feature(arbitrary_enum_discriminant)] //! #n-triples. //! //! Domain model and parser for RDF N-triples [version 1.1](https://www.w3.org/TR/n-triples/). use chars::x00B7; use chars::x00C0; use chars::x00D6; use chars::x00D8; use chars::x00F6; u...
Rust
0
, scale: 1.0, offset: 0.0, }; } lazy_static! { pub static ref CANADIAN_DOLLAR: Unit = Unit { quantity: Some("currency".to_string(),), ids: ["canadian_dollar".to_string(), "CAD".to_string(),].to_vec(), dimensions: None, scale: 1.0, offset: 0.0, }; } l...
Rust
0
0.00002, 0.00001, 0.00001, 0.00002, 0.00002, 0.00003, 0.00002, 0.00003, 0.00004, 0.00005, 0.00017, 0.00069]) actualVal, actualUnc = self.reader.getXS('0', 10010, 102, 0) numpy.testing.assert_equal(actualVal, expectedValue) numpy.testing.assert_equal(actualUnc, expectedUnc...
Python
1
/// /// Coin: Loki [240], Loki, "Loki", "https://github.com/loki-project/loki", LOKI, , ), ( /// Coin type: 241 /// /// Coin: Imagewallet [241], Imagewallet, "Imagewallet", "https://imagewallet.io", , , ), ( /// Coin type: 242 /// /...
Rust
0
, ) { let id1 = c.assembly_id1; let id2 = c.assembly_id2; let jacobian1 = VectorSliceN::from_slice_generic(&jacobians[c.j_id1..], dim1, U1); let jacobian2 = VectorSliceN::from_slice_generic(&jacobians[c.j_id2..], dim2, U1); let weighted_jacobian1 = VectorSliceN::from_slice_g...
Rust
0
::std::os::raw::c_uint, pub disp: i64, } impl Clone for mips_op_mem { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Copy)] pub struct cs_mips_op { pub type_: mips_op_type, pub __bindgen_anon_1: cs_mips_op__bindgen_ty_1, } #[repr(C)] #[derive(Copy)] pub union cs_mips_op__bindgen_ty_...
Rust
0
#!/usr/bin/env python3 # Copyright 2024 Jiatong Shi # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import os import librosa import numpy as np import torch def vad_model_setup( threshold=0.5, min_speech_duration_ms=250, max_speech_duration_s=float("inf"), min_silence_duration_ms=100, ...
Python
1
uper::value::IDLField, } fn hex_to_char(hex: &str) -> Result<char, LexicalError> { let c = u32::from_str_radix(hex, 16).map_err(|_| LexicalError::ParseError(hex.to_owned()))?; std::char::from_u32(c).ok_or(LexicalError::OutOfRangeUnicode(c)) } #[derive(PartialEq)] enum Radix { Decimal, Hex, } impl fmt...
Rust
0
.register_template_string("startgame", include_str!("startgame.hbs")).unwrap(); // ... handlebars } lazy_static! { static ref HBS: Handlebars = init_templates(); } <reponame>Pratyush/algebra extern crate rustc_version; use rustc_version::{version_meta, Channel}; fn ...
Rust
0
as isize; let south: f64 = north - rows as f64 * cell_size; let east = west + columns as f64 * cell_size; let nodata = -32768.0f64; let mut configs = RasterConfigs { ..Default::default() }; configs.rows = rows as usize; configs.columns = columns as u...
Rust
0
false; // shuffle numbers array thread_rng().shuffle(&mut *number); for i in 0..max_prisoners { // put number from array to box pbox.push(number[i]); } // loop by prisoners for prisoner in 0..max_prisoners { let mut next = prisoner; ...
Rust
0
## Bokeh server for checkbox group from bokeh.io import curdoc from bokeh.layouts import row from bokeh.models import CheckboxGroup, ColumnDataSource from bokeh.plotting import figure x=[3,4,6,12,10,1] y=[7,1,3,4,1,6] source = ColumnDataSource(data=dict(x=x, y=y)) plot_figure = figure(title='Checkbox',height=450, w...
Python
1
sep`](self::sep) //! - path.toNamespacedPath => [`nodejs_path::to_namespaced_path`](self::to_namespaced_path) // Align to https://nodejs.org/docs/latest-v16.x/api/path.html #[cfg(test)] mod tests; mod path; #[cfg(target_family = "unix")] pub use path::posix::*; #[cfg(target_family = "windows")] pub use path::win32...
Rust
0
gpio}; pub type GpioOutError = core::convert::Infallible; pub type GpioInError = core::convert::Infallible; pub type TimerError = stm32f1xx_hal::timer::Error; pub type Time = stm32f1xx_hal::time::Hertz; pub(super) fn enable_interrupts() { unsafe { cortex_m::interrupt::enable() }; } pub(super) fn disable_interrup...
Rust
0
driver.alarm(); require!(self.alarm.get_alarm() == 0.into()); require!(self.hw.is_programming() == false); require!(self.client.state() == Some(MockClientState::WriteDone(kernel::ReturnCode::SUCCESS))); true } fn erase(&self, page: usize) -> bool { use kernel::hil::time...
Rust
0
# -- FILE: features/steps/number_steps.py """ Step-functions for soft-assertion example. STEPS: Given a minimum number value of "5" Then the numbers "2" and "12" are in the valid range And the number "4" is in the valid range """ from behave import given, then from assertpy import assert_that, soft_ass...
Python
1
gth += 1 n = len(spanning_set) for i,j in combinations(range(n), 2): # add the value of the bracket to known images Z = domain.bracket(spanning_set[i], spanning_set[j]) imZ = codomain.bracket(im_gens[i], im_gens[j]) spanning_set.app...
Python
1
the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { BUSFAULTENAR::EN => true, BUSFAULTENAR::DIS => false, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> BUSFAULTENAR { match value { ...
Rust
0
ze>, align_position: usize) -> usize { let mut fuel_total = 0; for position in positions { let distance = (align_position as isize - *position as isize).abs() as usize; let stepped_increase: usize = (1..distance + 1).sum(); fuel_total += stepped_increase; } fuel_total } pub(cr...
Rust
0
from pytils.translit import slugify from blog.models import Blog from django.views.generic import CreateView, ListView, DetailView, UpdateView, DeleteView from django.urls import reverse_lazy, reverse # Create your views here. class BlogCreateView(CreateView): model = Blog fields = ('name', 'content') ...
Python
1
# ------------------------------------------------------------------ # Copyright (c) 2020 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in LICENSE, distributed with # this software. # # SPDX-Licens...
Python
1
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Python
1
doc("quickstart", "quick") assert schema.get("doc", "quickstart") == ["quick"] assert schema.get_doc("quickstart") == [os.path.abspath("docs/quick")] def test_get_doc_all(): schema = PackageSchema() os.makedirs("docs", exist_ok=True) Path("docs/quick").touch() Path("user").touch() assert...
Python
1
( "Hello world 2".to_string(), 800, 1200, Some(icon_path), ); window .add_font("fonts/NotoSans/NotoSans-Regular.ttf") .unwrap(); let rust_image = window.add_image("images/rust_press.png").unwrap(); let sync_state = CommonState::new_local_with_key(&"Hello...
Rust
0
&[1, 2], 4, ConfChangeType::FinalizeMembershipChange, ); scenario.assert_not_in_membership_change(&[1, 2]); Ok(()) } // Ensure if the old quorum fails during the joint state progress will halt until the peer group is recovered. #[test] fn old_quoru...
Rust
0
, Value::xml("<test>1</test>",))); test_type!(xml_array( postgresql, "xml[]", Value::Array(None), Value::array(vec![ Value::text("<test>1</test>"), Value::text("<test>2</test>"), Value::Text(None) ]) )); #[cfg(feature = "uuid")] test_type!(uuid( postgresql, "uuid", ...
Rust
0
> 22, 'u' => 23, _ => 24, }]; for (j, segment_pin) in self.segment_pins.iter().enumerate() { segment_pin.digital_write(states[j]); } digit_pin.digital_write(Lo...
Rust
0
itions: Some(2), }; let b = JournalDevice { device: PathBuf::from("/dev/sdb"), partition_id: None, partition_uuid: None, num_partitions: Some(1), }; let mut journal_devices = vec![a.clone(), b.clone()]; journal_devices.sort_by_key(|j| j.num_partitions); println!("...
Rust
0
pub lip_height: f32, pub mustache_y: f32, pub mustache_width: f32, pub mustache_height: f32, pub eye_x: f32, pub eye_y: f32, pub eye_width: f32, pub eye_height: f32, pub eye_rotation: f32, pub eyebrow_x: f32, pub eyebrow_y: f32, pub eyebrow_width: f32, pub eyebrow_he...
Rust
0
title=obj.title, culprit=obj.culprit, shortId=obj.qualified_short_id, level=_get_level_label(obj), status=_get_status_label(obj), substatus=_get_substatus_label(obj), platform=obj.platform, project=_make_group_project_response(...
Python
1
_PMAOVRMW { w: self } } #[doc = "Bit 15 - Correct transfer interrupt mask"] #[inline] pub fn ctrm(&mut self) -> _CTRMW { _CTRMW { w: self } } } // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with th...
Rust
0
igmoid" , &[-1.0, 0.0, 1.0, 2.0, 3.0] , &[0.2689, 0.5000, 0.7311, 0.8808, 0.9526]); } #[test] fn relu(){ verify_func(activations::relu , "relu" , &[-1.0, 0.0, 1.0, 2.0, 3.0] , &[0.0, 0.0, 1.0, 2.0, 3.0]); } #[test] fn lrelu(){ verify_func(activ...
Rust
0
, unknown7: DEFAULT_FLOAT, unknown8: DEFAULT_FLOAT }, Sound{ id: "gg_snd_Avatar".to_string(), file: "Abilities\\Spells\\Human\\Avatar\\Avatar.wav".to_string(), effect: "SpellsEAX".to_string(), flags: ...
Rust
0
import random import numpy as np import cv2 from PIL import Image from PIL import ImageFilter import PIL import tifffile def cv_rotate(image, angle, borderValue): """ rot angle, fill with borderValue """ # grab the dimensions of the image and then determine the # center (h, w) = image.shape[:...
Python
1
if not module.src.value() is trigMchMod.src.value() + postfix: print('%s():'%( self._label )) print(' Configuration conflict for PAT trigger match embedder \'%s\''%( label )) print(' - exists for input %s'...
Python
1
ob: PortB = PortB::split(dp.GPIOB, &mut dp.RCC); /// let b8: RfIrq2 = cortex_m::interrupt::free(|cs| RfIrq2::new(gpiob.b8, cs)); /// ``` #[inline] pub fn new(mut pin: pins::B8, cs: &CriticalSection) -> Self { use sealed::RfIrq2; pin.set_rf_irq2_af(cs); Self { pin } } ///...
Rust
0
vec, |d| tremor_value::parse_to_value(d).unwrap().into()); /// let v: Value = e.rent(|s| { /// s.value()["key"].clone() /// }); /// println!("v: {}", v) /// ``` pub fn rent<'iref, F, R>(&'iref self, f: F) -> R where F: for<'head> FnOnce(&'head ValueAndMeta<'head>) -> R, ...
Rust
0