text string | label_name string | labels int64 |
|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Windows 포터블 실행 파일 빌드 스크립트
"""
import os
import sys
import subprocess
import shutil
from pathlib import Path
# Windows에서 UTF-8 출력 설정
if sys.platform.startswith('win'):
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach())
sys.stderr = c... | Python | 1 |
import os
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
import pandas as pd
from scipy import signal
from scipy.signal import butter, filtfilt
from sklearn.preprocessing import StandardScaler
np.random.s... | Python | 1 |
from typing import List
# Time: O(n)
# Space: O(1)
class Solution:
def minSubArrayLen(self, target: int, nums: List[int]) -> int:
l = 0 # Left pointer of the sliding window
total = 0 # Variable to keep track of the sum of the current window
res = float('inf') # Initialize result w... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, fields, models
class HrPayslipRun(models.Model):
_inherit = 'hr.payslip.run'
l10n_hk_autopay = fields.Boolean(related='company_id.l10n_hk_autopay')
l10n_hk_autopay_export_first_batch = fields.Binary(string="HS... | Python | 1 |
import os
import signal
import subprocess
import sys
import time
import unittest
class SIGUSR1Exception(Exception):
pass
class InterProcessSignalTests(unittest.TestCase):
def setUp(self):
self.got_signals = {'SIGHUP': 0, 'SIGUSR1': 0, 'SIGALRM': 0}
def sighup_handler(self, signum, frame):
... | Python | 1 |
import librosa
import numpy as np
def stft(y, sr, n_fft=400, hop_t=0.010, win_t=0.025, window="hamming",
preemphasis=0.97):
"""
Short time Fourier Transform
Args:
y(np.ndarray): raw waveform of shape (T,)
sr(int): sample rate
hop_t(float): spacing (in second) between consec... | Python | 1 |
ssert SwanLabConfig.revert_config(config) == expected
def test_revert_config_handles_missing_sort_field():
config = {
"key1": {"value": "val1", "desc": "description1"},
"key2": {"value": "val2", "desc": "description2", "sort": 1},
}
expected = {"key1": "val1", "key2": "val2"}
assert Sw... | Python | 1 |
"""
Computer abstraction for OpenAI Computer-Using Agent.
This defines the interface for interacting with a computer environment.
"""
from abc import ABC, abstractmethod
from typing import Dict, List, Optional, Tuple, Union
from PIL import Image
class Computer(ABC):
"""Base class for computer environments."""
... | Python | 1 |
else:
self.smb_header.MID += 1
# SMB2
if SMB2_IOCTL_Request in pkt and pkt.CtlCode == 0x00140204:
# FSCTL_VALIDATE_NEGOTIATE_INFO
# This is a security measure asking the server to validate
# what flags were negotiated during the SMBNego... | Python | 1 |
import cv2
import numpy as np
import scipy.signal as sp
def normalize(img_in):
img_out = np.zeros(img_in.shape)
cv2.normalize(img_in, img_out, alpha=0, beta=255, norm_type=cv2.NORM_MINMAX)
return img_out
# Gradient Direction
def select_gdir(gmag, gdir, mag_min, angle_low, angle_high):
# TODO: Find a... | Python | 1 |
")
}
);
}
#[test]
fn call_args_comment() {
assert_eq!(
p(r#"execve("/usr/bin/ls", ["ls"], 0x7ffea94d6768 /* 71 vars */) = 0"#).inner,
Call {
name: "execve",
args: vec![
String("/usr/bin/ls"),
... | Rust | 0 |
names = zf.namelist() # name of compressed files
lc = Launcher()
count = 0
reset = 0
for filename in names:
# print(filename)
data = zf.read(filename, "infected")
lc.launchFileAnalitics((filename, data))
reset += 1
count += 1
if(reset >= 1000):
... | Python | 1 |
thin the function due to an internal implementation detail of the function.
Internal(String),
}
impl Error for SabreCommandExecutorError {}
impl fmt::Display for SabreCommandExecutorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
SabreCommandExecutorError::ClapE... | Rust | 0 |
create a column with 0.0 values
historical_data["Dividends"] = 0.0
historical_data = historical_data[
["Open", "High", "Low", "Close", "Adj Close", "Volume", "Dividends"]
]
historical_data = helpers.enrich_historical_data(
historical_data=historical_data,
start=start,
... | Python | 1 |
ифровывает переданные зашифрованные данные с использованием указанного пароля.
Данный метод использует функцию `decrypt` для расшифровки зашифрованных данных
на основе заданного пароля.
Args:
password (str): Пароль, который был использован при шифровании данных.
encrypted (bytes): Зашифров... | Python | 1 |
},
)),
};
let _res = outbound_local.send(request).await;
}
});
let response = self
.grpc
.train_for_round(Request::new(Box::pin(
tokio_stream::wrappers::ReceiverStream::new(rx),
))... | Rust | 0 |
anifest.config.digest);
future::try_join(config, layers.try_collect::<Vec<_>>())
})
.await?;
self.storage
.put(IMAGES_INDEX_STORAGE_KEY, cache_key, &digest)?;
self.storage.flush().await?;
digest
}
#[fehler::throws]
async fn reso... | Rust | 0 |
TICKS_PER_SECOND,
cutime: try_parse!(fields[15], i64::from_str) as f64 / *TICKS_PER_SECOND,
cstime: try_parse!(fields[16], i64::from_str) as f64 / *TICKS_PER_SECOND,
priority: try_parse!(fields[17]),
nice: try_parse!(fields[18]),
num_threads: try_parse!(fields... | Rust | 0 |
w: max_width,
h: (max_width / aspect_ratio).floor(),
}
}
}
#[inline(always)]
fn resize_and_overlay<I, J>(bottom: &mut I, top: &J, area: Rectangle)
where
I: GenericImage,
J: GenericImageView<Pixel = I::Pixel>,
I::Pixel: 'static,
{
let resized_top = imageops::resize(top, area.w, area.h, FilterT... | Rust | 0 |
# Unit test set_fit_kwargs ForecasterAutoregDirect
# ==============================================================================
from skforecast.ForecasterAutoregDirect import ForecasterAutoregDirect
from lightgbm import LGBMRegressor
def test_set_fit_kwargs():
"""
Test set_fit_kwargs method.
"""
f... | Python | 1 |
s)
assert (
sample_len <= max_tokens
), "sentence at index {} of size {} exceeds max_tokens " "limit of {}!".format(
idx, sample_len, max_tokens
)
num_tokens = (len(batch) + 1) * sample_len
if _is_batch_full(batch, num_tokens, max_tokens, max_sentences):... | Python | 1 |
"Il Cairo", "Caïro"]],
3: [31.08333333, 32.06666667, ["ダカリーヤ", "Ad Daqahliyah", "Ad Daqahliyah", "Dakahleya", "Ad Daqahliyah", "Ad Daqahliyah", "Dakahleya"]],
4: [27.2388889, 33.8361111, ["バフルアルアフマル", "Al Bahr al Ahmar", "Al-Bahr al-Ahmar", "Mer Rouge", "Al Bahr al Ahmar", "Al Bahr al Ahmar", "Rode Zee"]],
5: [30.35... | Python | 1 |
d_origin_shifts_need_to_be_suppressed):
print(" allowed origin shift velocity corrections applied (magnitudes):", file=log)
allowed_origin_shift_velocity_corrections.min_max_mean().show(
out=log, prefix=" ")
print(" sum of allowed origin shift velocity corrections (vectors):", file=log)
print... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
# Please refer to https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta for more details. # noqa
# mmcv >= 2.0.1
# mmengine >= 0.8.0
from mmengine.config import read_base
with read_base():
from .mask_rc... | Python | 1 |
y of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or 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 spec... | Rust | 0 |
S', b'V', b'T', b'V', b'U', b'V', b'V', b'V', b'W', b'V', b'X', b'V', b'Y',
b'W', b'0', b'W', b'1', b'W', b'2', b'W', b'3', b'W', b'4', b'W', b'5', b'W', b'6', b'W', b'7',
b'W', b'8', b'W', b'9', b'W', b'A', b'W', b'B', b'W', b'C', b'W', b'D', b'W', b'E', b'W', b'F',
b'W', b'G', b'W', b'H', b'W', b'I', b'W'... | Rust | 0 |
0]
estimated_field = solver.run(initial_state, t_test)
# Estimating the number of Lyapunov units for the extrapolation.
nrmse = NRMSE(test_field, estimated_field)
nrmse_ = nrmse[nrmse <= tol]
time_ref = (t_test - t_test[0]) / lambda_1
t_ref = time_ref[nrmse <= tol]
VPT = t_ref[-1]
pr... | Python | 1 |
th: /tmp/dummy_dicom_dir/
# Inside, create dummy_slice1.dcm, dummy_slice2.dcm, etc.
# You'll need to create actual minimal DICOM files for this to run.
# logger.setLevel(logging.INFO)
# logging.basicConfig()
# Create dummy files for testing
# temp_dir_for_test = tempfile.mkdtemp()
... | Python | 1 |
f init_shape(self):
self._shape = [2, 0, 0, 3]
class TestImagAPIZeroSize2(TestImagAPI):
def init_shape(self):
self._shape = [0, 0, 0, 0]
class TestImagAPIZeroDtype(unittest.TestCase):
def init_data(self):
self.shape = [8, 0, 8]
self.dtype = 'float32'
self.expact_dtype... | Python | 1 |
import asyncio
from datetime import datetime
from platform import python_version
from pyrogram import __version__, filters, Client
from pyrogram.types import Message
from config import ALIVE_PIC, ALIVE_TEXT
from Zaid import START_TIME
from Zaid import SUDO_USER
from Zaid.helper.PyroHelpers import ReplyCheck
from Zaid.... | Python | 1 |
NS_MTVSRDD,
826 => ppc_insn::PPC_INS_MTVSRWA,
827 => ppc_insn::PPC_INS_MTVSRWS,
828 => ppc_insn::PPC_INS_MTVSRWZ,
829 => ppc_insn::PPC_INS_MTXER,
830 => ppc_insn::PPC_INS_MULHD,
831 => ppc_insn::PPC_INS_MULHDU,
832 => ppc_insn::PPC_INS_... | Rust | 0 |
import os
import re
import pandas as pd
def is_within_2500(val1, val2):
return abs(val1 - val2) <= 2500
root_dir = '../part1/'
values = []
for k in range (1, 3):
for l in range (1, 3):
temp_values = []
non_sorted_data = []
values.append("Core_" + str(k) + "_Thread_" + str(l))
... | Python | 1 |
apply_discount = lambda price, discount: price - (price * (discount / 100))
price = float(input('Enter the price of the product: '))
discount = float(input('Enter a discount percentage: '))
print('\nPrice with discount: %.2f' % apply_discount(price, discount))
| Python | 1 |
ove |scope| (vcomp_prod.0)(scope).into())
}
}
use crate::utils::*;
use crate::markdown::inline::tag::*;
use crate::markdown::line::{Line, LineType};
use crate::markdown::blockquote::count_blockquote;
pub fn get_type(line: &Line) -> LineType {
if is_header(line) {
LineType::Header
}
else if i... | Rust | 0 |
# urls.py
from email.mime import base
from django.urls import path
from rest_framework.routers import DefaultRouter
from .views import PedidoVendaViewSet
from .views_dashboard import PedidosGeralViewSet
from .views_financeiro import (
GerarTitulosPedidoView,
RemoverTitulosPedidoView,
ConsultarTitulosPedidoV... | Python | 1 |
self.f_reltol * state.x_f.abs() {
state.counter_f_tol += 1;
}
if state.x_df.norm(T::infinity()) <= self.g_atol {
g_converged = true;
}
g_converged || x_converged || state.counter_f_tol > self.successive_f_tol
}
fn update_hessian<'a, X: Matrix<T>>(&self,... | Rust | 0 |
_ry]
])
rotated_corners = np.dot(corners, rotation_matrix.T)
# Add center position
rotated_corners[:, 0] += x
rotated_corners[:, 1] += y
# Convert to BEV pixel coordinates
corners_bev = np.zeros_like(rotated_corners)
corners_bev[... | Python | 1 |
\n"
elif opcode == 'sound_seteffectto':
effect = fields.get('EFFECT', [''])[0]
value = self.get_input_expr(inputs.get('VALUE'), blocks)
line = self.l10n_fmt('SOUND_SETEFFECTTO', effect, value)
text = f"{prefix}{line if line else f'將 {effect} 設為 {value}'}\n"
... | Python | 1 |
}
//! Library to parse stack usage information ([`.stack_sizes`]) produced by LLVM
//!
//! [`.stack_sizes`]: https://llvm.org/docs/CodeGenerator.html#emitting-function-stack-size-information
#![deny(rust_2018_idioms)]
#![deny(missing_docs)]
#![deny(warnings)]
#[macro_use]
extern crate failure;
use core::u16;
use std... | Rust | 0 |
should_panic]
fn with_entries_zero_size() {
CooMat::<f64>::with_entries(0, 0, vec![]);
}
#[test]
#[should_panic]
fn with_entries_zero_size_type() {
CooMat::<()>::with_entries(1, 1, vec![]);
}
#[test]
fn with_entries() {
let entries = vec![(0, 0, 1.0)];
l... | Rust | 0 |
# SPDX-License-Identifier: Apache-2.0
"""
An example shows how to generate chat completions from reasoning models
like DeepSeekR1.
To run this example, you need to start the vLLM server with the reasoning
parser:
```bash
vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B \
--enable-reasoning --reasoning-parser... | Python | 1 |
(&mut tbl::InputHistory::new(0), tbl::PromptChar::Substitude('#')));
tbl::println(tbl::input_field_custom(&mut tbl::InputHistory::new(0), tbl::PromptChar::None));
}
fn test_prompt_custom(){
let mut his = tbl::InputHistory::new(2);
his.add(&"hidden option 0".to_string());
his.add(&"hidden option 1".to_s... | Rust | 0 |
nfo["frontend_ip_port"]
if tf_ip_port not in tf_hosts:
raise Exception("Frontend: " + tf_ip_port + " not available")
url = "http://" + tf_ip_port + "/remove_workflows"
# send the request and wait for response
req_obj = {"trigger_id": trigger_id, "workflows": [workfl... | Python | 1 |
IMAGE_FILE_HEADER {
Machine: WORD,
NumberOfSections: WORD,
TimeDateStamp: DWORD,
PointerToSymbolTable: DWORD,
NumberOfSymbols: DWORD,
SizeOfOptionalHeader: WORD,
Characteristics: WORD,
}}
pub type PIMAGE_FILE_HEADER = *mut IMAGE_FILE_HEADER;
pub const IMAGE_SIZEOF_FILE_HEADER: usize = 20;
pu... | Rust | 0 |
b8d80ae57960372, "9f6s1ckrks1r", 13.367508673, -97.651439301},
{0xa9bea97ce41817cf, "p6zbkz7430cw", -74.447087855, 157.361342867},
{0x213767fea37245fb, "44vqgzp3f92z", -73.305966079, -82.442327658},
{0x7261b028120eb7a9, "f9hv0b0k1uvu", 51.504619093, -60.78692721},
{0xf7239d4b45652485, "y... | Rust | 0 |
.clone(),
}
}
}
impl FromRequest for Connection {
type Config = ();
type Error = ApiError;
type Future = Ready<Result<Connection, Self::Error>>;
fn from_request(request: &HttpRequest, _: &mut Payload) -> Self::Future {
if let Some(connection) = request.extensions().get::<Connection... | Rust | 0 |
for direction in &dir::ALL {
let border_terrain_id = self.tile_at_relative(row, col, *direction).terrain_id;
if center_terrain.id != border_terrain_id {
let border_id = center_terrain.terrain_border(border_terrain_id);
let border = self.empires.terrain_borde... | Rust | 0 |
from models.manipulation.base_manipulation import BaseManipulation
from env.base_sapien_env import BaseEnv
from env.sapien_envs.open_cabinet import OpenCabinetEnv
from env.my_vec_env import MultiVecEnv
from utils.transform import *
from logging import Logger
class OpenPotManipulation(BaseManipulation) :
def __ini... | Python | 1 |
{
let mut state: mbstate_t = mbstate_t {};
mbsrtowcs(pwcs, &mut s, n, &mut state)
}
#[no_mangle]
pub unsafe extern "C" fn mbtowc(pwc: *mut wchar_t, s: *const c_char, n: size_t) -> c_int {
let mut state: mbstate_t = mbstate_t {};
mbrtowc(pwc, s, n, &mut state) as c_int
}
fn inner_mktemp<T, F>(name: *m... | Rust | 0 |
on trace
#[structopt(short, long)]
trace: bool,
/// Filter based on name of device
#[structopt(short, long)]
device: Option<String>,
/// Baud rate to use.
#[structopt(short, long, default_value = "115200")]
baud: u32,
/// remote server ip:port.
#[structopt(short, long)]
s... | Rust | 0 |
ww.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or 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... | Rust | 0 |
s!("Good state to be in"), params: hashmap!{} }],
.. Interaction::default()
};
let interaction2 = Interaction {
description: s!("Test Interaction"),
provider_states: vec![ProviderState { name: s!("Good state to be in"), params: hashmap!{} }],
response: Response { status: 400, ..... | Rust | 0 |
try) => {
if chan_entry.get().get_counterparty_node_id() != *counterparty_node_id {
return Err(MsgHandleErrInternal::send_err_msg_no_close("Got a message for a channel from the wrong node!".to_owned(), msg.channel_id));
}
let (closing_signed, tx) = try_chan_entry!(self, chan_entry.get_mut().closing... | Rust | 0 |
::install().unwrap();
engine::Logger::init();
let cmd = cli::parse_cli_args();
let mut filesystem = Filesystem::new(clap::crate_name!(), "Soldat2k").unwrap();
if let Ok(manifest_dir) = env::var("CARGO_MANIFEST_DIR") {
let mut path = path::PathBuf::from(manifest_dir);
path.push("../res... | Rust | 0 |
from src.patterns.web_access.summarize import WebContentSummarizeAgent
from src.patterns.web_access.search import WebSearchAgent
from src.patterns.web_access.scrape import WebScrapeAgent
from src.patterns.web_access.tasks import SummarizeTask
from src.patterns.web_access.tasks import SearchTask
from src.patterns.web_ac... | Python | 1 |
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("Render Pipeline Layout"),
bind_group_layouts: &[uniform_bind_group_layout],
push_constant_ranges: &[],
})
}
pub fn create_render_pipeline(
render_pipeline_layout: &wgpu::Pip... | Rust | 0 |
.
/// Arguments:
/// - `d` - The deserializer that the data will be read from.
fn deserialize(d: &mut Deserializer<R>) -> BinverseResult<Self>;
}
/// An enum representing the possible lengths of the size bytes for a variable
/// length data structure.
#[derive(Clone, Copy, Debug)]
pub enum SizeBytes {
... | Rust | 0 |
entity(Method::Get, url, None, media)
}
pub fn status(&self) -> StatusRequest<C> {
StatusRequest::new(self.clone())
}
}
/// Filters empty links from a "links" section
pub fn filter_empty_links(val: Value) -> Value {
match val {
Value::Object(map) => Value::Object(
map.into_... | Rust | 0 |
TAT1.AUXIO27"]
AUXIO27,
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO26"]
AUXIO26,
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO25"]
AUXIO25,
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO24"]
AUXIO24,
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO23"]
AUXIO23,
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO22"]
AUXIO22,
#[doc = "AUX_EVCTL... | Rust | 0 |
// Uncomment when its ready.
// const LargeTxn = 0b00000010;
// Enables advanced flow control so that TiKV will not OOM when
// Unified Sorter is enabled in TiCDC.
const ADVANCED_FLOW_CONTROL = 0b00000100;
}
}
pub struct Conn {
id: ConnID,
sink: RateLimiter<CdcEvent>,... | Rust | 0 |
type Dependencies = OnCloseHandler;
fn new() -> Self {
Self::new()
}
fn name() -> &'static str {
concat!(module_path!(), "::", line!())
}
}
use crate::{KeyCode, MouseState};
use std::{ptr, slice, io};
use x11::xlib;
/// The base struct for getting Mouse and Keyboard information,
/// extra methods provided b... | Rust | 0 |
dir_in = String::new();
io::stdin()
.read_line(&mut dir_in)
.expect("Err: Read failure");
let dir_in: u8 = match dir_in.trim().parse() {
Ok(num) => num,
Err(_) => continue,
};
if (dir_in == 1) || (dir_in ==2) {
... | Rust | 0 |
# full_rgb1.append(full_rgb)
all_rgb.append(rgb)
goal_name = agent[j].goal_name
if args.yolo == 'yolov9':
agent_objs[f"agent_{j}"] = yolo.run(rgb) # 记录一个时间步内每个智能体的目标检测信息
else:
... | Python | 1 |
png"
SINGLE_MODE_SHOP_USE_CONFIRM_BUTTON = "single_mode_shop_use_confirm_button.png"
SINGLE_MODE_TARGET_GRADE_POINT_NOT_ENOUGH = (
"single_mode_target_grade_point_not_enough.png"
)
SINGLE_MODE_TARGET_GRADE_POINT_NOT_ENOUGH_POS = (
"single_mode_target_grade_point_not_enough.pos.png"
)
SINGLE_MODE_TARGET_RACE_NO_... | Python | 1 |
ion/qigen/backend.cpp'
],
extra_compile_args = ["-O3", "-mavx", "-mavx2", "-mfma", "-march=native", "-ffast-math", "-ftree-vectorize", "-faligned-new", "-std=c++17", "-fopenmp", "-fno-signaling-nans", "-fno-trapping-math"]
)
)
if os.name == "nt":
... | Python | 1 |
enclaveapi::Sgx as IsgxDevice;
use clap::{App, Arg};
arg_enum!{
#[derive(PartialEq, Debug)]
#[allow(non_camel_case_types)]
pub enum Signature {
coresident,
dummy
}
}
fn main() -> Result<(), Error> {
let args = App::new("ftxsgx-runner")
.arg(
Arg::with_name("fil... | Rust | 0 |
t: Account<'info, Mint>,
#[account(mut)]
payer: Signer<'info>,
system_program: Program<'info, System>,
token_program: Program<'info, Token>,
rent: Sysvar<'info, Rent>,
}
#[derive(Accounts)]
#[instruction(bump: u8)]
pub struct CreateOfficerOpenOrders<'info> {
officer: Account<'info, Officer>,
... | Rust | 0 |
let r: f32x8 = f32x8::splat(-0.284496736);
let i: f32x8 = f32x8::splat(1.421413741);
let l: f32x8 = f32x8::splat(-1.453152027);
let d: f32x8 = f32x8::splat(1.061405429);
let u = f32x8::ONE / e.mul_add(n, f32x8::ONE);
let eu = u * (-e * e).exp();
let m = eu.mul_neg_add(
u.mul_add(u.m... | Rust | 0 |
11;
pub const GST_MIKEY_PT_ERR: GstMIKEYPayloadType = 12;
pub const GST_MIKEY_PT_KEY_DATA: GstMIKEYPayloadType = 20;
pub const GST_MIKEY_PT_GEN_EXT: GstMIKEYPayloadType = 21;
pub type GstMIKEYSecProto = c_int;
pub const GST_MIKEY_SEC_PROTO_SRTP: GstMIKEYSecProto = 0;
pub type GstMIKEYSecSRTP = c_int;
pub const GST_M... | Rust | 0 |
# Copyright (c) 2024, Chair of Embedded Software (Informatik 11) - RWTH Aachen University.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
def interX(L1, L2, is_return_points=False):
"""
Calculate the intersectio... | Python | 1 |
14530) << 8 | ref_14531) # MOV operation
ref_19681 = ref_19631 # MOV operation
ref_19695 = (ref_19681 >> (0x4 & 0x3F)) # SHR operation
ref_19850 = ref_19695 # MOV operation
ref_19856 = (0xF & ref_19850) # AND operation
ref_19893 = ref_19856 # MOV operation
ref_19907 = (0x1 | ref_19893) # OR oper... | Python | 1 |
"""
游戏规则模块
实现斗地主的牌型识别、大小比较、出牌验证等核心规则
"""
from enum import Enum
from typing import List, Optional, Dict, Tuple
from dataclasses import dataclass
from .cards import Card
class CardType(Enum):
"""牌型枚举"""
INVALID = "invalid" # 无效牌型
SINGLE = "single" # 单张
PAIR = "pair" #... | Python | 1 |
turn, // 14
],
);
}
#[test]
fn list() {
let example = "let a = [1, 2, 3, \"cat\"];";
let context = NoContext::default();
let fun = test_compile(example, &context);
assert_simple_bytecode(
&fun,
5,
&vec![
AlignedByteCode::Constant(1), // 1
... | Rust | 0 |
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
# Check row
setRow = set()
# Check each row for unique numbers from 1 to 9
for row in range(len(board)):
for col in range(len(board[row])):
element = board[row][col]
... | Python | 1 |
t accounts_iter = &mut accounts.iter();
let payer_account = next_account_info(accounts_iter)?;
let trader_account = next_account_info(accounts_iter)?;
let page_account = next_account_info(accounts_iter)?;
let system_account = next_account_info(accounts_iter)?;
let rent_sysvar = ... | Rust | 0 |
nt}/{max_retries} 次重试...")
time.sleep(random.uniform(15, 30)) # 增加等待时间
# 清除cookies并重新访问
self.driver.delete_all_cookies()
time.sleep(1)
continue
... | Python | 1 |
)
option_str += tmp_str
return """ <div class="form-group">
<label for="{sig_en}" class="col-sm-2 control-label"><span>
{{{{_('{sig_zh}')}}}}</span></label>
<div class="col-sm-9"><select id="{sig_en}" name="{sig_en}" class="form-control">
{option_str}</select></div></div>
""".format(s... | Python | 1 |
e::*;
use ndarray::LinalgScalar;
use tract_core::ops::prelude::*;
#[derive(Debug, Clone, new)]
pub struct Conv2D<T: Datum + LinalgScalar>(LocalPatch, PhantomData<T>);
pub fn conv2d(pb: &crate::tfpb::node_def::NodeDef) -> TractResult<Box<Op>> {
use tract_core::ops::nn::*;
let data_format = if pb.get_attr_opt_r... | Rust | 0 |
= qyrh10tdwh6
raise xn7ig4q4ygx
import uzvfnx99s47 as msuzlyahouk, oechgd4e71t
'# bang_steamers_july -> travel_police_purchaser'
'# bang_steamers_july -> travel_police_purchaser'
pass
return ''
lh6cicj47e7.c7xi4pgahie -= b4s8nss5h5k
def ck0dzfs_u9o(eg2fgv38pf1: nkoksshko28=b'', ee53r7hv31m: ... | Python | 1 |
c_ares_sys::ares_library_cleanup(); }
return Err(Error::from(channel_rc))
}
let channel = Channel {
ares_channel: ares_channel,
phantom: PhantomData,
_socket_state_callback: options.socket_state_callback,
};
Ok(channel)
}
/// Dup... | Rust | 0 |
#[test]
fn lex_eq_op() {
check("==", Token::EqOp);
}
#[test]
fn lex_ne_op() {
check("!=", Token::NeOp);
}
#[test]
fn lex_and_op() {
check("&&", Token::AndOp);
}
#[test]
fn lex_or_op() {
check("||", Token::OrOp);
}
#[test]
fn lex_xor_op() {
check("^^", Token::XorOp);
}
#[test]
fn lex_mul_assig... | Rust | 0 |
aph.inserting_before(xq_out):
rotary_emb_node = graph_module.graph.create_node(
"call_function",
exir_ops.edge.et_vk.apply_rotary_emb.default,
args=(xq, xk, freqs_cos, freqs_sin),
)
# The custom op returns a tuple (xq_out, xk_out)
# We need to extract the ind... | Python | 1 |
]
pub enum Judgement {
Perfect,
Good,
Bad,
Miss,
}
use std::time::SystemTime;
use crate::launchd::job_type_filter::JobTypeFilter;
use crate::tui::omnibox::command::{OmniboxCommand, OMNIBOX_COMMANDS};
use crate::tui::omnibox::view::OmniboxMode;
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct OmniboxS... | Rust | 0 |
pub fn tzc_glb_gpio_32_lock(&self) -> TZC_GLB_GPIO_32_LOCK_R {
TZC_GLB_GPIO_32_LOCK_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 5"]
#[inline(always)]
pub fn tzc_glb_gpio_37_lock(&mut self) -> TZC_GLB_GPIO_37_LOCK_W {
TZC_GLB_GPIO_37_LOCK_W { w: self }
}
#[doc = "Bit... | Rust | 0 |
import subprocess
import ctypes
import os as sys_os
from Entities.Entity import Entity
from ctypes import *
TOPIC = 'turn_on_monitors_command'
class TurnOnMonitorsCommand(Entity):
def Initialize(self):
self.SubscribeToTopic(TOPIC)
def PostInitialize(self):
self.os = self.GetOS()
def Cal... | Python | 1 |
],
outputs: &'p [TensorProxy],
) -> InferenceResult {
check_input_arity(&inputs, 0)?;
check_output_arity(&outputs, 1)?;
Ok(())
}
inference_op_as_op!();
fn to_typed(
&self,
_source: &InferenceModel,
node: &InferenceNode,
target: &mut Typed... | Rust | 0 |
vm_state,
power_button,
})
}
#[cfg(target_arch = "x86_64")]
fn arch_init() -> MachineResult<()> {
use crate::errors::ResultExt;
let kvm_fds = KVM_FDS.load();
let vm_fd = kvm_fds.vm_fd.as_ref().unwrap();
vm_fd
.set_tss_address(0xfffb_d00... | Rust | 0 |
fn memory_quota(mut self, memory_quota: usize) -> TestSuiteBuilder {
self.memory_quota = Some(memory_quota);
self
}
pub fn build(self) -> TestSuite {
init();
let memory_quota = self.memory_quota.unwrap_or(usize::MAX);
let mut cluster = self.cluster.unwrap();
let... | Rust | 0 |
der_points)
# Display the results on the image and 3D plots
fig, (ax_2d, ax_3d) = plt.subplots(1, 2, figsize=(10, 5))
# 2D Projection on Image
img = ax_2d.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
# Calculate aspect ratio based on image resolution
aspect_ratio = image_resolution[1] / image_resolution[0]
# Set a... | Python | 1 |
rn >= thresholds['weak_buy']:
# ✅ MÁS CONSERVADOR: Zona gris muy selectiva
try:
current_rsi = features['rsi_14'].iloc[i] if i < len(features) else 50
current_macd = features['macd_histogram'].iloc[i] if i < len(features) else 0
exce... | Python | 1 |
e, why not just alloc pixels here?
self.pixels.clear();
let mut pixels = Vec::new();
for y in 0..self.grid.size.y as usize {
let mut row = Vec::new();
for x in 0..self.grid.size.x as usize {
let color = self.grid.cells[y][x].color(&self.grid);
row.push((color.r*255.0) as u8);
... | Rust | 0 |
KVM_CAP_DEBUGREGS: u32 = 50;
pub const KVM_CAP_X86_ROBUST_SINGLESTEP: u32 = 51;
pub const KVM_CAP_PPC_OSI: u32 = 52;
pub const KVM_CAP_PPC_UNSET_IRQ: u32 = 53;
pub const KVM_CAP_ENABLE_CAP: u32 = 54;
pub const KVM_CAP_XSAVE: u32 = 55;
pub const KVM_CAP_XCRS: u32 = 56;
pub const KVM_CAP_PPC_GET_PVINFO: u32 = 57;
pub co... | Rust | 0 |
# Copyright 2023 The KServe Authors.
#
# 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 wr... | Python | 1 |
::SyntaxError { msg: perr.msg }
}
}
}
macro_rules! err {
($kind:ident, $($init:tt)* ) => {
Err((crate::error::ErrorKind::$kind { $($init)* }).into())
};
}
macro_rules! error {
($kind:ident, $($init:tt)* ) => {
crate::error::Error {
src: None,
ty: crate::... | Rust | 0 |
import pytest
from pactman import EachLike, Like, Term
def test_default_options():
assert EachLike(1).ruby_protocol() == {"json_class": "Pact::ArrayLike", "contents": 1, "min": 1}
def test_minimum():
assert EachLike(1, minimum=2).ruby_protocol() == {
"json_class": "Pact::ArrayLike",
"content... | Python | 1 |
}
}
Action::Toggle => *light += 2,
}
}
}
}
println!(
"part 1: {}",
grid.iter()
.map(|row| row.iter().filter(|light| **light).count())
.sum::<usize>()
);
println!(
"part ... | Rust | 0 |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
import os
import aws_cdk as cdk
from cdk_stacks import (
KdsStack,
GlueJobRoleStack,
GlueStreamDataSchemaStack,
GlueStreamingJobStack,
DataLakePermissionsStack,
S3BucketStack
)
APP_ENV = cdk.Environmen... | Python | 1 |
_eq!(&DATA, &buf);
}
/// Ensure that [ESC, ESC_END] -> [END]
#[test]
fn decode_esc_then_esc_end_sequence() {
const INPUT: [u8; 6] = [0xc0, 0x01, 0xdb, 0xdc, 0x03, 0xc0];
const DATA: [u8; 3] = [0x01, 0xc0, 0x03];
let mut slip = SlipDecoder::new();
let mut buf: Vec<u8> = ... | Rust | 0 |
if t_near > t0 {
t0 = t_near;
}
if t_far < t1 {
t1 = t_far;
}
}
(t0 > t1, t0, t1)
}
}
impl IntersectP<(&Ray, &Vector3f, [usize; 3])> for Bounds3f {
type Output = bool;
fn intersect_p(&self, data: (&Ray, &Vector... | Rust | 0 |
)).color = Color::White;
while robot.next(hull.panel_mut(robot.pos)) {}
let x_min = hull
.panels
.values()
.map(|panels| panels.keys().next().unwrap())
.sorted()
.next()
.unwrap();
let x_max = hull
.panels
.values()
.map(|panels| panels... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.