text string | label_name string | labels int64 |
|---|---|---|
3.70, // Don't discharge below this amount for good battery health
3.60,
3.20,
];
/// Converts the given battery voltage to an estimated battery percentage
pub fn voltage_to_percentage(voltage: f32) -> usize {
let mut percentage: usize = 100;
for lut_voltage in &BATTERY_VOLTAGE {
if voltage... | Rust | 0 |
_offset - 1),
Range::new(0, metrics.valid_offset + normalized_tweet_offset - 1),
);
ExtractResult::new(results, entities)
}
fn extract_reply_username(&self, s: &'a str) -> MentionResult<'a> {
self.extract_reply_username_impl(s)
}
fn mention_result(&self, s: &'a str... | Rust | 0 |
a=[78,8,76,35,87,42,36]
for i in range(len(a)):
for j in range(len(a)-i):
if a[j]>[i+1]:
a[j],a[j+1]=a[j+1],a[j]
print(a) | Python | 1 |
rver.thread_pool)
print_report(size_report())
# modpython and other WSGI #
def startup_modpython(req=None):
"""Start the CherryPy app server in 'serverless' mode (for modpython/WSGI).
"""
if cherrypy.engine.state == cherrypy._cpengine.STOPPED:
i... | Python | 1 |
` from a top-level type and a subtype.
/// ```
/// # use mediatype::{names::*, MediaType};
/// const IMAGE_PNG: MediaType = MediaType::new(IMAGE, PNG);
/// assert_eq!(IMAGE_PNG, MediaType::parse("image/png").unwrap());
/// ```
pub const fn new(ty: Name<'a>, subty: Name<'a>) -> Self {
Sel... | Rust | 0 |
dc : HDC,
mode: INT,
) -> INT;
// https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-getcharacterplacementw
pub fn GetCharacterPlacementW(
hdc : HDC,
lpString : LPCWSTR,
nCount : INT,
nMexExtent: INT,
lpResults : LPGCP_RESULTSW,
... | Rust | 0 |
decoder_attention_mask=None,
head_mask=None,
decoder_head_mask=None,
cross_attn_head_mask=None,
use_cache=None,
encoder_outputs=None,
**kwargs
):
# cut decoder_input_ids if past is used
if past is not None:
decoder_input_ids = decoder_in... | Python | 1 |
# Copyright 2022 CreuBlanca
# Copyright 2022 Tecnativa - Víctor Martínez
# Copyright 2022 NuoBiT - Eric Antones
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
from odoo import api, fields, models
_logger = logging.getLogger(__name__)
class AccountMove(models.Model):
_inherit = ... | Python | 1 |
sym} {fx}",
time = state.time,
cycle = state.cycle,
pc = state.pc,
hexinst = format!("{:0width$x}", state.inst.inst, width = state.inst.len),
asm = format!("{:10} {}", state.asm_op, state.asm_args.unwrap_or("")),
flow = match state.inst.op {
rv_op::jalr | rv_... | Rust | 0 |
0xe1, 0xad, 0xa1, 0x78,
0xd6, 0x6c, 0xce, 0xcf, 0xa4, 0x5b, 0x63, 0x30, 0x70, 0xc2, 0x43,
0xa2, 0xd7, 0x6e, 0xe0, 0x5d, 0x63, 0x49, 0xfe, 0x98, 0x69, 0x6c,
0x1c, 0x4d, 0x9a, 0x67, 0x11, 0x24, 0xde, 0x40, 0xc5, 0x31, 0x71,
0xa4, 0xb2, 0x82,
];
secp256k1::Si... | Rust | 0 |
(&(), metadata)
}
///```rust
/// # use better_any::{downcast_tid, DowncastExt,Tid,tid};
/// # use std::fmt::Debug;
/// struct Test(i32);
/// tid!(Test);
/// let a = Box::new(Test(5i32));
/// let any = a as Box<dyn Tid>;
/// let result: Box<Test> = downcast_tid(any).unwrap();
/// assert_eq!(a.0, result.0);
///```
pub f... | Rust | 0 |
w_data.get(column.group_name, {})
value = group_data.get(column.key, "")
else:
value = row_data.get(column.key, "")
worksheet.cell(row=row_idx, column=column_idx, value=value)
# Устанавливаем ширину столбцов
for column_cells in wor... | Python | 1 |
# Generated by Django 5.1 on 2024-09-30 23:00
import contextlib
from django.db import migrations
def merge_content_types(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
rct = ContentType.objects.filter(app_label='tracker', model='runner').first()
nct = ContentType.object... | Python | 1 |
# Copyright 2025 Scientific Knowledge Organization (SciKnowOrg) Research Group.
#
# 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 r... | Python | 1 |
f not HAS_IPV6:
pytest.skip("Only runs on IPv6 systems")
tmpdir = tmp_path_factory.mktemp("certs")
ca = trustme.CA()
# IP address in Common Name
server_cert = ca.issue_cert(common_name="::1")
with run_server_in_thread("https", "::1", tmpdir, ca, server_cert) as cfg:
yield cfg
@py... | Python | 1 |
f mh == S::neg_infinity() {
DFloat::min_value()
} else {
unsafe { DFloat::from_double_components_unchecked(mh, ml) }
}
}
}
fn mul_down(a: DFloat<S>, b: DFloat<S>) -> DFloat<S> {
let ((a_high, a_low), (b_high, b_low)) = (a.into_tuple(), b.i... | Rust | 0 |
# Copyright (c) Alibaba, Inc. and its affiliates.
import torch
from .base_evaluator import Evaluator
from .builder import EVALUATORS
from .metric_registry import METRICS
@EVALUATORS.register_module
class FaceKeypointEvaluator(Evaluator):
def __init__(self, dataset_name=None, metric_names=['ave_nme']):
s... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
desc:
author: huha
'''
import requests
with open ('poc.php','rb') as f:
bstr = f.read()
with open('D:\phpstudy\PHPTutorial\WWW\poc.php','wb') as f:
f.write(bstr)
r = requests.get("http://127.0.0.1/poc.php",timeout=1)
code = r.content.decode()
# print(code)
# c... | Python | 1 |
stribution for both dimensions
residuals = actual_inputs_np - predicted_inputs_np # Вычисление остатков / Calculate residuals
plt.figure(figsize=(10, 6))
plt.hist(residuals[:, 0], bins=30, alpha=0.7, label='Dimension 1') # Гистограмма для размерности 1 / Histogram for Dimension 1
plt.hist(residuals[:, 1], bins=30, a... | Python | 1 |
fn pwm_0_genb_actcmpad_inv(self) -> &'a mut W {
self.variant(PWM_0_GENB_ACTCMPADW::PWM_0_GENB_ACTCMPAD_INV)
}
#[doc = "Drive pwmB Low"]
#[inline(always)]
pub fn pwm_0_genb_actcmpad_zero(self) -> &'a mut W {
self.variant(PWM_0_GENB_ACTCMPADW::PWM_0_GENB_ACTCMPAD_ZERO)
}
#[doc = "... | Rust | 0 |
#Bitcoin Price Prediction
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from xgboost import... | Python | 1 |
.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `EZI`"]
pub enum EZIW {
#[doc = "Disable input buffer"]
DISABLE_INPUT_BUFFER,
#[doc = "Enable input buffer"]
ENABLE_INPUT_BUFFER,
}
impl EZIW {
#[allow(missing_docs)]
#[doc(hidden)... | Rust | 0 |
tchpad_get_num_entries),
_init: Some(tchpad_init),
_preprocess_input: None,
_result: Some(tchpad_result),
_token_match: Some(tchpad_token_match),
abi_version: ABI_VERSION,
cfg_name_key: [0; 128],
display_name: null_mut(),
ed: null_mut(),
free: None,
module: null_mut(),
name: null_mut(),
private_... | Rust | 0 |
se HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail="Failed to resolve sync conflicts"
)
@router.post("/sync", response_model=ZoteroSyncResponse)
async def sync_libraries(sync_request: ZoteroSyncRequest, user=Depends(get_current_user)):
"""
Trigger synch... | Python | 1 |
5(&self, system: &System, potentials: &Potentials, group: &hdf5::Group) {
let energy = self.calculate(system, potentials);
let dataset = group.new_dataset::<Float>().create(self.name(), 1).unwrap();
dataset.write(&[energy]).unwrap();
}
}
impl Hdf5Output for TotalEnergy {
fn output_hdf5(... | Rust | 0 |
use_dropout (bool): Whether to use dropout layers. Default: True.
"""
def __init__(self,
channels,
padding_mode,
norm_cfg=dict(type='BN'),
use_dropout=True):
super().__init__()
assert isinstance(norm_cfg, dict), ("'norm_... | Python | 1 |
(key_type) => {
with_match_physical_dictionary_key_type!(key_type, |$T| {
Box::new(DictionaryArray::<$T>::new_null(data_type, length))
})
}
}
}
macro_rules! clone_dyn {
($array:expr, $ty:ty) => {{
let f = |x: &$ty| Box::new(x.clone());
general_dyn... | Rust | 0 |
aw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "tamper and alternate function configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg... | Rust | 0 |
name>src/lib.rs
//! *“I'm late! I'm late! For a very important date!”*
//! *by “The White Rabbit”* 『Alice's Adventures in Wonderland』
//!
//! `white_rabbit` schedules your tasks and can repeat them!
//!
//! One funny use case are chat bot commands: Imagine a *remind me*-command,
//! the command gets executed and you si... | Rust | 0 |
# 주어진 BST와 노드 p, q가 주어질 때
# 이 둘의 가장 가까운 공통 조상(Lowest Common Ancestor, LCA)을 찾아 반환해라
# 공통 조상이란, p와 q 모두의 조상 중에서 가장 깊은 노드를 의미
#
# BST(Binary Search Tree)의 특징
# - 각 노드는 최대 두 개의 자식 노드를 가질 수 있음
# - 왼쪽 서브트리의 모든 값은 현재 노드보다 작고,
# - 오른쪽 서브트리의 모든 값은 현재 노드보다 큼.
#
# 풀이
# 현재 노드가 p, q보다 둘 다 작으면, 오른쪽 서브트리에서 LCA를 찾고,
# 둘 다 크면, 왼쪽 서브 ... | Python | 1 |
="3")]
pub file_id: ::core::option::Option<u64>,
#[prost(bytes="vec", optional, tag="4")]
pub file_md5: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
#[prost(uint64, optional, tag="5")]
pub file_size: ::core::option::Option<u64>,
#[prost(bytes="vec", optional, tag="6")]
pub file_name... | Rust | 0 |
nction call, so if the original expression
// has parens on the outside, they are no longer needed.
let mut applicability = Applicability::MachineApplicable;
let opt = snippet_opt(cx, cast_op.span);
let sugg = opt.as_ref().map_or_else(
|| {
applicability = Applicability::HasPlacehold... | Rust | 0 |
from django.shortcuts import render
from cmdb.models import HostGroup
from cmdb.forms import GroupForm
from django.contrib.auth.decorators import login_required
from accounts.permission import permission_verify
from django.http import HttpResponseRedirect
from django.urls import reverse
@login_required()
@permission_... | Python | 1 |
ent_text_payload}"
# Truncate the line if it's too long for the console width
if len(line_to_display) > max_spinner_width:
line_to_display = line_to_display[:max_spinner_width]
len_line_to_display = len(line_to_display)
# Calculate padding to clear any remnants from a long... | Python | 1 |
bo = create_skybox_vbo();
Self {
program: super::new_program_ex_unwrap(SKY_VS, SKY_FS),
vao: create_skybox_vao(vbo.gl_id()),
vbo,
}
}
}
fn create_skybox_vbo() -> gx::Buffer {
let v = new_skybox_triangle_strip(0.5);
let flags = 0;
unsafe {
... | Rust | 0 |
est: Style) -> ColorByRange<T>
{ ColorByRange { divs, lowest } }
fn style_of(&self, x: &T) -> Style
where T: PartialOrd,
{
for &(ref pivot, style) in &self.divs {
if x > pivot { return style; }
}
return self.lowest;
}
// pub fn paint<'a, U>(&self, x: U) -> W... | Rust | 0 |
import random
# we anticipate if user does not enter an integer
while True:
try:
top_range = int(input("Type a number: "))
except ValueError:
print("type in an integer next time :)")
else:
break
#we create a loop where we keep asking user an int greater than 0
while True:
... | Python | 1 |
attr.nullable,
is_unsigned: unsigned,
})
}
fn determine_type_name(sql_type_name: &str) -> Result<String, Box<Error>> {
let result = if sql_type_name == "tinyint(1)" {
"bool"
} else if sql_type_name.starts_with("int") {
"integer"
} else if let Some(idx) = sql_type_name.find('(')... | Rust | 0 |
e, None)
screen._reload_object = lambda: None # type: ignore[assignment]
await pilot.app.push_screen(screen)
screen.worker = type("W", (), {"is_finished": True})()
screen._build_trees()
exp_path = Path(plugin.root_dir) / "demo"
exp_path.mkdir(parents=True)
screen... | Python | 1 |
cell_2.innerHTML = \"<b>Recent Kills</b>\";
</script>
<form action = \"/\" method = \"get\"><button type = \"submit\">I'll have another!</button></form>
</body>
</html>
",... | Rust | 0 |
,
) {
if keyboard.just_pressed(KeyCode::Space) {
combat_state.set(CombatState::Exiting).unwrap();
create_fadeout(&mut commands, None, &ascii);
}
}
fn give_reward(
mut commands: Commands,
ascii: Res<AsciiSheet>,
mut player_query: Query<(&mut Player, &mut CombatStats)>,
enemy_quer... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
🚀 Скрипт запуска OSINT Toolkit
Проверяет зависимости и запускает основную программу
"""
import sys
import subprocess
import importlib.util
import os
def check_python_version():
"""Проверка версии Python"""
if sys.version_info < (3, 7):
print("❌ Требу... | Python | 1 |
("share/locale/fr_FR/LC_MESSAGES", ["locales/fr_FR/LC_MESSAGES/naturalscrolling.mo"]),
("share/locale/it_IT/LC_MESSAGES", ["locales/it_IT/LC_MESSAGES/naturalscrolling.mo"]),
("share/locale/nl_NL/LC_MESSAGES", ["locales/nl_NL/LC_MESSAGES/naturalscrolling.mo"]),
("s... | Python | 1 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Description: publish initial pose to ros topic
# Author: sujit-168 su2054552689@gmail.com
# Date: 2024-03-22 17:40:53
import os
import rospy
from geometry_msgs.msg import PoseWithCovarianceStamped
import tf.transformations
robot_name = os.getenv("TIANRACER_NAME", "t... | Python | 1 |
}
write!(f, "")
}
Self::ObjectBlock(name, items) => {
write!(f, "object (name = {}) block \n", name)?;
for item in items.iter() {
write!(f, " {}\n", item)?;
}
write!(f, "")
... | Rust | 0 |
and {FONT_SIZE_MAX}.")
def reset_font_size():
change_font_size(DEFAULT_FONT_SIZE)
# Restart the application
execute_sql("salar.db", "UPDATE user_settings SET font_size = ?", (DEFAULT_FONT_SIZE,))
messagebox.showinfo("Info", "Font size has been reset. The application will now restart.")
python = ... | Python | 1 |
#[test]
fn test_create_first_upstream_variant() {
let mut buffer = RouteBuffer::new();
let trip = trips::tram_12::oranienburger_tor_am_kupfergraben(time!(9:02:00));
buffer.add_trip(
stop_locations::tram_12::oranienburger_tor_am_kupfergraben(),
&shapes::tram_12::... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Android启动接收器模块,用于在设备启动时自动启动SmartQA服务
"""
from jnius import autoclass
# Android相关类
PythonActivity = autoclass('org.kivy.android.PythonActivity')
Intent = autoclass('android.content.Intent')
Context = autoclass('android.content.Context')
String = autoclass('java.lang.S... | Python | 1 |
#!/usr/bin/env python3
# coding: utf-8
# File: sentence_similarity.py
# Author: lhy<lhy_in_blcu@126.com,https://huangyong.github.io>
# Date: 18-4-17
import gensim
import numpy as np
class SimilarityCompute:
def __init__(self):
self.embedding_file = 'data/token_vector.bin'
self.model = gensim.models... | Python | 1 |
tHair(self.renderer, data)
self.objTracker.trackPlugin(getObjTrackId(evaluatedObj), data.name)
self.exported.add(data.name)
return AttrPlugin(data.name)
def exportUVs(self, objMesh, mod, firstExported, totalParticles, psys, parents, data):
uvLayers = objMesh.uv_layers
if ... | Python | 1 |
/// If that partition is an extended partition, it must not contain any logical partitions.
pub fn remove_partition_by_sector(&mut self, sector: i64) -> Result<()> {
unsafe {
cvt(ped_disk_get_partition_by_sector(self.disk, sector))
.and_then(|part| cvt(ped_disk_delete_partition(... | Rust | 0 |
ptions: *const ZopfliOptions,
mut output_type: ZopfliFormat,
mut infilename: *const libc::c_char,
mut outfilename: *const libc::c_char) {
let mut in_0: *mut libc::c_uchar = 0 as *mut libc::c_uchar;
let mut insi... | Rust | 0 |
"""
Multiplicative inverse and the EXTENDED
EUCLIDEAN ALGORITHM
Compute the following multiplicative inverses:
(a) 17^-1 mod 101
(b) 357^-1 mod 1234
(c) 3125^-1 mod 9987.
"""
def mult_inverse(a,b):
A = [a]
B = [b]
T = [0]
t = 1
q = A[0]//B[0]
r = A[0]-(q*B[0])
while r > 0:
tmp = (T[... | Python | 1 |
rixType as *const $RefType)
}
}
}
impl<S> AsMut<$RefType> for $MatrixType {
#[inline]
fn as_mut(&mut self) -> &mut $RefType {
unsafe {
&mut *(self as *mut $MatrixType as *mut $RefType)
}
... | Rust | 0 |
tmp_mean = torch.mean(enc_out, dim=1).unsqueeze(1).repeat(1, self.pred_len//scale, 1)
zeros = torch.zeros([x_dec.shape[0], self.pred_len//scale, x_dec.shape[2]], device=x_enc.device)
seasonal_init, trend_init = self.decomp(enc_out)
trend_init = torc... | Python | 1 |
let expected = r#"
pub fn foo<T, S>(bar1: T, bar2: S) -> ()
where
T: ,
S: ,
{
}
"#;
let src_code = function.generate_and_verify();
println!("{}", &src_code);
assert_eq!(norm_whitespace(expected), norm_whitespace(&src_code));
}
#[test]... | Rust | 0 |
assert "key appears weak" in caplog.text.lower()
def test_secret_32_char_no_warning(
mocker: MockerFixture, caplog: pytest.LogCaptureFixture
):
"""Test that 32-character secret does not trigger warning (boundary test)."""
secret_32 = "a" * 32 # Exactly 32 characters
mocker.patch.dict(os.envi... | Python | 1 |
BARRIER,
}
impl ::core::marker::Copy for D3D12_RESOURCE_BARRIER_0 {}
impl ::core::clone::Clone for D3D12_RESOURCE_BARRIER_0 {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"]
pub const D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES: u32 = 4294967295u32;
#[doc ... | Rust | 0 |
at_invite_link() {
let request = ExportChatInviteLink::new(1).into_request();
assert_eq!(request.get_method(), RequestMethod::Post);
assert_eq!(
request.build_url("base-url", "token"),
"base-url/bottoken/exportChatInviteLink"
);
if let RequestBody::Json(da... | Rust | 0 |
Self {
top,
right,
bottom,
left,
}
}
}
<reponame>Wuelle/rust_nn
use ndarray::prelude::*;
use crate::autograd::Dual;
use num_traits::Float;
/// A continuous, derivable function to describe how close one value is to another
pub enum Loss {
/// Mea... | Rust | 0 |
import logging
from pcapi.core.offerers import models as offerers_models
from pcapi.utils import requests
from .base import BaseBackend
logger = logging.getLogger(__name__)
class LoggerBackend(BaseBackend):
def create_offerer(self, offerer: offerers_models.Offerer, created: bool = True) -> dict:
logge... | Python | 1 |
from sapien import Entity, Pose
import cv2
import numpy as np
from sapien.pysapien.physx import PhysxArticulation
from robotics.sim import Simulator, GPUEngineConfig, SimulatorConfig
import tqdm
# from robotics.utils.sapien_utils import get_rigid_dynamic_component
from robotics.sim.robot.mycobot280pi import MyCobot280... | Python | 1 |
intln!("{:032b}", a); }
bin.access($idx);
}
)*)
}
indexing_panic!{
(u8: 0, 1, idx_pan_u8_0_1)
(u8: 1, 2, idx_pan_u8_1_2)
(u8: 1, 128, idx_pan_u8_1_128)
(u16: 0, 1, idx_pan_u16_0_1)
(u16: 1, 2, idx_pan_u16_1_2)
(u16: 1, 128, idx_pan_u16_1_128)
(u32: 0, 1, idx_pan_u32_0_1)
(u32: 1, 2, idx_pan... | Rust | 0 |
int_store.register_lints(&**RUSTDOC_LINTS);
lint_store.register_group(
true,
"rustdoc::all",
Some("rustdoc"),
RUSTDOC_LINTS.iter().map(|&lint| LintId::of(lint)).collect(),
);
for lint in &*RUSTDOC_LINTS {
let name = lint.name_lower();
lint_store.register_alias... | Rust | 0 |
, 3, 4, 5], vec![16, 5, 11, 9])
.mode(Mode::Lines)
.name("Lines");
let trace3 = Scatter::new(vec![1, 2, 3, 4], vec![12, 9, 15, 12])
.mode(Mode::LinesMarkers)
.name("Scatter + Lines");
let layout = Layout::new().title(Title::new("Adding Names to Line and Scatter Plot"));
let ... | Rust | 0 |
self) {
let indexer = self.orientation.get_indexer(self.width as i16);
for (i, index) in indexer.iter(self.width).enumerate() {
if i % self.width == 0 {
println!();
}
if self.data[index] {
if self.monster_indexes.contains(&index) {
... | Rust | 0 |
print(f'{role}')
for svc_data in role.services_data:
if len(svc_data.data) == 0:
continue
print(f' |-> {svc_data.name}')
for elm in svc_data.data:
print(f' | |-> {elm}')
def __grep_data(self, search_pattern):
roles_to_pr... | Python | 1 |
is: &mut ::protobuf::CodedInputStream<'_>,
) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
_ => {
::protobuf::rt::read_unknown_or_skip_group(
... | Rust | 0 |
#
# Copyright (C) 2020 IBM. All Rights Reserved.
#
# See LICENSE.txt file in the root directory
# of this source tree for licensing information.
#
#!/usr/bin/env python3
import os
import sys
from clai.server.client_connector import ClientConnector
from clai.server.command_message import Action, FilesChangesValues, Pr... | Python | 1 |
{
server: config::ServerConfig {
addr: ListenAddr(([0, 0, 0, 0], 0).into()),
keepalive: Keepalive(None),
h2_settings: h2::Settings::default(),
},
connect: config::ConnectConfig {
keepalive: Keepalive(None),
... | Rust | 0 |
ition.0, "Invalid binary expression"),
}
} else {
self.unexpected_err(position.0, "Invalid binary expression")
}
visitor.stop();
}
Node::UnaryExpression {
argument,
operator,
... | Rust | 0 |
# Copyright <2025> <Сергей Каманов>
#
# 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, publish, distribute... | Python | 1 |
xt_by_code('project_budget.project_steps')
if self.env.context.get('form_fix_budget'):
f = 1
else:
vals['step_id'] = self.env['ir.sequence'].sudo().next_by_code('project_budget.project_steps')
return super().create(vals_list)
def unlink(self):
... | Python | 1 |
, z0, c, zt.as_mut().unwrap()) as u32;
z1 + cc
})
}
pub(super) fn div_wvw(z: &mut [u32], xn: u32, x: &[u32], y: u32) -> u32 {
z.iter_mut().zip(x.iter()).fold(xn, |r, (zt, &xt)| {
let (tmpz, tmpr) = div_ww(r, xt, y);
*zt = tmpz;
tmpr
})
}
<filename>src/systems/rendering/mod.r... | Rust | 0 |
(-1))
}
#[cfg(feature = "newlib")]
static SBRK_COUNTER: AtomicUsize = AtomicUsize::new(0);
#[cfg(feature = "newlib")]
pub fn sbrk_init() {
SBRK_COUNTER.store(task_heap_start().as_usize(), Ordering::SeqCst);
}
#[cfg(feature = "newlib")]
fn __sys_sbrk(incr: isize) -> usize {
// Get the boundaries of the task heap an... | Rust | 0 |
import dump
header = """/* Copyright (C) 2006 Charlie C
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* in... | Python | 1 |
e_types=[".pdf"], elem_id="pdf_upload")
policy_text_input = gr.Textbox(
label="Or paste policy text here",
placeholder="Paste policy document text...",
lines=5,
elem_id="policy_text_input"
... | Python | 1 |
#
# @lc app=leetcode id=215 lang=python
#
# [215] Kth Largest Element in an Array
#
# @lc code=start
class Solution(object):
def findKthLargest(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
# @lc code=end
| Python | 1 |
sp {
let err = DownlinkError::SchemaViolation(value, schema);
let _ = req.send_err(err);
}
}
//! Wraps an I/O handle, logging all activity in a readable format to a
//! configurable destination.
//!
//! # Overview
//!
//! [`Dump`] decorates an I/O handle that implements [`Read`] and/or [`Write`]. [`... | Rust | 0 |
# 计算每帧的重要性分数
query_expanded = query_encoded.unsqueeze(1).expand(-1, T, -1) # [B, T, D]
combined_features = torch.cat([video_features, query_expanded], dim=-1) # [B, T, 2D]
importance_scores = self.importance_scorer(combined_features).squeeze(-1) # [B, T]
# 结合马氏距离调整分数... | Python | 1 |
Node::KeyValue {
path: loc,
name: name.clone(),
value: rkv.value.clone(),
};
Ok(n)
} else {
let dir = Node::Directory {
path: loc,
nodes: vec![],
... | Rust | 0 |
= self.board.piece_two_bb_both_players(PieceType::R, PieceType::Q)
& rook_moves(self.board.occupied(), s) & forward_file_bb(them, s);
if (self.board.get_occupied_player(us) & bb).is_empty() {
defended_squares &= self.attacked_by[us as usize][PieceTy... | Rust | 0 |
f == PACKAGE_A::_0111
}
#[doc = "Checks if the value of the field is `_1000`"]
#[inline(always)]
pub fn is_1000(&self) -> bool {
*self == PACKAGE_A::_1000
}
}
#[doc = "Reader of field `REVID`"]
pub type REVID_R = crate::R<u8, u8>;
#[doc = "RAM size\n\nValue on reset: 0"]
#[derive(Clone, Copy... | Rust | 0 |
try_into!(try_into_fn, Fn, ObjFn);
try_into!(try_into_closure, Closure, ObjClosure);
try_into!(try_into_instance, Instance, ObjInstance);
try_into!(try_into_fiber, Fiber, ObjFiber);
try_into!(try_into_foreign, Foreign, ObjForeign);
}
#[derive(Debug, Default)]
pub struct SymbolTable {
names: Ve... | Rust | 0 |
pub fn strcasecmp(_: *const libc::c_char, _: *const libc::c_char) -> libc::c_int;
pub type _IO_wide_data;
pub type _IO_codecvt;
pub type _IO_marker;
}
pub type FILE = crate::stdlib::_IO_FILE;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _IO_FILE {
pub _flags... | Rust | 0 |
.assert_stats("mail_selected", ">=", "mail_deleted")
self.assert_stats(
"mail_selected", "in", ["mail_copied", "mail_moved", "mail_deleted"]
)
# Sets accounting.
self.assert_stats("set_total", "==", "mail_hashes")
self.assert_stats("set_single", "==", "mail_unique")
... | Python | 1 |
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `SRC4`"]
pub enum SRC4W {
#[doc = "Input 0. Selects pin interrupt input 0 as the source to bit slice 4."]
INPUT_0_SELECTS_PIN,
... | Rust | 0 |
ute_metrics(post_processed_eval)
logging.info("Evaluation metrics:")
for metric, value in metrics.items():
logging.info(f"{metric}: {value:.3f}")
if training_args.output_dir is not None:
output_eval_file = os.path.join(training_args.output_dir, "all_re... | Python | 1 |
price_tick=price_tick,
price_levels=price_levels_list,
buy_volumes=buy_volumes_list,
sell_volumes=sell_volumes_list,
buy_ticks=buy_ticks_list,
sell_ticks=sell_ticks_list,
buy_imbalances=buy_imbalances_list,
sell_imbalances=s... | Python | 1 |
=extend)
plt.colorbar()
@image_comparison(baseline_images=['contour_datetime_axis'],
extensions=['png'], remove_text=False)
def test_contour_datetime_axis():
fig = plt.figure()
fig.subplots_adjust(hspace=0.4, top=0.98, bottom=.15)
base = datetime.datetime(2013, 1, 1)
x = np.... | Python | 1 |
print(format!("[cycles] {}", err));
last_err = Some(err);
continue;
}
};
print(format!(
"[cycles] created canister {} in subnet {}",
canister_id, subnet_id
));
return Ok(canister_id);
}
Err(last_err.u... | Rust | 0 |
"""
if env_dv == "":
raise ValueError("env_dv is required (e.g. 'real' or 'demo')")
if ord_dv == "":
raise ValueError("ord_dv is required (e.g. 'usBuy', 'usSell', 'asia')")
if cano == "":
raise ValueError("cano is required (e.g. '12345678')")
if acnt_prdt_cd == "":
ra... | Python | 1 |
Assembly
/* No Output */: // Output
"m"(ptr) : // Input
/* No clobbered */: // Clobbered regs
"volatile", "intel"); // Options
}
}
/// Wrapper for VMWRITE
pub fn vmwrite(index: u32, value: u64) {
// print!("VMWRITE: {:#x} {:#x}\n", index, value);
unsafe ... | Rust | 0 |
ressible.rs<gh_stars>0
use crate::{
caching::*,
chunk_tree::ChunkNode,
compression::MaybeCompressed,
dev_prelude::{
ChunkStorage, ChunkTree, Compressed, Compression, FastArrayCompression,
FastChannelsCompression, FromBytesCompression, IterChunkKeys,
},
SmallKeyBuildHasher,
};
us... | Rust | 0 |
test_problem = test_sample.get('problem', '').strip()
print(f"\nTest sample {i} (index {test_idx}):")
print(f" Problem preview: {test_problem[:100]}...")
print(f" Problem length: {len(test_problem)} characters")
# Check if this test problem exists in training set
... | Python | 1 |
outputs::marked_deleted_at_height.desc())
.first(conn)
.optional()?)
}
/// Find a particular Output, if it exists
pub fn find(spending_key: &[u8], conn: &SqliteConnection) -> Result<OutputSql, OutputManagerStorageError> {
Ok(outputs::table
.filter(outputs::spendi... | Rust | 0 |
> Some(TokenKind::True),
"false" => Some(TokenKind::False),
"nil" => Some(TokenKind::Nil),
_ => None,
}
}
fn is_digit(c: u8) -> bool {
(b'0'..=b'9').contains(&c)
}
pub(super) fn is_whitespace(c: u8) -> bool {
c == 0x09 // tab
|| c == 0x0A // line feed
|| c ==... | Rust | 0 |
"linux"))]
use raw_window_handle::HasRawWindowHandle;
#[cfg(target_os = "windows")]
mod win;
#[cfg(target_os = "windows")]
use win as platform;
// We need to use this directly within the X11 window creation to negotiate the correct visual
#[cfg(target_os = "linux")]
pub(crate) mod x11;
#[cfg(target_os = "linux")]
pu... | Rust | 0 |
are 1-based.
KakouneRange {
start: KakounePosition {
line: start.line + 1,
column: start_byte + 1,
},
end: KakounePosition {
line: end_line + 1,
column: end_byte + 1,
},
}
}
fn kakoune_position_to_lsp_utf_8_code_points(position: &... | Rust | 0 |
rder=1020)
def _populate_buttons_config(self):
if not ButtonMenuItem.objects.filter(content_type=None).exists():
ButtonMenuItem.objects.create(
content_type=None, button_id='', order=1,
)
def _populate_bricks_config(self):
BrickDetailviewLocation.objects... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.