text string | label_name string | labels int64 |
|---|---|---|
elatedLog
@IsRelatedLog.setter
def IsRelatedLog(self, IsRelatedLog):
self._IsRelatedLog = IsRelatedLog
@property
def LogTopicID(self):
"""日志主题ID
:rtype: str
"""
return self._LogTopicID
@LogTopicID.setter
def LogTopicID(self, LogTopicID):
self._L... | Python | 1 |
eceivedACK.contains_key(&ackCount) {
receivedACK.insert(ackCount, 1);
} else {
// the key exists
if let Some(x) = receivedACK.get_mut(&ackCount) {
*x += 1;
... | Rust | 0 |
c64', 'x86_64'):
machine = 'fat64'
elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'):
machine = 'universal'
else:
raise ValueError(
"Don't know machine value for archs=%r" % (archs,))
elif machine == 'i386':
#... | Python | 1 |
le name from path for cleaner display
file_name = path.split("/")[-1]
# Show tags if present
tags_str = ""
if hasattr(test_def, "tags") and test_def.tags:
tags_str = f" [tags: {', '.join(test_def.tags)}]"
print(f"{i}) {file_name}{tags_str}")
print("=" * 70)
r... | Python | 1 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorboard/plugins/histogram/plugin_data.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pr... | Python | 1 |
fmt::Debug + std::error::Error;
/// Decode a instruction
fn decode(&mut self) -> Option<Result<Self::Instruction, Self::Error>>;
/// Turn this decoder into a [`Iterator`] yielding `Result<Self::Instruction, Self::Error>`
fn into_iter(self) -> Iter<Self>
where
Self: ... | Rust | 0 |
from openai import OpenAI
from tqdm import tqdm
import json
with open("extraction_annoted.json", mode='r', encoding='utf-8') as f:
data = json.load(f)
with open("LFP_claude_evi2.json", mode='r', encoding='utf-8') as f:
data1 = json.load(f)
with open("extraction_evidence_washed2.json", mode='r', encoding='utf... | Python | 1 |
= 5, y = 220)
Button(f1, text='score', command=lambda:raise_frame(f0), fg="blue", relief="solid").place(x = 280, y = 220)
Button(f2, text='score', command=lambda:raise_frame(f0), fg="blue", relief="solid").place(x = 280, y = 220)
Button(f3, text='score', command=lambda:raise_frame(f0), fg="blue", relief="solid").place... | Python | 1 |
}
#![feature(c_unwind)]
#![feature(exclusive_range_pattern)]
#[macro_use] extern crate gmod;
use std::process::Command;
use std::process::Stdio;
use std::borrow::Cow;
use chad_cell::ChadCell;
use sysinfo::{SystemExt, ProcessExt};
mod chad_cell; // 😎
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "windows")... | Rust | 0 |
::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [pofcon](pofcon) module"]
pub type POFCON = crate::Reg<u32, _POFCON>;
#[allow(missing_do... | Rust | 0 |
sSource: Randomness<Self::Hash>;
type Currency: Currency<Self::AccountId>;
type NFT: NFTInterface<Self::Hash, Self::AccountId>;
}
decl_storage! {
trait Store for Module<T: Config> as NFTDAOModule {
/// A self-increasing number used to create a dao account.
Nonce get(fn get_nonce): u128;
... | Rust | 0 |
unwrap();
let threshold = 5000;
assert!((remote_now - local_millis) < threshold);
// Now once should return some number and the remote server offset should be set in the
// NOW_OFFSET_MILLIS once cell.
let _: u64 = super::now_once(Some(url2::url2!(
"{}",
... | Rust | 0 |
emit_signal(&())?;
Ok(())
}
#[adk_extern]
fn signal_others(signal: RemoteSignal) -> ExternResult<()> {
remote_signal(&signal.signal, signal.agents)
}
#[adk_extern]
fn recv_remote_signal(signal: ExternIO) -> ExternResult<()> {
ADK.with(|h| h.borrow().emit_signal(AppSignal::new(signal)))
}
#[adk_exter... | Rust | 0 |
// limitations under the License.
//
// MIT
// 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, pub... | Rust | 0 |
// that the page desired is for a copy of the
// object, and the memory manager has detected
// the page was pushed into a copy of the object
// while the kernel was walking the shadow chain
// from the copy to the object. This error code
// is delivered via memory_object_data_error
// and is handled by the kernel (it ... | Rust | 0 |
YYY",
" WHERE YYY.energy > 400 ;"
],
*/
vec![
"SELECT category.* FROM category ",
"WHERE categoryid > 40 ",
"order BY 1;",
],
vec![
"SELECT * FROM recipe ",
"WHERE maketime > 100 ",
"order BY 1;",
],
vec![
"SELECT * FROM recip... | Rust | 0 |
# processador_documentos.py
import os
import streamlit as st
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.document_loaders import PyPDFLoader
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
from dotenv import load_dotenv
# ... | Python | 1 |
},
},
Err(_) => {
// Application code returned an error. This should not happen, as the implementation should
// return a valid response.
Err(Response::with((status::InternalServerErro... | Rust | 0 |
r corner in self.car.car_vertices:
if not self.check_boundary(xy1, xy3, corner):
return False
return True
def check_collision(self) -> bool:
"""
Determines whether the car has collided with any static obstacles.
The function iterates through all static p... | Python | 1 |
.description)?;
description as *const c_char
} {
ptr::null_to::<c_char>()
}
}
ffi_fn! {
/// Write the `description` field on the `SynchronousMessage`.
///
/// # Safety
///
/// `description` must contain valid UTF-8. Invalid UTF-8
/// will be replaced with U+FFFD REPLACEM... | Rust | 0 |
pub(crate) fn decode_syspacket<T: SystemPacket>(bytes: &[u8]) -> std::io::Result<T> {
let mut reader = CursorReader::new(bytes);
if u8::decode(&mut reader)? != T::ID {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidData,
"Wrong ID".to_string(),
));
}
... | Rust | 0 |
import asyncio
import logging
from collections.abc import AsyncGenerator
import slimrpc
from slimrpc.examples.simple.types.example_pb2 import ExampleRequest
from slimrpc.examples.simple.types.example_pb2_slimrpc import TestStub
logger = logging.getLogger(__name__)
async def amain() -> None:
channel_factory = sl... | Python | 1 |
for x in range(500):
num = 7**666 + 7**333 + 49**x - 343
res = ''
while num:
res += str(num%7)
num //= 7
if res.count('6')==49:
print(x)
break
| Python | 1 |
},
hattrs.dump_display,
)
}
fn derive_display_for_enum(input: &DeriveInput, data: &DataEnum) -> Result<TokenStream> {
fn make_arm(
input: &DeriveInput,
hattrs_enum: &HelperAttributes,
variant: &Variant,
bounds: &mut Bounds,
generics: &GenericParamSet,
) ... | Rust | 0 |
w(clippy::useless_conversion)]
smithy_types::Number::NegInt((input.port).into()),
);
}
if let Some(var_1774) = &input.port_name {
object.key("PortName").string(var_1774);
}
}
pub fn serialize_structure_crate_model_action_local_port_details(
object: &mut smithy_json::serializ... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 10 12:22:40 2024
@author: suraj
"""
#write the the numpy program to get the minimum and maxmimum value accross the axix
import numpy as np
x = np.arange(4).reshape((2,2))
print("Original value/array:")
print(x)
print("\n maximum value along the second axis:")
print(np.a... | Python | 1 |
}
}
}
}
Ok(builder.finish())
}
/// Count all successive non-overlapping regex matches.
fn count_match(&self, pat: &str) -> Result<UInt32Chunked> {
let ca = self.as_utf8();
let reg = Regex::new(pat)?;
let mut out: UInt... | Rust | 0 |
rival/departure.
Input
------
angles : [batch size, num of BSs, num of UTs, maximum number of clusters, number of rays], tf.float
Angles to shuffle
Output
-------
shuffled_angles : [batch size, num of BSs, num of UTs, maximum number of clusters, number of ra... | Python | 1 |
ball.direction_up = false,
4 => self.ball.direction_right = false,
_ => (),
}
} else {
count += 1
}
}
}
if count == 0 {
... | Rust | 0 |
raftlog::cluster::{ClusterConfig, ClusterMembers};
use raftlog::election::Role;
use raftlog::log::{LogEntry, LogIndex, LogPosition};
use raftlog::{self, ReplicatedLog};
use slog::Logger;
use std::collections::VecDeque;
use std::env;
use std::ops::Range;
use std::time::{Duration, Instant};
use trackable::error::ErrorKi... | Rust | 0 |
.join(undistorted_images_path, 'Cam' + str(cam_index), image_name)
img_undistorted = get_undistorted_image(image_path, undistorted_image_path, cam_index)
if img_undistorted is None:
continue
points_im, cam_mask = project_points_to_image(xyz, T_body_to_cam[cam_index], cam_projection[cam_index], [0, 0, im_... | Python | 1 |
# coding: utf-8
"""
codebeamer swagger API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 3.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # no... | Python | 1 |
r(b"NSObject", b"title", {"required": False, "retval": {"type": b"@"}})
r(
b"NSValue",
b"MKCoordinateSpanValue",
{"retval": {"type": b"{MKCoordinateSpan=dd}"}},
)
r(
b"NSValue",
b"MKCoordinateValue",
{"retval": {"type": b"{CLLocationCoordinate2D=dd}"}},
... | Python | 1 |
as *const [u16] as *const c_void,
data.len(),
usage,
)
}
}
// The raw external bindings to Javascript
mod imported {
use super::*;
extern "C" {
pub fn setup_canvas();
// pub fn create_shader(source: *const c_void, source_length: usize);
pub fn cre... | Rust | 0 |
; stp x26, x27, [sp, #-0x10]!
; stp x28, x29, [sp, #-0x10]!
; stp x30, xzr, [sp, #-0x10]!
; .dword 0xd53b4218u32 as i32 // mrs x24, nzcv
// jump to rust based population of the lists
; mov x2, x0
; adr x3, >done
... | Rust | 0 |
reate material volumes with unique keys for each layer
material_volumes = {}
# If we have only one material and no layer information, try to get width from element dimensions
if len(material_layers) == 1 and "width" not in material_layers[0]:
from app.services.ifc.quantities... | Python | 1 |
)?;
let body = this.build_block(&span, body)?;
ast::Label {args, variant, body: Spanned {span, k: body}}
}))
}).collect::<Result<_>>()?;
Ok((group, jumps))
}
fn build_lassoc1(&mut self, span: &FileSpan, args: Vec<LispVal>, op: Binop) -> Result<Option<ast::Expr>> {
let mut it = arg... | Rust | 0 |
line == "clear_board" {
Ok((id, Command::ClearBoard))
} else if let Some(caps) = KOMI.captures(line) {
let komi = caps[1].parse::<f32>().map_err(|_| "syntax error")?;
Ok((id, Command::Komi(komi)))
} else if let Some(caps) = PLAY.captures(line) {
let colo... | Rust | 0 |
hresh = cv2.threshold(blur, threshold, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
# kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (7, 7))
# dilate = cv2.dilate(thresh, kernel, iterations=1)
#
# # Find contours, obtain bounding box coordinates, and extract ROI
# ... | Python | 1 |
usize,
concat!("Alignment of ", stringify!(rdma_cm_join_mc_attr_ex))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<rdma_cm_join_mc_attr_ex>())).comp_mask as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(rdma_cm_... | Rust | 0 |
d current_silo_mode != SiloMode.REGION:
raise MismatchedSiloTransactionError(
f"Cannot use transaction.atomic({using}) except in Region Mode"
)
def patch_silo_aware_atomic() -> None:
global _default_on_commit, _default_get_connection, _default_atomic_impl
_default_atomic_impl = tr... | Python | 1 |
metrics straight away to check the process startup time.
self.write_metrics();
}
fn write_metrics(&mut self) {
if let Err(e) = METRICS.write() {
METRICS.logger.missed_metrics_count.inc();
error!("Failed to write metrics: {}", e);
}
#[cfg(test)]
{... | Rust | 0 |
b LsC\x0e\x9c\xdc\xa6\x89\xa0\x94F\xb9\x16\x1f\
\x05C\xc1\xb0\x05)s\x22\x91\xf5\x8d\xf4\xbe\xd4\xa0\xa4\
\xa3\xa1F\xe8Z\x83V\x0ao\xd2\xc3t\xa9,\x89&\
c\x185V\x09\xbb\xb4a\xb3%\xb1\x18\xb4\xc6\xfb\xb4\
\x0a0\x02C\x9f\x94\xa1]\xa5\xa8\xa66\xac\x10%Q\
\xc2\xa2\xa0\x0d\x1c\xde?I\x17\xb2\x0f\x8c\xb65EG\
\xa1lC#`b\x8a\x22\x8... | Python | 1 |
")]
pub mab_server_name: Option<String>,
#[serde(rename = "mabServerType", default, skip_serializing_if = "Option::is_none")]
pub mab_server_type: Option<mab_job::MabServerType>,
#[serde(rename = "workloadType", default, skip_serializing_if = "Option::is_none")]
pub workload_type: Option<mab_job::Wo... | Rust | 0 |
GPIOTE1_NS {
type Target = gpiote0_s::RegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*GPIOTE1_NS::ptr() }
}
}
#[doc = "MUTEX 0"]
pub struct MUTEX_NS {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for MUTEX_NS {}
impl MUTEX_NS {
#[doc = r"Returns a pointer to the register... | Rust | 0 |
c.info.balance, was_dirty)
} else {
let was_clean = matches!(acc.filth, Filth::Clean);
let mut changelog = DirtyChangeLog {
info: acc.info.clone(),
dirty_storage: Map::new(),
was_clean,
... | Rust | 0 |
''".to_string()));
}
#[test]
fn bytea_conn() {
let conn = crate::test::new_conn();
assert_eq!(
crate::escape::bytea_conn(&conn, b"\0").unwrap().as_ref(),
b"\\x00\0"
);
}
#[test]
fn bytea() {
#![allow(deprecated)]
assert_eq!(
... | Rust | 0 |
mut console_mode: u32 = 0;
if 0 == GetConsoleMode(console_handle, &mut console_mode) {
return Err(GetLastError());
}
// VT processing not already enabled?
if console_mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0 {
// https://docs.microsoft.com/en-us/windows/con... | Rust | 0 |
#ArunSanyal_9523_BatchA
#SolvingWaterJugProblemUsingBFS
from collections import deque
def water_jug_bfs(capacity_jug1, capacity_jug2, target):
visited_states = set()
queue = deque([(0, 0, "Initial State")]) # Initial state: both jugs are empty
visited_states.add((0, 0))
parent = {} # Dictionary to k... | Python | 1 |
# Databricks notebook source
#Database credentials & details - for use with Spark scala for writing
#Secrets
jdbcUsername = dbutils.secrets.get(scope = "gws-sql-db", key = "username")
jdbcPassword = dbutils.secrets.get(scope = "gws-sql-db", key = "password")
#JDBC driver class & connection properties
driverClass = "c... | Python | 1 |
= Title(EN).fake();
println!("{:?}", val);
let val: String = Suffix(EN).fake();
println!("{:?}", val);
let val: String = Name(EN).fake();
println!("{:?}", val);
let val: String = NameWithTitle(EN).fake();
println!("{:?}", val);
let val: String = Name(ZH_TW).fake();
println!("{:?... | Rust | 0 |
td::sync::Arc;
#[macro_use]
mod macros;
#[macro_use]
mod tasks;
mod commands;
mod completion;
mod core;
mod errors;
mod fs;
mod git;
mod online;
mod search;
mod update;
#[cfg(test)]
mod test;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let logger = sentry::integration... | Rust | 0 |
e);
let graceful = server.with_graceful_shutdown(async {
// Treat notification failure the same as a notification.
let _ = notify_receiver.await;
});
info!(
"{:?}: Started metrics server on port {:?}",
std::thread::current().id(),
port
);
// Run until asked t... | Rust | 0 |
from typing import TYPE_CHECKING, Literal
from uaproject_backend_schemas.models.punishment import Punishment
from uaproject_backend_schemas.models.schemas.punishment import PunishmentStatus
from uap_backend.cruds.base import BaseCRUD
if TYPE_CHECKING:
from uaproject_backend_schemas.models.punishment import (
... | Python | 1 |
d static interconnector export limit, averaged across iterations and reference years
pub calculatedexportlimit: Option<rust_decimal::Decimal>,
/// Calculated Interconnector limit of importing energy on the basis of invoked constraints and static interconnector import limit, averaged across iterations and refere... | Rust | 0 |
= bpy.props.FloatProperty(
name="", default=0, min=0, max=1, update=step_progress_update
)
bpy.types.Scene.is_model_loaded = bpy.props.BoolProperty(
name="Model Loaded", default=False
)
bpy.types.Scene.is_model_loading = bpy.props.BoolProperty(
name="Is model loading", default=Fa... | Python | 1 |
from flask import Flask
from flask_restx import Api
from app import routes
from app.utils import arl_update
arl_app = Flask(__name__)
arl_app.config['BUNDLE_ERRORS'] = True
authorizations = {
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "Token"
}
}
api = Api(arl_app, pre... | Python | 1 |
16,
pub glyph_info: *mut FixedPoint,
}
impl NodeLayout {
pub(crate) unsafe fn write_node(&self, node: &mut NativeWord) {
let NodeLayout {
lsDelta,
width,
total_glyph_count,
glyph_info,
} = *self;
node.set_width(width + lsDelta.unwrap_or(S... | Rust | 0 |
if not fn.exists(): # load npy
np.save(fn.as_posix(), cv2.imread(f))
im = np.load(fn)
else: # read image
im = cv2.imread(f) # BGR
if self.album_transforms:
sample = self.album_transforms(image=cv2.cvtColor(im, cv2.COLOR_BGR2RGB))["image"]
... | Python | 1 |
#!/usr/bin/env python
#***********************************************************
#* Software License Agreement (BSD License)
#*
#* Copyright (c) 2009, Willow Garage, Inc.
#* All rights reserved.
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that ... | Python | 1 |
nput);
assert_eq!(vec![uri], uris);
}
}
<reponame>freenet/locutus
use locutus_node::SqlitePool;
use locutus_runtime::StateStore;
use tracing::metadata::LevelFilter;
use tracing_subscriber::util::SubscriberInitExt;
type DynError = Box<dyn std::error::Error + Send + Sync + 'static>;
const MAX_SIZE: i64 = 10... | Rust | 0 |
nished', models.DateTimeField(null=True, db_index=True)),
('errored', models.DateTimeField(null=True)),
('event', models.ForeignKey(to='main.Event')),
],
options={
},
bases=(models.Model,),
),
migrations.AddField(
... | Python | 1 |
import cv2
import numpy as np
import pickle
def build_squares(img):
x, y, w, h = 420, 140, 10, 10
d = 10
imgCrop = None
crop = None
for i in range(10):
for j in range(5):
if np.any(imgCrop == None):
imgCrop = img[y:y+h, x:x+w]
else:
imgCrop = np.hstack((imgCrop, img[y:y+h, x:x+w]))
#print(imgCr... | Python | 1 |
stores with a base path of `base_path` and appended by
/// `plane_name`.
fn path_for<B, P>(base_path: &B, plane_name: &P) -> PathBuf
where
B: AsRef<OsStr> + ?Sized,
P: AsRef<OsStr> + ?Sized,
{
Path::new(base_path)
.join(STORE_DIR)
.join(PLANES_DIR)
.join(plane_name.as_ref())
}
/// ... | Rust | 0 |
patents_md = "\n\n".join(patents_md)
# Create markdown for images
images_md = "\n\n".join([f"![Image {img['id']}]({img['path']})\n\n{img['description']}" for img in images])
# Create markdown for flowcharts
flowcharts_md = "\n\n".join([f"![Flowchart {fc['id']}]({fc['path']})\n\n{fc['descrip... | Python | 1 |
.private_key.rsa().unwrap();
rsa.public_key_to_der_pkcs1().unwrap()
}
pub fn to_traditional_pem_public_key(&self) -> Vec<u8> {
let rsa = self.private_key.rsa().unwrap();
rsa.public_key_to_pem_pkcs1().unwrap()
}
fn to_jwk(&self, private: bool, _public: bool) -> Jwk {
let... | Rust | 0 |
Ix2};
pub use crate::monoid::{Max, Min, Monoid, Product, Sum};
pub use crate::range::RangeExt;
pub use crate::segment_tree::SegmentTree;
<reponame>kyledewy/ethers-rs
#![cfg(feature = "abigen")]
//! Test cases to validate the `abigen!` macro
use ethers_contract::{abigen, EthEvent};
use ethers_core::abi::{Address, Token... | Rust | 0 |
from datasets import Dataset
def load_seq2seq_data(src_path, tgt_path, max_samples=None):
# 1. load data
with open(src_path, "r") as src_f, open(tgt_path, "r") as tgt_f:
src_txt = [line.rstrip() for line in src_f.readlines()]
tgt_txt = [line.rstrip() for line in tgt_f.readlines()]
max_sam... | Python | 1 |
put = gh.split_into_patches2d(out_put, patch_size=128)
out_pic = output.cpu().detach().numpy()[0].transpose(1,2,0)[..., 0:3]
cond_name = image_folder + f'/test_output_{i}.jpg'
Image.fromarray((np.clip(out_pic,0,1) * 255).astype(np.uint8)).save(cond_name)
... | Python | 1 |
#[track_caller]
#[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetRayTracingShaderGroupHandlesNV.html) · Function"]
#[doc(alias = "vkGetRayTracingShaderGroupHandlesNV")]
pub unsafe fn get_ray_tracing_shader_group_handles_nv(&self, pipeline: crate::v... | Rust | 0 |
{signal, SignalKind};
// let term_signal = signal(SignalKind::terminate())
// .expect("Failed installing TERM signal handler");
// let int_signal = signal(SignalKind::interrupt())
// .expect("Failed installing INT signal handler");
// // https://docs.rs/tokio/0.2.16/tokio/stream/trait.Stream... | Rust | 0 |
2MODP: [Chunk; NLEN] = [
0xFE000000010000,
0xFFFFFF,
0x2,
0xFFFFFFFE00,
0x1000000020000,
0x0,
0x0,
];
pub const MCONST: Chunk = 0x100000001;
// nist384 Curve
pub const CURVE_COF_I: isize = 1;
pub const CURVE_A: isize = -3;
pub const CURVE_B_I: isize = 0;
pub const CURVE_COF: [Chunk; NLEN] =... | Rust | 0 |
Ok(Some(hold)) => {
match hold.get("hash") {
Some(hash_value) => {
let flow_hash = get_current_step_hash(&data.context, bot)?;
// cleanup the current hold and restart flow
if flow_hash != *hash_value {
dat... | Rust | 0 |
,// VEX_KNC_Tzcnt_r64_r64
0x44F2_00BC,// VEX_KNC_Tzcnti_r32_r32
0x4472_00BC,// VEX_KNC_Tzcnti_r64_r64
0x44E2_00BD,// VEX_KNC_Lzcnt_r32_r32
0x4462_00BD,// VEX_KNC_Lzcnt_r64_r64
0x4424_00F0,// VEX_KNC_Undoc_r32_rm32_128_F3_0F38_W0_F0
0x4464_00F0,// VEX_KNC_Undoc_r64_rm64_128_F3_0F38_W1_F0
0x4434_00F0,// VEX_KNC_Un... | Rust | 0 |
_name[:space_idx]
chapter_info = self.get_data(series_name) or {"item_id": event_info.item_id,
"intro_end": 0,
"credits_start": 0}
# 当前播放时间(s)在[开始,begin_min]之间,且是暂停播放后,恢复播放的动作,标记片头... | Python | 1 |
raise exceptions.ParamsError(err_msg)
elif sub_query in ["days", "seconds", "microseconds"]:
return getattr(self.elapsed, sub_query)
elif sub_query == "total_seconds":
return self.elapsed.total_seconds()
else:
err_msg = "{} is no... | Python | 1 |
, interner: &I) -> Ty<I> {
TyData::<I>::InferenceVar(self).intern(interner)
}
pub fn to_lifetime<I: Interner>(self, interner: &I) -> Lifetime<I> {
LifetimeData::<I>::InferenceVar(self).intern(interner)
}
}
/// for<'a...'z> X -- all binders are instantiated at once,
/// and we use deBruijn ... | Rust | 0 |
if train_dr is None or len(train_dr)<2:
results_list.append({**combo_params, "train_score": np.nan, "test_score": np.nan})
continue
# compute train score
train_score = score_fn({"strategy_returns": train_dr})
# We'll not do test backtest fo... | Python | 1 |
"""Use case for loading history of runs."""
from jupiter.core.domain.concept.schedule.schedule_domain import ScheduleDomain
from jupiter.core.domain.concept.schedule.schedule_external_sync_log import (
ScheduleExternalSyncLog,
)
from jupiter.core.domain.concept.schedule.schedule_external_sync_log_entry import (
... | Python | 1 |
let docker = Docker::connect_with_local_defaults()?;
self.start_container_with_docker(docker).await
}
async fn start_container_with_docker(
&self,
docker: Docker,
) -> Result<Self::ContainerType, TestcontainerError> {
self.on_pull_image(&docker).await?;
self.on_be... | Rust | 0 |
from __future__ import annotations
import logging
from typing import ClassVar
from dl_constants.enums import (
DataSourceType,
JoinType,
)
from dl_core.data_source.sql import (
BaseSQLDataSource,
StandardSQLDataSource,
SubselectDataSource,
)
from dl_connector_mysql.core.constants import (
CON... | Python | 1 |
------------------------------------------
def generic_volume_serializer(parent, actor, actor_id, context, depth):
# This kind of actor has two "children" of interest, a property and a
# mapper
actor_visibility = actor.GetVisibility()
mapper_instance = None
property_instance = None
calls = []
... | Python | 1 |
:
bpy.utils.register_class(cls)
wm = bpy.context.window_manager
if wm.keyconfigs.addon:
# ProportionalEditObj
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode')
kmi = km.keymap_items.new('wm.call_menu_pie', 'O', 'PRESS')
kmi.properties.name = "pie.proportional_obj"... | Python | 1 |
t]
fn killed_node_rejoins() {
let (mut nodes_map, removed_node, last_leader) =
wait_for_leader_kill_leader_and_wait_for_next_leader_impl(20050);
let (nodes, _) = create_nodes(5, 20050);
let (removed_node, listen_port) = create_node(removed_node, 20050);
// just recreate the killed node
let ... | Rust | 0 |
_RENEWAL_PERIOD,
"offline_lease": True,
"prompts": None,
"sync_timestamp": cur_time.isoformat(),
}
Lease.renew(db, entity, expires, cur_time)
return JSONr(response)
# venv/lib/python3.9/site-packages/nls_services_lease/test/test_lease_single_controller.py
@app.delete('/leasing/v1... | Python | 1 |
,
min_size=0,
max_size=1000,
average_size=100,
)
count = 0
while many.more():
count += 1
many.reject()
assert count <= 100
def test_rejection_eventually_terminates_many_invalid_for_min_size():
data = ConjectureData.for_choices((True,) * 1000)
many = cu... | Python | 1 |
self.variant(FTM3OCH1SRCW::_1)
}
#[doc = r" Sets the field bit"]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r" Clears the field bit"]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub ... | Rust | 0 |
ge_json))
def get_unread_messages_count(self, user_id):
response = requests.get(f'http://{adress_ip}:8000/count_unread_messages_from_user?id_sender={user_id}&id_receiver={self.cur_user_id}')
if response.status_code == 200:
return response.json()
else:
return ... | Python | 1 |
#
# File : vsc.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
#
# This program 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 2 of the ... | Python | 1 |
import pandas as pd
import matplotlib.pyplot as pt
import numpy as np
import colorama as color
#declarando os dados
atendimento = pd.read_csv('dados/atendimento.csv')
vendas = pd.read_csv('dados/vendas.csv')
#criação das funções
def valor_total():
print(f'\nValor total de vendas: {color.Fore.LIGHTGREEN_EX}{venda... | Python | 1 |
max_results=4,
result_callback=mock.MagicMock(),
)
with _ImageClassifier.create_from_options(options) as classifier:
classifier.classify_async(self.test_image, 100)
with self.assertRaisesRegex(
ValueError, r'Input timestamp must be monotonically increasing'
):
... | Python | 1 |
atches();
if let ("combine", Some( sub_matches ) ) = matches.subcommand() {
let output = sub_matches.value_of("output").unwrap_or("output-atlas-%d").to_string();
let size = sub_matches.value_of("size").unwrap_or("2048").to_string();
let border = sub_matches.value_of("border").unwrap_or("0").to_string();
let... | Rust | 0 |
# Copyright 2017 Bo Shao. 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 applicable law or agre... | Python | 1 |
ce ID (default: 0)')
parser.add_argument('--w_o_think', action='store_false', help='Disable think mode (default: True)')
args = parser.parse_args()
os.environ["CUDA_VISIBLE_DEVICES"] = args.gpu
# torch.cuda.set_device(0)
# Load model
model = AutoModel.from_pretrained(
args.model_path,
... | Python | 1 |
on total sequence size.
Common pattern used in multiple modules to filter out small bins.
Args:
cluster_contig_dict: Dictionary mapping cluster IDs to sets of contig headers
fragments_dict: Dictionary containing fragment sequences
min_size: Minimum total sequence size for a clu... | Python | 1 |
` of `MultiAsset`s. There may be no duplicate fungible items in here and when decoding, they must be sorted.
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Encode, TypeInfo)]
pub struct MultiAssets(Vec<MultiAsset>);
impl Decode for MultiAssets {
fn decode<I: codec::Input>(input: &mut I) -> Result<Self, parity... | Rust | 0 |
from odoo import fields, models,api
class Partner(models.Model):
_inherit = "res.partner"
# company_id=fields.Many2one("res.company",compute="_company_id",store=True)
#
# @api.depends('email','mobile')
# def _company_id(self):
# for rec in self:
# company=self.env["res.company... | Python | 1 |
class ResiduePatch():
"""
Parse pisite files to dict
Attributes
----------
ids : list
residue ids
file: str
pdb file
dssp: dict
dssp dict
dssp_dict_keys: dict
dssp dict keys
"""
def __init__(self, ids, dssp, dssp_dict_keys):
self.ids = id... | Python | 1 |
def __init__(self, host_port_tuple, streamhandler):
super().__init__(host_port_tuple, streamhandler)
self.rwlock = RWLock()
self.protocol_version = "HTTP/1.1"
#Initialize in memory DB
init_order(csv_file, order)
self.follower_addresses = []
self.raft_instance =... | Python | 1 |
atter_row(indices_sorted, eids, indices)
indices_sorted_np = np.zeros(len(indices), dtype=A_csc.indices.dtype)
indices_sorted_np[A_csc.data] = A_csc.indices
assert np.array_equal(F.asnumpy(indices_sorted), indices_sorted_np)
def _test_forking_pickler_entry(g, q):
q.put(g.formats())
@unit... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.