text string | label_name string | labels int64 |
|---|---|---|
8732226822098929438;
break;
}
}
match current_block {
876886731760051519 => {}
_ => {
str_ptr -= 1;
... | Rust | 0 |
import subprocess
from typing import Annotated
import click
import rich
from etc import ROOT
@click.command()
@click.option(
"--check",
is_flag=True,
default=False,
help="Don't change any files, just fail if files would be formatted",
)
def fmt(check: bool) -> None:
"""Reformat Rust and Python c... | Python | 1 |
_canister_id(&agent, ucan_id).await;
//! // etc.
//! });
//! ```
//!
//! If one wants to retain the agent for later use, one should use the
//! `build_default_agent()` method:
//!
//! ```text
//! let agent = node.build_default_agent();
//! ```
//! Node VMs can be killed, started, or rebooted as follows:
//!
//! ```... | Rust | 0 |
import torch
import numpy as np
import cv2
from torchvision.transforms import Compose, Normalize
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
image_net_mean = torch.Tensor([0.485, 0.456, 0.406])
image_net_std = torch.Tensor([0.229, 0.224, 0.225])
import matplotlib.pyplot as plt
class Nor... | Python | 1 |
.append(eg)
print(lnn,error)
line4,=plt.plot(lnn,energynorma, label="quartic",marker=".")
#line5,=plt.plot(nelem,energyexact, label="exact", marker=".")
plt.legend(handles=[line1, line2, line3, line4])
plt.title("Plot of relative error with increasing number of elements")
plt.ylabel("ln(relative error)")
plt.xlabel("ln... | Python | 1 |
;
f.begin_metric("ton_subscriber_shard_client_time_diff")
.label(LABEL_STAKER, &self.0.staker_account_str)
.value(shard_client_time_diff)?;
f.begin_metric("ton_subscriber_mc_block_seqno")
.label(LABEL_STAKER, &self.0.staker_account_str)
... | Rust | 0 |
ption7B(in3c, 384,
64, 96, 96,
"max", "mixed_3")
# stage 4
in4a = Inception7C(in3d, 192,
128, 128, 192,
128, 128, 128, 128, 192,
"avg", 192, "mixed_4")
in4b = Inception7C(in4a, 192,
... | Python | 1 |
&clocks.sercom4_core(&gclk0).unwrap(),
bus_speed.into(),
sercom4,
mclk,
sda.into_pad(port),
scl.into_pad(port),
)
}
<filename>libbit/src/refs.rs<gh_stars>1-10
mod ref_decorations;
mod refdb;
mod reflog;
use crate::error::{BitGenericError, BitResult};
use crate::obj:... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-10-12 20:56
from __future__ import unicode_literals
from django.db import migrations
def reverse_func(apps, schema_editor):
return 1
def backup_identifiers(apps, schema_editor):
Position = apps.get_model("crm", "Position")
CustomerGroupTransfo... | Python | 1 |
b'9',
];
<filename>src/gl_utils.rs
extern crate gl;
use gl::types::*;
use std::mem;
use std::ptr;
use std::str;
use std::fs;
use std::ffi::CString;
use std::slice;
pub fn compile_shader(path: &str, ty: GLenum) -> GLuint {
use std::io::Read;
let mut src = String::new();
let mut file = fs::File::open(path).... | Rust | 0 |
fn logger_is_not_enabled_after_panic() {
let _ = catch_unwind(|| {
collect(|| {
panic!();
})
});
assert!(!enabled());
}
}
<filename>src/day2.rs
use std::fs::File;
use std::io::{BufRead, BufReader, Error, Read};
use regex::Regex;
fn read<R: Read>(i... | Rust | 0 |
from queue import LifoQueue as Pila
from queue import Queue as Cola
# ------------------------- COLA ------------------------
def copiar_cola(original: Cola) -> Cola:
res: Cola = Cola()
copia_temp: Cola = Cola()
while not original.empty():
v = original.get()
res.put(v)
copia_temp.... | Python | 1 |
from aiogram.types import ContentType
from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.kbd import SwitchTo, Column, Row, Button, Group, Select, Start, Url, Cancel
from aiogram_dialog.widgets.text import Format, Const
from aiogram_dialog.widgets.input import TextInput, MessageInput
from aiogram_dial... | Python | 1 |
== Greater {
unsafe { unsafe_swap(v, j, j-1); }
cap -= 1;
j -= 1;
if cap == 0 {
return false;
}
}
i += 1;
}
true
}
/// Perform an insertion sort using a comparison function.
///
/// `sort` falls back to this for small ... | Rust | 0 |
UsePatternDetect(input)
}
}
impl From<bool> for ParamValue {
fn from(input: bool) -> Self {
ParamValue::Bool(input)
}
}
impl From<NumRegAB> for ParamValue {
fn from(input: NumRegAB) -> Self {
ParamValue::NumRegAB(input)
}
}
impl From<NumReg> for ParamValue {
fn from(input: Num... | Rust | 0 |
::time::SystemTime;
// 目录信息
pub struct DirInfo {
pub count: usize, // 统计所有文件、目录
pub count_dir: usize, // 目录统计数
pub count_file: usize, // 文件统计数
pub bytes: f64, // 总文件大小
pub run_second: f64, // 运行秒数统计
pub path_dir: String, // 当前的目录路径
pub pat... | Rust | 0 |
making.
#[rustfmt::skip]
pub fn persp(size: Size<T>, fov: Angle<T>, near: T, far: T) -> Self
where
T: en::Float,
{
let (_0, _1) = (T::zero(), T::one());
let f = fov.radians().halved().tan().recip();
let depth = near - far;
Self::row_major(
f / size.as... | Rust | 0 |
import openmc
import pytest
from tests.testing_harness import PyAPITestHarness
@pytest.fixture
def model():
model = openmc.Model()
uo2 = openmc.Material(name='UO2')
uo2.set_density('g/cm3', 10.0)
uo2.add_nuclide('U235', 1.0)
uo2.add_nuclide('O16', 2.0)
water = openmc.Material(name='light wat... | Python | 1 |
context,
execution_context,
}
}
pub fn execute(&mut self, table_name: ObjectName, column_def: ColumnDef) -> MysqlResult<u64> {
let full_table_name =
meta_util::fill_up_table_name(&mut self.session_context, table_name.clone()).unwrap();
let table_map = s... | Rust | 0 |
import click
from bragir.client import initiate_client
from bragir.config import LoggingLevel, config
from bragir.tracing.logger import setup_logging
from bragir.tracing.stratergies import DebugLoggerStrategy, InfoLoggerStrategy
from . import commands
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
@c... | Python | 1 |
}
}
}
struct SpinnerContext {
channels: [Channel; NUM_CHANNELS],
subsystem_conf: &'static message_dispatcher::subsystem_message_conf,
}
static mut SPINNER_CTX: Option<SpinnerContext> = None;
fn get_channels() -> &'static mut [Channel] {
unsafe {
match SPINNER_CTX {
Some(r... | Rust | 0 |
lt, expected);
}
#[test]
fn clean_except2() {
use self::token::ReservedChar;
let source = "let x = [ 1, 2, \t3];";
let expected = "let x = [ 1, 2, 3];";
let result = simple_minify(source)
.apply(|f| {
::js::clean_tokens_except(f, |c| {
c.get_char() != Some(Reserved... | Rust | 0 |
lse Edas.ticks_ms()
return self._ms
def add_ms(self, delta):
''' 意識している時刻を delta(ms) だけ加算する '''
self._ms = time.ticks_add(self._ms, int(delta))
return self._ms
def ref_time(self):
''' 意識している時刻を返す '''
return self._ms
def y_wait_ms(self, wait_ms, update=False... | Python | 1 |
.shape)
fc3 = Dense(600, name="fc3", activation='relu', kernel_initializer=he_normal(seed=65))(fc2)
print('fc3:', fc3.shape)
complex_mask = Dense(257 * 2 * people_num, name="complex_mask", kernel_initializer=glorot_uniform(seed=87))(fc3)
print('complex_mask:', complex_mask.shape)
complex_mask_out ... | Python | 1 |
init(transit::Ability::all_abilities(), relay_url).await?;
// send the transit message
debug!("Sending transit message '{:?}", connector.our_hints());
wormhole
.send(
PeerMessage::new_transit(
connector.our_abilities().to_vec(),
(**connector.our_hints()).... | Rust | 0 |
if autoplay:
audio_segment = AudioSegment.from_file(full_path)
play(audio_segment)
else:
# Generate new audio
samples, sample_rate = kokoro.create(
text,
voice=voice_id,
spee... | Python | 1 |
ult") or out.get("answer") or out.get("output_text")
sources = []
for doc in out.get("source_documents", []):
sources.append({
"source": doc.metadata.get("source"),
"chunk": doc.metadata.get("chunk"),
"preview": doc.page_content[:300]
... | Python | 1 |
}'), ('\u{2f800}',
'\u{2fa1d}')
];
pub const LC_table: &'static [(char, char)] = &[
('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{b5}', '\u{b5}'),
('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{1ba}'),
('\u{1bc}', '\u{1bf}'), ('\u{1c4}', '\u{293}'), ('\u{295}', '\... | Rust | 0 |
mplers.
//!
//! # Examples
//!
//! Initializing a texture with a single image.
//! ```rust,no_run
//! # use std::rc::Rc;
//! use gullery::{
//! # ContextState,
//! image_format::SRgba,
//! geometry::{D2, GLVec2},
//! texture::Texture,
//! };
//! # let context_state: Rc<ContextState> = panic!();
//! let ... | Rust | 0 |
let mut ecc_handle: sgx_ecc_state_handle_t = 0 as sgx_ecc_state_handle_t;
unsafe {
handle_sgx!(sgx_ecc256_open_context(&mut ecc_handle))?;
handle_sgx!(sgx_ecc256_compute_shared_dhkey(
&mut sgx_prvkey,
&mut sgx_pubkey,
&mut gab_x,
ecc_handle
... | Rust | 0 |
hive::new(&bytes[..]);
let td = t!(Builder::new().prefix("tar").tempdir());
t!(ar.unpack(td.path()).await);
t!(td.path().join("foo").metadata());
t!(td.path().join("bar").metadata());
}
#[tokio::test]
async fn absolute_link_deref_error() {
let mut ar = async_tar::Builder::new(Vec::new());
let... | Rust | 0 |
feature = "web-frame-format"))]
pub fn frame(&mut self) -> &[u32; NES_SCREEN_DIMENSIONS] {
self.complete_frame();
return self.get_screen();
}
/// Runs as many cycles as necessary to complete the current frame.
/// Returns the frame as an of 32 bit colour ARGB colour values.
#[cfg(fe... | Rust | 0 |
# This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
import os
import platform
import shlex
import socket
import sys
import requests
_hostname = socket.gethostname()
def tag_value(value):
value = str(value)
for escape in [',', '=', ' ']:
v... | Python | 1 |
t(att_dim * mlp_ratio)
self.has_cls_embed = has_cls_embed
self.mlp = Mlp(
in_features=att_dim,
hidden_features=mlp_hidden_dim,
out_features=dim_out,
act_layer=act_layer,
dropout_rate=dropout_rate,
bias_on=bias_on,
)
... | Python | 1 |
from django.urls import path
from .views import HelloView
from .api import RegisterApi
urlpatterns = [
path('hello/', HelloView.as_view(), name='hello'),
path('api/register/', RegisterApi.as_view(),name='register',)
] | Python | 1 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Mobile IP.
"""
from scapy.fields import *
from scapy.packet import *
from scapy.layers.inet import IP,UDP
class Mo... | Python | 1 |
#!/usr/bin/env python3
import rospy
from sensor_msgs.msg import Imu
import numpy as np
from The_kidnapper_Algorithm import *
from geometry_msgs.msg import Twist
import subprocess
class AnomalyDetector:
def __init__(self):
rospy.init_node('imu_anomaly_detector')
self.First_start=True
self.i... | Python | 1 |
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... | Python | 1 |
the approximated contour and
# use the bounding box to compute the aspect ratio
(x, y, w, h) = cv2.boundingRect(approx)
aspectRatio = w / float(h)
# compute the solidity of the original contour
area = cv2.contourArea(c)
hullArea = cv2.contourArea(... | Python | 1 |
}
#[cfg(any(feature = "v2_30", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
fn connect_accept_language_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_accept_language_trampoline<P: IsA<Session>, F: Fn(&P) + 'static>(th... | Rust | 0 |
""" This class is part of the observer design pattern and is also a singleton.
The purpose of this class is to notify all the followers of a certain user about a new post. """
class FollowersNotifications:
__instance = None
def __init__(self):
if FollowersNotifications.__instance is not None:
... | Python | 1 |
点计算大小后, 如果节点是flex并且是相对定位, 并且grow或shrink不为0, 则会再次计算大小
/// 设脏的情况: 1. 如果节点是绝对定位, 则只设自身脏. 2. 相对定位下, 如果属性是容器值, 则设节点自身脏, 否则设父节点脏. 如果脏节点的size=Auto, 则向上传播脏, 直到父节点为绝对定位或size!=Auto.
/// 计算时, 如果节点为绝对定位, 先检查size=Auto. 如果size=Auto, 则先根据left-right等来确定大小,否则需要根据子节点来计算大小. 如果size!=Auto, 则可能根据父节点大小先计算自身的layout, 然后计算子节点布局.
/// 计算时, 节点为... | Rust | 0 |
lter_shops[0].get('name')}, 店铺ID:{filter_shops[0].get('shopId')},库存:{filter_shops[0].get('inventory')}"
)
return filter_shops[0]["shopId"]
if __name__ == "__main__":
if not DEBUG:
# 判断当前时间是否是星期天的 15:00 到 16:00 期间
now = datetime.datetime.now()
if now.weekday() != 6 or now.hour ... | Python | 1 |
self.entity.weight.data[chunk_begin:chunk_begin + chunk_size].transpose(0, 1)
elif target == 'rel':
cands = self.relation.weight.data[chunk_begin:chunk_begin + chunk_size].transpose(0, 1)
else:
cands = None
return cands
def get_queries(self, queries, target='rhs'):
... | Python | 1 |
sset_name="viewer")
ViewportCameraController(env, viewer)
else:
raise ValueError(
f"Invalid device interface '{args_cli.teleop_device}'. Supported: 'keyboard', 'spacemouse''handtracking'."
)
# add teleoperation key for env reset
should_reset_recording_instance = False
... | Python | 1 |
ted = (&ED25519_BASEPOINT_TABLE * &clamp_scalar(scalar_bytes))
.to_montgomery()
.to_bytes();
assert_eq!(result, expected);
}
}
#[test]
#[cfg(feature = "serde")]
fn serde_bincode_public_key_roundtrip() {
use bincode;
let public_key = ... | Rust | 0 |
EX.128.66.0F3A.W0 26 /r ib`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vgetmantps_xmm_k1z_xmmm128b32_imm8 = 3853,
/// `VGETMANTPS ymm1 {k1}{z}, ymm2/m256/m32bcst, imm8`
///
/// `EVEX.256.66.0F3A.W0 26 /r ib`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vgetmantps_ymm_k1z_ymmm2... | Rust | 0 |
n.len() // reset_token
},
Frame::ACK { largest_ack, ack_delay } => {
1 + // frame type
octets::varint_len(*largest_ack) + // largest_ack
octets::varint_len(*ack_delay) + // ack_delay
... | Rust | 0 |
x = 5
y = input_int()
z = 2
print((y - x) + ((x - z) + (1 + (input_int() - (x + z)))))
| Python | 1 |
progress_bar
}
fn tick_progress_bar_with_filename(progress_bar: &ProgressBar, filename: &str) {
let message = truncate_with_ellipsis_to_length(filename, 21, None);
progress_bar.set_message(message);
progress_bar.tick();
}
fn truncate_with_ellipsis_to_length(
string: &str,
length: usize,
elli... | Rust | 0 |
ample in java.
///
/// A builder for the *uploadapk* method supported by a *internalappsharingartifact* resource.
/// It is not used directly, but through a `InternalappsharingartifactMethods` instance.
///
/// # Example
///
/// Instantiate a resource method builder
///
/// ```test_harness,no_run
/// # extern crate hyp... | Rust | 0 |
for n in range(1, 10000):
r = bin(n)[2:]
if n % 2 == 0:
r = '10' + r
else:
r = '1' + r + '01'
r = int(r, 2)
if n <= 12:
print(r)
| Python | 1 |
# The project automates calls for people from the firebase cloud database and the schedular keeps it running and checks for entries
# every 1 hour using aps scedular
# The project can be used to set 5 min before reminder calls to a set of people for doing a particular job
import os
from firebase_admin import credential... | Python | 1 |
# Code generated by Lark OpenAPI.
import lark_oapi as lark
from lark_oapi.api.contact.v3 import *
def main():
# 创建client
client = lark.Client.builder() \
.app_id(lark.APP_ID) \
.app_secret(lark.APP_SECRET) \
.log_level(lark.LogLevel.DEBUG) \
.build()
# 构造请求对象
request:... | Python | 1 |
_fields: Option<bool> =
ctx.body_json().await.map_err(ResponseError::bad_request)?;
let db = &ctx.state().db;
let settings = Settings {
index_new_fields: Some(index_new_fields),
..Settings::default()
};
let mut writer = db.update_write_txn()?;
let update_id = index.settings... | Rust | 0 |
from __future__ import annotations
import copy
import json
import os.path
import re
from tqdm.auto import tqdm
from .hillclimb import HillClimb
from .profiler import HillClimbProfiler
from ...base import TextFunctionProgramConverter as tfpc, Function
def _get_all_samples_and_scores(path, get_algorithm=False):
... | Python | 1 |
\"maxLength\": {}, \"source\": [",
origin.asn,
origin.prefix.addr(), origin.prefix.prefix_len(),
origin.prefix.resolved_max_len(),
)?;
Self::payload_info(info, "roa", target)?;
write!(target, "] }}")
}
fn intermission(&self, target: &mut W... | Rust | 0 |
/// Deserialize a timestamp in microseconds since the epoch
fn visit_unit<E>(self) -> Result<Option<DateTime<Utc>>, E>
where
E: de::Error,
{
Ok(None)
}
}
#[cfg(test)]
mod tests {
use std::error::Error;
use chrono::{DateTime, TimeZone as _, Utc};
use serde::{Deserializ... | Rust | 0 |
cursion_prevented() {
let first = indoc! {"
#pragma once
#include <second.h>
"};
let second = indoc! {"
#pragma once
#include <first.h>
"};
let hook = source::Mem::builder()
.add_file(&Path::new("first.h"), first.to_string())
.unwrap()
.add_fi... | Rust | 0 |
_XC_B97_GGA1: u32 = 96;
pub const XC_GGA_C_HCTH_A: u32 = 97;
pub const XC_GGA_X_BPCCAC: u32 = 98;
pub const XC_GGA_C_REVTCA: u32 = 99;
pub const XC_GGA_C_TCA: u32 = 100;
pub const XC_GGA_X_PBE: u32 = 101;
pub const XC_GGA_X_PBE_R: u32 = 102;
pub const XC_GGA_X_B86: u32 = 103;
pub const XC_GGA_X_HERMAN: u32 = 104;
pub c... | Rust | 0 |
string(&path)?;
tracing::debug!(path = ?path, data_len = ?data.len());
Ok(toml::from_str(&data)?)
}
}
impl fmt::Display for Sensitive {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", super::mask_key(&self.api_key))
}
}
<reponame>noeddl/ukebox
use std::con... | Rust | 0 |
from overrides import overrides
from airda.agent import DataAgentKey, log
from airda.agent.assistants.assistant_manager import DataAgentAssistantManager
from airda.agent.data_agent_context import DataAgentContext
from airda.agent.llm.data_agent_llm_manager import DataAgentLLMManager
from airda.agent.planner.data_agent... | Python | 1 |
.create()
.expect("Producer creation error");
let consumer: StreamConsumer = ClientConfig::new()
.set("bootstrap.servers", brokers)
.set("session.timeout.ms", "6000")
.set("enable.auto.commit", "false")
.set("group.id", "rust-rdkafka-roundtrip-example")
.create(... | Rust | 0 |
def State(self):
r"""状态
注意:此字段可能返回 null,表示取不到有效值。
:rtype: int
"""
return self._State
@State.setter
def State(self, State):
self._State = State
@property
def User(self):
r"""启动用户
注意:此字段可能返回 null,表示取不到有效值。
:rtype: str
"""
return sel... | Python | 1 |
s_canonical_maps` is false so that
/// we can test re-serialization.
pub fn get_sample_values(has_canonical_maps: bool, has_floats: bool) -> Vec<SerdeData> {
let v0 = SerdeData::PrimitiveTypes(PrimitiveTypes {
f_bool: false,
f_u8: 6,
f_u16: 5,
f_u32: 4,
f_u64: 3,
f_u1... | Rust | 0 |
with col2:
height = st.number_input("**表格高度**", value=web_setting["excel"]["height_user"], min_value=100, max_value=1000, step=100, key="height_user")
with col3:
order_what = st.selectbox("**排序列名**", fields, index=fields.index(web_se... | Python | 1 |
"""
WESML
=====
Example of a logit model with Weighted Exogenous Sample Maximum
Likelihood (WESML).
Michel Bierlaire, EPFL
Wed Jun 18 2025, 11:20:51
"""
from IPython.core.display_functions import display
from biogeme.biogeme import BIOGEME
from biogeme.expressions import Beta
from biogeme.models import loglogit
f... | Python | 1 |
x_frames:
padding_zeros = torch.zeros((
max_frames-frames_tensor.shape[0],
frames_tensor.shape[1],
frames_tensor.shape[2],
frames_tensor.shape[3]
))
frames_tensor = torch.concat(
... | Python | 1 |
from query.create_query import CreatQuery
from prompts.prompt_generator import PromptGenerator
from langchain_core.runnables import RunnablePassthrough
from models.llm_model import llm
from langchain_core.output_parsers import StrOutputParser
from database.db_connection import DatabaseConnection
class CreatResponse(Cr... | Python | 1 |
use crate::graph::mutation::{Consistent, Immediate, Mode, Mutable, Mutation};
use crate::graph::vertex::{Vertex, VertexKey, VertexView};
use crate::graph::GraphError;
use crate::transact::{Bypass, Transact};
type ModalCore<P> = Core<Data<<P as Mode>::Graph>, <P as Mode>::VertexStorage, (), (), ()>;
#[cfg(not(all(nigh... | Rust | 0 |
import cv2 as cv
import numpy as np
import os
from time import time
from windowcapture import WindowCapture
from thresholding import vision
from filter import HSV_FILTER
# Initialize WindowCapture class (example)
wincap = WindowCapture('Clash Royale')
c = cv.imread('crproj\\images\\opps.png', cv.IMREAD_UNCHANGED)
if... | Python | 1 |
from django.urls import include, path
from . import views
urlpatterns = [
path('round/<int:round_seq>/', include([
# Creation/Release
path('',
views.AdminDrawView.as_view(),
name='draw'),
path('create/',
views.CreateDrawView.as_view(),
name=... | Python | 1 |
fn test_day5_part2() {
let vent_lines = Sonar::scan_hydrothermal_vents(
"0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2",
... | Rust | 0 |
ormat: Format::new("CE%sT"), saving: Saving::Multiple("Libya".to_owned()), end_time: Some(ChangeTime::UntilDay (YearSpec::Number(1990), MonthSpec(May), DaySpec::Ordinal( 4))) },
ZoneInfo { offset: 7200, format: Format::new("EET"), saving: Saving::NoSaving, end_time: Some(ChangeTime... | Rust | 0 |
Connection", skip_serializing_if = "Option::is_none")]
pub outbound_connection: Option<String>,
#[serde(rename = "outboundConnectedSince", skip_serializing_if = "Option::is_none")]
pub outbound_connected_since: Option<String>,
}
impl ReplicatorStats {
pub fn new() -> ReplicatorStats {
Replicato... | Rust | 0 |
mean_croattn = layer_croattn.mean(dim=1).squeeze(1).permute(0,2,1)
mean_croattn = mean_croattn.reshape(mean_croattn.shape[:-1]+size)
# tokenIndex 代表不同文字对应的attention map
tokenIndex = 1
compute_croatnn = mean_croattn[:,tokenIndex,:,:].squeeze()
layer_mask = F.... | Python | 1 |
info(
f"🧭 BNBO: Second values range: "
f"{second_range[0]:.2f} to {second_range[1]:.2f}"
)
if (
8 <= first_range[0] <= 15
and 8 <= first_range[1] <= 15
and 54... | Python | 1 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Saga Inc.
# Distributed under the terms of the GPL License.
"""
Contains tests for the VALUE function.
"""
import pytest
import pandas as pd
import numpy as np
from mitosheet.public.v3.sheet_functions.number_functions import VALUE
# Raw function tests
VALUE_VALI... | Python | 1 |
!("initial_state_present", 0, c);
let text = c.find(Locator::Css("p")).await?.text().await?;
// We'll wait for five seconds, then reload the page and expect the content to be different
std::thread::sleep(std::time::Duration::from_secs(5));
c.refresh().await?;
wait_for_checkpoint!("router_entry", 0, ... | Rust | 0 |
Message_MessageLevel")))]
pub fn messageLevel<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::webkit::ConsoleMessage_MessageLevel>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "and... | Rust | 0 |
:White | AccessListMode::Black => {
if let Err(err) = access_list.update_from_path(&config.access_list.path) {
::log::error!("Update access list from path: {:?}", err);
}
}
AccessListMode::Off => {}
}
}
<gh_stars>10-100
// Copyright 2017 click2stream, Inc.
//
... | Rust | 0 |
d
return valid_mask
def _validate_intrinsics(self, scene_path: str, intrinsics: torch.Tensor) -> bool:
"""
Validate intrinsics data
Args:
scene_path: path to the scene for error reporting
intrinsics: camera intrinsics tensor
Returns:
bool... | Python | 1 |
let sql_string = dbg!(self.make_sql_string(migration));
dbg!(self.connection.execute(&sql_string, NO_PARAMS)).unwrap();
}
}
impl SqlDatabaseStepApplier {
fn make_sql_string(&self, migration: BarrelMigration) -> String {
// TODO: this should pattern match on the connector type once we have this ... | Rust | 0 |
EDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef,
0xBAD5EEDdeadbeef... | Rust | 0 |
shared(t)
}
}
impl HttpTryFrom<Parts> for Uri {
type Error = InvalidUriParts;
#[inline]
fn try_from(src: Parts) -> Result<Self, Self::Error> {
Uri::from_parts(src)
}
}
impl<'a> HttpTryFrom<&'a Uri> for Uri {
type Error = ::Error;
#[inline]
fn try_from(src: &'a Uri) -> Result<... | Rust | 0 |
1
// / \
// 0 3
// \ /
// 2
let g = &GraphPair::new(&[(0, 1), (0, 2), (1, 3), (2, 3)]);
let mut r = SemeRegion::empty();
r.add_point(g, NodeIndex::new(3));
assert_contents!(r, g, +[3] -[0, 1, 2]);
// Adding 1 forces us to contain 0, because that is mutual
... | Rust | 0 |
"]
pub type NAVPREVSTATES = i32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const MCNP_NORMAL: NAVPREVSTATES = 1i32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const MCNP_HOT: NAVPREVSTATES = 2i32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const MCNP_PRESSED: NAVPREVS... | Rust | 0 |
import tldextract
import Levenshtein as lv
legitimate_domains = ['test.com', 'microsoft.com', 'google.com']
test_urls = [
'http:test.co',
'https://google.com',
'https://www.facebook.firewall-update.com',
'http://facebOOK.com/login',
'http://test.com'
]
def extract_domain_parts(url):
extracted... | Python | 1 |
licy(efs_stubber):
efs_stubber.add_response("describe_file_systems", describe_file_systems)
efs_stubber.add_client_error("describe_file_system_policy", 'FileSystemNotFound')
results = efs_filesys_policy_check(
cache={}, awsAccountId="012345678901", awsRegion="us-east-1", awsPartition="aws"
)
... | Python | 1 |
_y_mark) in enumerate(vali_loader):
pred, true = self._process_one_batch(
vali_data, batch_x, batch_y, batch_x_mark, batch_y_mark)
loss = criterion(pred.detach().cpu(), true.detach().cpu())
total_loss.append(loss)
total_loss = np.average(total_loss)
se... | Python | 1 |
# Standard Library
import copy
import random
from pathlib import Path
from typing import Optional
# Third-Party Library
import numpy as np
# Torch Library
import torch
import torch.utils.data as data
# My Library
from .frame import get_frame_reader
from utils.color import error, red
from utils.io import load_json, ... | Python | 1 |
se with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO ... | Rust | 0 |
Arc::clone(&self.material),
(u, v),
))
}
fn bounding_box(&self, _time0: f64, _time1: f64) -> Option<AABB> {
Some(AABB {
minimum: Point3::new(self.k - 0.0001, self.y0, self.z0),
maximum: Point3::new(self.k + 0.0001, self.y1, self.z1),
})
}
f... | Rust | 0 |
from rest_framework.exceptions import ValidationError
from rest_framework.serializers import ModelSerializer
from apps.models import Category
class CategoryModelSerializer(ModelSerializer):
class Meta:
model = Category
exclude = 'slug',
def validate(self, attrs):
if len(attrs['name'... | Python | 1 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# 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 appli... | Python | 1 |
underlying keypair.
#[error("{0:?}")]
KeypairError(KeyPairError),
/// Error occurred in the underlying AEAD cipher.
#[error("{0:?}")]
AeadError(AeadError),
/// Error occured in the underlying signature.
#[error("{0:?}")]
SignatureError(SignatureError),
/// Storge related errors.
... | Rust | 0 |
DICE_RE: Regex = Regex::new("^(-?)([0-9]+)d([0-9]+)$").unwrap();
}
lazy_static! {
static ref MODIFIER_RE: Regex = Regex::new("^(-?)([0-9]+)$").unwrap();
}
impl FromStr for DamagePart {
type Err = ParseError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
if let Some(cap) = DICE_RE.captures(s) ... | Rust | 0 |
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# setup oblique mercator basemap.
# width is width of map projection region in km (xmax-xmin_
# height is height of map projection region in km (ymax-ymin)
# lon_0, lat_0 are the central longitude and latitude of the projection.... | Python | 1 |
in &constants::SPECIAL_CHARS {
// if args.flag_char.contains(&ch.to_string()) {
// pass_base += &ch.to_string();
// }
// }
// FIXME: using get_params (length)
// let length: i32 = if args.flag_length > 0 {
// args.flag_length
// } else {
// constants::DEFAULT... | Rust | 0 |
_LocalCredenitalInfo = *mut SecPkgContext_LocalCredentialInfo;
pub const LCRED_STATUS_NOCRED: DWORD = 0x00000000;
pub const LCRED_CRED_EXISTS: DWORD = 0x00000001;
pub const LCRED_STATUS_UNKNOWN_ISSUER: DWORD = 0x00000002;
STRUCT!{struct SecPkgContext_ClientCertPolicyResult {
dwPolicyResult: HRESULT,
guidPolicyI... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.