text string | label_name string | labels int64 |
|---|---|---|
The data that was parsed from the file.
pub store: BTreeMap<String, String>,
}
impl<'a> EnvFile<'a> {
/// Open and parse an environment file.
pub fn new(path: &'a Path) -> io::Result<EnvFile<'a>> {
let data = read(path)?;
let mut store = BTreeMap::new();
let values = data.split(|&x... | Rust | 0 |
long("utc")
.conflicts_with_all(&["OFFSET"]),
)
.arg(
Arg::with_name("OFFSET")
.help("Use given value as timezone offset.")
.short("o")
.long("offset")
.takes_value(true)
.allow_hyphen_values(true... | Rust | 0 |
pub Reserved: [UINT8; 8usize],
}
impl ::core::clone::Clone for Struct_acpi_table_mcfg {
fn clone(&self) -> Self { *self }
}
impl ::core::default::Default for Struct_acpi_table_mcfg {
fn default() -> Self { unsafe { ::core::mem::zeroed() } }
}
pub type ACPI_TABLE_MCFG = Struct_acpi_table_mcfg;
#[repr(C, pac... | Rust | 0 |
ship_config;
use dioxus::prelude::*;
use crate::ship::Ship;
pub fn app(cx: Scope) -> Element {
let ship = use_ref(&cx, || Ship::default());
cx.render(rsx! {
style { [include_str!("../../css/tailwind.min.css")] }
style { [include_str!("../../css/daisyui.css")] }
style { [include_str!(... | Rust | 0 |
ain(
¶ms,
&hic_links,
&long_hic_links,
&ccs_mols,
&txg_mols,
&variant_contig_order,
&assembly,
&kmers,
);
let (contig_chunk_positions, contig_chunk_indices) = assess_breakpoints(
&hic_links,
&ccs_mols,
&txg_mols,
... | Rust | 0 |
from http import HTTPStatus
from typing import List
from flask_openapi3 import OpenAPI, Info, Tag
import paho.mqtt.client as mqtt
import flask
from pydantic import BaseModel, Field
import random
import os
BROKER_URL = os.environ.get('BROKER_URL')
BROKER_PORT = int(os.environ.get('BROKER_PORT', 8883))
CLIENT_USER = ... | Python | 1 |
}};
}
<reponame>mgattozzi/libgit-rs<gh_stars>1-10
use crate::OID;
use bstr::{BStr, BString, ByteSlice};
use std::{fs, io, path::Path};
/// A [`Blob`] is a git object that represents a file in a git directory. For
/// instance all of the bytes that makes up the file that these docs for this
/// struct reside in, would ... | Rust | 0 |
_family(family);
let mut calculator_state = LocalState::new(CalculatorState::new());
let upper_display_string = calculator_state.mapped(|m: &CalculatorState| m.get_upper_display());
let display_string = calculator_state.mapped(|m: &CalculatorState| m.get_display());
let display = HStack::new(vec![
... | Rust | 0 |
pe": "date"
}
}
}
}
},
"status": {
"type": "text"
},
"user_data": {
"enabled": False,
"type": "object"
},
"user_data_es": {
"dynamic": False,
... | Python | 1 |
# global
import abc
from typing import Optional, Tuple
# local
import ivy
class _ArrayWithSearchingExperimental(abc.ABC):
def unravel_index(
self: ivy.Array,
shape: Tuple[int],
/,
*,
out: Optional[ivy.Array] = None,
) -> Tuple[ivy.Array]:
"""ivy.Array instance ... | Python | 1 |
from __future__ import annotations
from typing import Any
import pytest
from versioningit.basics import basic_tag2version
from versioningit.errors import InvalidTagError
@pytest.mark.parametrize(
"tag,params,version",
[
("v01.02.03", {}, "01.02.03"),
("01.02.03", {}, "01.02.03"),
("vba... | Python | 1 |
from django.apps import AppConfig
class UserprofileConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'userprofile'
| Python | 1 |
}
self.locals.local_count += 1;
}
/// Finish the building
pub fn build(self) -> Locals {
// sanity check
assert!(self.current_scope_path.is_empty());
self.locals
}
}
impl<'a> LocalsQuery<'a> {
pub fn new(locals: &'a Locals) -> LocalsQuery<'a> {
LocalsQuery... | Rust | 0 |
Maps,
pub neg_o_ps_adjacency_list_maps: AdjacencyListMaps,
pub pos_predicate_wavelet_tree_maps: BitIndexMaps,
pub neg_predicate_wavelet_tree_maps: BitIndexMaps,
}
impl<F: FileLoad + FileStore + Clone> ChildLayerFiles<F> {
pub async fn map_all(&self) -> io::Result<ChildLayerMaps> {
let node_dic... | Rust | 0 |
ote_addr);
}
// If hostname matching failed, attempt to match against IPs.
addrs = Proxy::parse_addr(addr, only_4, only_6)?;
for addr in addrs.into_iter() {
if addr == remote_addr {
info!("Matched with host IP \"{}\" and port \"{}\"", ... | Rust | 0 |
t/#read--modify--write-api).\n\nFor information about available fields see [gpio_bt_select](gpio_bt_select) module"]
pub type GPIO_BT_SELECT = crate::Reg<u32, _GPIO_BT_SELECT>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _GPIO_BT_SELECT;
#[doc = "`read()` method returns [gpio_bt_select::R](gpio_bt_select::R) reade... | Rust | 0 |
#!/usr/bin/env python
# coding: utf-8
# #### MAGNETIC FIELD MODEL COLLETCTION
# * Auther: Shi Chen at CEA-IGP
# * Date: 2019-09-29
import datetime as dt
from magmod.magnetic_model.loader_igrf import load_model_igrf
from magmod.magnetic_model.loader_wmm import load_model_wmm
from magmod.magnetic_model.loader_emm impo... | Python | 1 |
build_foo() -> HtmlInputElement {
web_sys::window()
.unwrap()
.document()
.unwrap()
.get_element_by_id("foo")
.unwrap()
.unchecked_into()
}
#[inline]
fn clear(app: &mut Test, _addr: &Addr<Test>) {
app.fortunes.clear();
// TODO: macro
app.black_box.t_root ... | Rust | 0 |
static SO_DEBUG: i32 = 1;
pub static SO_REUSEADDR: i32 = 2;
pub static SO_TYPE: i32 = 3;
pub static SO_ERROR : i32 = 4;
pub static SO_DONTROUTE: i32 = 5;
pub static SO_BROADCAST: i32 = 6;
pub static SO_SNDBUF: i32 = 7;
pub static SO_RCVBUF: i32 = 8;
pub static SO_SNDBUFFORCE: i32 = 32;
pub static SO_RCVBUFFORCE: i32 =... | Rust | 0 |
(lines).or_else(||parse_unordered_list(lines)),
'`' => parse_code_block(lines),
'>' => parse_blockquote(lines),
'0'..='9' => parse_ordered_list(lines),
'[' => parse_link_reference(lines),
'*' => parse_unordered_list(lines),
// Slow path
'\t' => parse_code... | Rust | 0 |
(r"meshes\i\in_lava_rock_14.nif", 0x5E41_1E38, 0x59D6_9211),
(r"meshes\i\in_lava_rock_12.nif", 0x5E41_1E38, 0x59D6_9212),
(r"meshes\i\in_lava_rock_10.nif", 0x5E41_1E38, 0x59D6_9213),
(r"meshes\i\in_lava_rock_18.nif", 0x5E41_1E38, 0x59D6_9217),
(r"meshes\i\in_lavacave2_05.nif", 0x5E41_1E38, 0x5... | Rust | 0 |
port_id, m.as_mut_ptr());
let link_addr = m.assume_init().addr_bytes;
println!("Link addr: {:x?}", link_addr);
};
}
unsafe fn initialize_dpdk_port(port_id: u16, mbuf_pool: *mut rte_mempool) {
let rx_rings = 1;
let tx_rings = 1;
let rx_ring_size = 128;
let tx_ring_size = 512;
let... | Rust | 0 |
response.res_data.unwrap().check_data.domain_list
//! .iter()
//! .for_each(|chk| println!("Domain: {}, Available: {}", chk.domain.name, chk.domain.available));
//!
//! // Close the connection
//! client.transact(&Logout, "transaction-id").await.unwrap();
//! }
//! ```
//!
//! The output would look similar to ... | Rust | 0 |
k2.sec is None
assert k2.pub == k.pub
assert k2.id() == k.id()
m = urandom(32)
sig = k.sign(m)
assert k2.verify(m, sig)
assert not k2.verify(urandom(32), sig)
from timeit import default_timer as timer
def test_timings():
# Make 100 keys
G = EcGroup()
keys = []
for _ in ran... | Python | 1 |
om: usize) -> String {
let mut v = Vec::with_capacity(self.len() * 3);
let mut i = from;
for chunk in self.chunks(chunk_size) {
let s = format!("{:08x}", i);
for &ch in s.as_bytes().iter() {
v.push(ch);
}
v.push(b'\t');
i += chunk_size;
for &byte in chunk {
... | Rust | 0 |
ebug("Server response: %s", info)
raise exception.AbortExtraction("API request failed")
return info["response"]
def _pagination(self, endpoint, params):
while True:
data = self._call(endpoint, params)
posts = data["posts"]
yield from posts
... | Python | 1 |
# Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.
#
# For example:
#
# A -> 1
# B -> 2
# C -> 3
# ...
# Z -> 26
# AA -> 27
# AB -> 28
# ...
# def convertToTitle(columnNumber):
# numbers = {1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E', 6: 'F', 7: 'G', 8: 'H', 9: 'I', ... | Python | 1 |
# coding: utf-8
"""
Copyright 2018 OSIsoft, 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 t... | Python | 1 |
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
import json, time
from datetime import datetime
from apps.config import *
from celery import Celery
from celery.utils.log import get_task_logger
from celery.schedules import crontab
logger = get_task_logger(__name__)
celery_app = Celery(Conf... | Python | 1 |
8, 0x59,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99,
0x100, 0x101, 0x102, 0x103, 0x1... | Rust | 0 |
import warnings
from flask import request, current_app as app
from flask_restplus import Resource
from prom2teams.app.sender import AlertSender
from prom2teams.prometheus.message_schema import MessageSchema
from .model import *
ns = api_v1.namespace(name='', description='Version 1 connections')
@ns.route('/')
@api... | Python | 1 |
t Loss: {running_loss:2.5f} \t\t Accuracy: {running_acc:2.5f} \t\t Precision: {(running_TP/(running_TP+running_FP+1e-8)):2.5f} \t\t Recall: {(running_TP/(running_TP+running_FN+1e-8)):2.5f} \n')
if running_loss<min_loss and epoch>4:
min_loss=running_loss
torch.save(classify.state_dict(), f'Classif_st... | Python | 1 |
�‰Š‹Œ#Ž##‘’“”•–—˜™š›œ#žŸ";
let mut chars = text.char_indices();
#[allow(clippy::never_loop)]
let mut error_start = 'success: loop {
let mut encoded = vec![];
for (i, d) in chars.by_ref() {
encoded.push(match d {
'\0'..='\u{7F}' | '\u{A0}'..='\u{FF}' => u8(d.conv::<u32>()).unwrap(),
... | Rust | 0 |
import pandas as pd
from xlwt import Workbook, easyxf
from datetime import datetime
# Configuração para estilos de texto (apenas cores de fonte)
style_error = easyxf('font: colour red;')
style_warning = easyxf('font: colour blue;')
style_default = easyxf('font: colour black;')
# Função para processar script-logs
def ... | Python | 1 |
// assert_eq!(paulix.global_phase(), ((PI) / 2.0).into());
/// ```
///
pub trait OperateSingleQubitGate:
Operate
+ OperateGate
+ InvolveQubits
+ Substitute
+ OperateSingleQubit
+ Clone
+ PartialEq
+ OperateSingleQubit
+ std::fmt::Debug
{
/// Returns alpha_r parameter of operation... | Rust | 0 |
w=6, column=0, padx=10, pady=10)
# ------------- LOGO WATERMARK SESSION TAB_2 ---------------
logo_upload = ctk.CTkButton(
master=tab_2, text="Upload Logo", width=200, corner_radius=10, command=upload_logo
)
logo_upload.grid(row=3, column=0, pady=10)
# ----------------- ImageFrame ---------------------
image_c... | Python | 1 |
,T7,)>
for hlist::ty![T0,T1,T2,T3,T4,T5,T6,T7] {
#[inline(always)]
fn from(t:(T0,T1,T2,T3,T4,T5,T6,T7,)) -> Self {
hlist::new![t.0,t.1,t.2,t.3,t.4,t.5,t.6,t.7]
}
}
impl<T0,T1,T2,T3,T4,T5,T6,T7,T8> From<(T0,T1,T2,T3,T4,T5,T6,T7,T8,)>
for hlist::ty![T0,T1,T2,T3,T4,T5,T6,T7,T8] {
#[inline(always)]... | Rust | 0 |
Self::const_basis_vector(n-1);
//since prev_blade.dim() < n and we're doing right-mul by e_n, we can just
//multiply by doing the XOR of the bits
BasisBlade { bits: prev_blade.bits ^ e_n.bits }
}
} else if 2*g==n {
//the number of elemen... | Rust | 0 |
= concat!("Copy u8 slice to ", $ty_literal, " vec in native-endian")]
#[inline]
fn [<to_ne_ $ty _vec>](&self) -> Vec<$ty> {
to_x_vec_impl!(self, $ty::from_ne_bytes)
}
}
)*
};
}
#[cfg(feature = "alloc")]
macro_rules! to_x_slice_lossy_impl_suite {
... | Rust | 0 |
id="test_file_id",
tenant_id=tenant_id,
type=FileType.IMAGE,
transfer_method=FileTransferMethod.REMOTE_URL,
remote_url="https://example.com/test.jpg",
filename="test.jpg",
extension=".jpg",
mime_type="image/jpeg",
... | Python | 1 |
a={
"kasar":40,
"dhj":55,
"kjhj":66,
0:"kasar"
}
print(a.items())
print(a.keys())
print(a.values())
a.update({"kasar":99})
print(a)
print(a.get("kasar2"))#prints none
print(a["kasar2"])#returns an error
| Python | 1 |
# Configure the preprocessor to use the asm-preprocessor-lexer
zxbpp.setMode("asm")
# Now filter them against the preprocessor
zxbpp.main([OPTIONS.input_filename])
# Now output the result
asm_output = zxbpp.OUTPUT
asmparse.assemble(asm_output)
if global_.has_errors:
return 1
... | Python | 1 |
U, 3]),
extrinsics_input = [cameraReader.extrinsics, cameraReader.extrinsics, cameraReader.extrinsics],
intrinsics_input = [cameraReader.intrinsics, cameraReader.intrinsics, cameraReader.intrinsics],
... | Python | 1 |
f: _ -> List[Int] = || [1, 2]", Expect::TypeError),
("1.53", "let f: _ -> List[_] = || [1, 2]", Expect::TypeError),
("1.54", "let f: _ -> _ = || [1, 2]", Expect::TypeError),
("1.55", "let f = || []", Expect::Ok),
("1.56", "let f: () -> List[Int] = || []", Expect::Ok),
("1.57", "let f: () -> List[S... | Rust | 0 |
ze(builder, OPSIZE_32);
codegen::gen_set_flags_changed(builder, FLAGS_ALL | FLAG_SUB);
}
pub fn instr16_06_jit(ctx: &mut JitContext) {
codegen::gen_get_sreg(ctx, regs::ES);
let sreg = ctx.builder.set_new_local();
codegen::gen_push16(ctx, &sreg);
ctx.builder.free_local(sreg);
}
pub fn instr32_06_jit... | Rust | 0 |
Response, StatusCode},
Filter, Reply,
};
use super::error::ErrorResponse;
use crate::schedule::{Schedule, ScheduleError};
const ROOT: &str = "schedules";
const LENGTH_LIMIT: u64 = 1024 * 32;
#[derive(Deserialize)]
struct ScheduleParams {
pub normalize: Option<bool>,
}
pub fn routes(directory: String) -> Box... | Rust | 0 |
#!/usr/bin/python
#coding:utf-8
import gc,objgraph
def identify_main(head='',context='',ip='',port='',productname='',protocol='',nmapscript=''):
keywords=''
hackinfo=''
# print '运行前状态'
# gc.collect()
# objgraph.show_growth()
print ip,port,'正在纳入检测的队列'
try:
from httpdect import headd... | Python | 1 |
name="dynamic_embedding_matrix")
dynamic_embed = tf.nn.embedding_lookup(dynamic_embedding_matrix, inputs, name="dynamic_embed")
dynamic_embed_expanded = tf.expand_dims(dynamic_embed, -1, name="dynamic_embed_expand")
# stack
embed_expanded = tf.concat((static_embed_expanded, dyn... | Python | 1 |
agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::collections::HashSet;
use st... | Rust | 0 |
Donate(f) => Ok(f.into_raw_fd()),
LookupFile::Borrow(f) => unistd::dup(f.as_raw_fd()),
}
}
}
fn open_static_dnode(static_ino: u64, path: &Path) -> Result<Arc<Inode>> {
let fd = tryfmt!(
fcntl::open(path, OFlag::O_RDONLY | OFlag::O_CLOEXEC, stat::Mode::all()),
"failed to open... | Rust | 0 |
buf_itrim(&self) -> LP_BUF_ITRIM_R {
LP_BUF_ITRIM_R::new(((self.bits >> 22) & 0x03) as u8)
}
#[doc = "Bits 20:21 - 21:20\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn dblr_loop_filter_reset_voltage(&self) -> DBLR_LOOP_FILTER_RESET_VOLTAGE_R {
DBLR_LOOP_... | Rust | 0 |
s_token;
pub mod refresh_access_token;
pub mod user;
pub mod user_medias;
pub use exchange_sl_access_token_for_ll_access_token::{
ExchangeSlAccessTokenForLlAccessTokenEndpoint,
ExchangeSlAccessTokenForLlAccessTokenResponseBody,
};
pub use refresh_access_token::{RefreshAccessTokenEndpoint, RefreshAccessTokenRes... | Rust | 0 |
verse0 = RcValue::from(Value::universe(0));
let bool_ty = context.globals.ty_bool.clone();
let bool_lit = |value| RcTerm::from(Term::Literal(Literal::Bool(value)));
let array_ty = RcValue::from(Value::FunType(Scope::new(
(
Binder(FreeVar::fresh_unnamed()),
... | Rust | 0 |
]
}"#,
)
} else {
ResponseTemplate::new(200)
.set_delay(self.2)
.set_body_string(r#"{"error":"Continue Wait"}"#)
}
}
}
#[tokio::test]
async fn test_continue_w... | Rust | 0 |
elf.x_mpc.X))]
pylab.ion()
pylab.clf()
pylab.subplot(211)
pylab.plot(trange, [v[0] for v in self.x_mpc.X])
pylab.plot(trange, [v[0] - v[2] * h / g for v in self.x_mpc.X])
pylab.subplot(212)
pylab.plot(trange, [v[0] for v in self.y_mpc.X])
pylab.plot(trange... | Python | 1 |
f._last_disk_io.read_bytes) / (1024**2) / time_delta
disk_write_mb_s = (disk_io.write_bytes - self._last_disk_io.write_bytes) / (1024**2) / time_delta
else:
disk_read_mb_s = 0
disk_write_mb_s = 0
self._last_disk_io = disk_io
self._last_disk_timestamp ... | Python | 1 |
ans.is_empty());
}
#[tokio::test]
async fn test_listing() {
let client = NFTFiClient::new().expect("client");
let stream = client.watch_listings(10).await;
let start_time = Utc::now();
pin_mut!(stream);
while let Some(Ok(listing)) = stream.next().await {
... | Rust | 0 |
sh"]["R"],
degree=cfg["solver"]["degree"],
potential_type=cfg["solver"]["potential_type"],
potential_params=cfg["solver"].get("potential_params", {}),
cfl_factor=cfg["solver"]["cfl"],
cfg=cfg
)
solver.set_background(alpha=alpha_f, beta=beta_f, gammaInv=gammaInv_f, sqrtg=s... | Python | 1 |
rmir_test'
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGG... | Python | 1 |
from functools import wraps
from inspect import signature
from typing import Any
from typing import Callable
from typing import Optional
from typing import Type
from openapi_core.exceptions import OpenAPIError
from openapi_core.validation.schemas.exceptions import ValidateError
OpenAPIErrorType = Type[OpenAPIError]
... | Python | 1 |
(Debug, Copy)]
pub struct LineWidth<Unit>(pub Figure<f32, Unit>);
impl<Unit> Clone for LineWidth<Unit> {
fn clone(&self) -> Self {
Self(self.0)
}
}
impl Default for LineWidth<Scaled> {
fn default() -> Self {
Self::new(1.)
}
}
impl<Unit> LineWidth<Unit> {
/// Creates a new `LineWid... | Rust | 0 |
:
mkdir(paths)
def mkdir(path):
"""create a single empty directory if it didn't exist
Parameters:
path (str) -- a single directory path
"""
if not os.path.exists(path):
os.makedirs(path)
def copy_state_dict(cur_state_dict, pre_state_dict, prefix='', load_name=None):
def _... | Python | 1 |
mage: None,
}
},
Gradient::Box { rect, radius, feather, inner_color, outer_color } => {
let Rect { xy, size } = rect;
Paint {
xform: Transform([1.0, 0.0, 0.0, 1.0, xy.x + size.width * 0.5, xy.y + size.height * 0.5]),
... | Rust | 0 |
RUST_LOG").is_err() {
std::env::set_var("RUST_LOG", "info");
}
env_logger::builder().format_timestamp_millis().init();
}
pub fn setup_interrupt() -> UnboundedReceiver<()> {
let (end_tx, end_rx) = tokio::sync::mpsc::unbounded_channel();
ctrlc::set_handler(move || {
log::debug!("Received ... | Rust | 0 |
r object returned from the API
pub struct Error {
/// The URI the error happened on
pub address: String,
/// A short description of the error
pub description: String,
/// Its errorcode
#[serde(rename="type")]
pub code: u16,
}
use std::{borrow::BorrowMut, fmt, mem};
use super::*;
pub(super)... | Rust | 0 |
eature = "mmap")]
fn stream_41_mmap_permit(b: &mut Bencher) {
let tune = FutioTuner::new()
.set_blocking_policy(BlockingPolicy::Permit(&BLOCKING_SET))
.finish();
let sink = BodySink::with_fs(test_path().unwrap()).unwrap();
let body = sink_data(sink).unwrap();
let mut rt = mt_runtime(2, S... | Rust | 0 |
n_endpoint}"
response = requests.get(login_url, timeout=30)
response.raise_for_status()
COOKIES = response.cookies
submission_feedback_endpoint = set_submission_feedback_endpoint(
run_alias=guid,
course_alias=COURSE_ALIAS,
assignment_alias=ASSIGNMENT_ALIAS,
feedback="Ma... | Python | 1 |
"""
raise NotImplementedError
def predict_stages(self, task, states):
"""Predict the scores of all stages in states. This is the breakdown version of `predict`.
Parameters
----------
search_task : SearchTask
The search task of states
states : List[State... | Python | 1 |
mark!('e'), ctx!(curid, vwctx, vctx)).unwrap();
ebuf.set_leader(curid, Cursor::new(4, 4));
ebuf.mark(mark!('f'), ctx!(curid, vwctx, vctx)).unwrap();
let op = EditAction::Motion;
// Move to the top left to begin.
ebuf.set_leader(curid, Cursor::new(0, 0));
// Using LineJ... | Rust | 0 |
(0x02) });
}
#[entry]
fn main() -> ! {
let dp = Peripherals::take().unwrap();
let mut flash = dp.FLASH.constrain();
let mut rcc = dp.RCC.constrain();
let mut pwr = dp.PWR.constrain(&mut rcc.apb1r1);
// Set HCLK to 48MHz
let clocks = rcc
.cfgr
.pll_source(PllSource::HSI16)
... | Rust | 0 |
1]
assert_allclose(e_test * 2 / rho1[0], e_ref, atol=1e-7)
assert_allclose(2 * vrho_test[1], vxc[0].T[1], atol=1e-7)
assert_allclose(4 * vsigma_test[1], vxc[1].T[2], atol=1e-7)
assert_allclose(2 * vrho_test[0], vxc[0].T[0], rtol=1e-2)
assert_allclose(e_test, _e)
assert_al... | Python | 1 |
set_brightness = |nits| {
result.push(nits as f32);
};
set_brightness_slowly(0.9, 1.2, set_brightness, 0.millis()).await;
assert_eq!(cmp_float(21.0, result.len() as f32), true, "wrong length");
assert_eq!(cmp_float(0.90, result[0]), true);
assert_eq!(cmp_float(0.91, ... | Rust | 0 |
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: liekkaskono@163.com
from datetime import datetime
from pathlib import Path
from string import Template
from typing import List, Union
import yaml
def make_prompt(query: str, context: str = None, custom_prompt: str = None) -> str:
if context is None:
r... | Python | 1 |
isual
# space.
#epub_theme = 'epub'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project... | Python | 1 |
{init_physical_devices, PhysicalDeviceInfos};
use crate::instance::{InstanceExtensions, RawInstanceExtensions};
use crate::vk;
use crate::Error;
use crate::OomError;
use crate::Version;
use crate::VulkanObject;
use smallvec::SmallVec;
use std::borrow::Cow;
use std::error;
use std::ffi::CString;
use std::fmt;
use std::h... | Rust | 0 |
("[{}:{}] {:?}", file!(), line!(), $msg)
}};
}
#[allow(unused_macros)]
#[cfg(not(debug_assertions))]
macro_rules! log_dbg {
($msg: expr) => {{
()
}};
}
#[derive(Debug, Copy, Clone, PartialEq)]
#[repr(C)]
pub enum CctpErrorCode {
OK,
NullPtr,
InvalidValue,
InvalidBufferData,
Inv... | Rust | 0 |
label_values(&[ctx.props().listener.as_str()]),
);
let copy_b_to_a = copy_stream(
sread,
"server",
cwrite,
"client",
ctx.props().server_stat.clone(),
#[cfg(feature = "metrics")]
IO_BYTES_SERVER.with_label_values(&[ctx.props().connector.as_deref().unwrap()]... | Rust | 0 |
ret: *mut blst_fp2, a: *const blst_fp2);
}
extern "C" {
pub fn blst_fp2_mul_by_8(ret: *mut blst_fp2, a: *const blst_fp2);
}
extern "C" {
pub fn blst_fp2_lshift(ret: *mut blst_fp2, a: *const blst_fp2, count: usize);
}
extern "C" {
pub fn blst_fp2_mul(ret: *mut blst_fp2, a: *const blst_fp2, b: *const blst_fp2... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from pathlib import Path
from unifypy.core.plugin import BasePlugin
from unifypy.core.event_bus import EventBus
from unifypy.core.events import ENVIRONMENT_CHECK
class WindowsLanguagePlugin(BasePlugin):
name = "windows_language"
# 在 environment(30) 之后、... | Python | 1 |
lDevHsiClk>())).hsiClk as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(rlDevHsiClk),
"::",
stringify!(hsiClk)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<rlDevHsiClk>())).reserved as *const _ as usize ... | Rust | 0 |
#[rustfmt::skip]
let positive_definite_H = vec![
2.0, -1.0, 0.0, // transposed H is displayed
-1.0, 2.0, -1.0,
0.0, -1.0, 2.0,
];
let b = vec![6.0, 6.0, 6.0];
let solve_output = SparseCholeskySolver::solve(
DMatrix::<f64>::from_vec... | Rust | 0 |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
__author__ = "aagrawal"
| Python | 1 |
reco = next((p["preco"] for p in produtos_relevantes if p["nome"] == self.produto_sugerido), 0)
proposta = (
f"Proposta Comercial:\n\n"
f"Cliente: {self.nome}\n"
f"E-mail: {self.email}\n"
f"Telefone: {self.telefone}\n\n"
f"Produto: {self.produto_sugeri... | Python | 1 |
带上吧。',
TxtCtl.Enter,
),
)
CloseMessageWindow()
SetMessageWindowPos(-1, -1, -1, -1)
FadeOut(300, 0, 100)
TalkSetChrName('')
PlaySE(17, 0x00, 0x64)
Talk(
(
(TxtCtl.SetColor, 0x0),
'得到了',
(TxtCtl.SetColor, 0x2),
'市长的介... | Python | 1 |
import glob
import os
def main(cmd=None):
# get transcriptions
transcriptions = {}
transcripts = open(
os.environ["TEDX_SPANISH"]
+ "/tedx_spanish_corpus/files/TEDx_Spanish.transcription"
)
for row in transcripts:
txt = " ".join(row.split(" ")[:-1])
uttid = row.spl... | Python | 1 |
import string
import sys
import os
import argparse
"""
def vigenere_encipher(p,k):
# given a string p of all lowercase letters,
# and a key k of all lowercase letters,
# return a string of all uppercase letters,
# which is the vigenere encryption of p by key k.
c = ""
i = 0
for pi in p:
# some sample c... | Python | 1 |
"""thread_pool_executor.py
Operate on a raster dataset window-by-window using a ThreadPoolExecutor.
Simulates a CPU-bound thread situation where multiple threads can improve
performance.
With -j 4, the program returns in about 1/4 the time as with -j 1.
"""
import concurrent.futures
import multiprocessing
import th... | Python | 1 |
lag_neighbors = []
for point in points:
coordinates = point[:-1]
mask = select_points_within_ellipse(
ellipse_center=coordinates,
other_points=coords,
lag=current_lag,
step_size=step_size,
w_matrix=w_matrix
)
points_i... | Python | 1 |
import abc
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .spans import Span
from .traces import Trace
class TracingProcessor(abc.ABC):
"""Interface for processing spans."""
@abc.abstractmethod
def on_trace_start(self, trace: "Trace") -> None:
"""Called when a trace is star... | Python | 1 |
"""
Write a python function to find the element that appears only once in a sorted array.
assert search([1,1,2,2,3]) == 3
"""
def search(arr):
"""
:param arr: sorted array
:return: element that appears only once
"""
if len(arr) == 0:
return None
if len(arr) == 1:
return arr[0]
... | Python | 1 |
> = std::env::args().collect();
if args.len() != 2 {
println!("Usage:\n\tminimal <out-directory>");
return;
}
let filling_nodes = generate_filling_nodes().unwrap();
let attributes = generate_standard_attributes();
for num in attributes.numbers {
for color in attributes.col... | Rust | 0 |
lf.cmap[l, 0]
g[temp == l] = self.cmap[l, 1]
b[temp == l] = self.cmap[l, 2]
rgb = np.zeros((temp.shape[0], temp.shape[1], 3))
rgb[:, :, 0] = r / 255.0
rgb[:, :, 1] = g / 255.0
rgb[:, :, 2] = b / 255.0
return rgb
if __name__ == "__main__":
import mat... | Python | 1 |
"""
深度优化脚本 - 针对三个核心问题
1. 侦察任务完成度: 0.09 -> 0.97
2. 安全区域时间: 10.36s -> 2.1s
3. 干扰失效率: 72% -> 23.3%
"""
import numpy as np
import pandas as pd
import os
from src.environment.electronic_warfare_env import ElectronicWarfareEnv
class DeepOptimizer:
def __init__(self):
self.paper_metrics = {
'reconn... | Python | 1 |
user_data = load_user_data(request.session)
if user_data.attempts_given_for(question_id) < 3:
raise Http404
d = {}
d['question'] = get_object_or_404(Question, id=question_id)
return render(request, 'quiz/giveup.html', d)
@never_cache
def start(request):
clear_quiz_in_progress(request.s... | Python | 1 |
,
manager: &mut EM,
scheduler: &CS,
in_dirs: &[PathBuf],
) -> Result<(), Error>
where
E: Executor<BytesInput> + HasObservers<OT>,
OT: ObserversTuple,
EM: EventManager<BytesInput, Self>,
CS: CorpusScheduler<BytesInput, Self>,
{
for in_dir in in_... | Rust | 0 |
ess(
instance_id=instance_id,
public_ip=self.public_ip,
network_interface_id=network_interface_id,
private_ip_address=private_ip_address,
allow_reassociation=allow_reassociation,
dry_run=dry_run
)
def disassociate(self, dry_run=False):... | Python | 1 |
import re
import sys
from pg_sample_texts import DIV_COMM, MAG_CART
documents = [DIV_COMM, MAG_CART]
keywords = {}
for keyword in sys.argv[1:]:
keywords[keyword] = re.compile(r'\b' + keyword + r'\b', re.IGNORECASE)
title_search = re.compile(r'(title:\s*)(?P<title>[a-zA-Z, \n]* \s)', re.IGNORECASE)
title_search ... | Python | 1 |
import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="waterfall.connector", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | Python | 1 |
]
)
def test__ProcessorTextLog__logblock_get_index_from_splited_by_pattern(p1,p2,p3,p4,_EXPECTED):
test_obj_link = ProcessorTextLog().logblock_get_index_from_splited_by_pattern
result = test_obj_link(data=p1, pattern=p2, block_index=p3, include_pattern_line=p4)
assert result == _EXPECTED
def _test_... | Python | 1 |
ighbor
Nearest,
/// Linear Filter
Triangle,
/// Cubic Filter
CatmullRom,
/// Gaussian Filter
Gaussian,
/// Lanczos with window 3
Lanczos3,
}
/// A Representation of a separable filter.
struct Filter<'a> {
/// The filter's filter function.
pub(crate) kernel: Box<dyn Fn(f3... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.