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 |