text string | label_name string | labels int64 |
|---|---|---|
new_privileges() {
assert_eq!(Ok(false), get_no_new_privileges());
}
#[test]
fn check_unalign() {
// if someone owns an alpha/ppc they can update this...
assert_eq!(Err(22), get_unaligned_access());
assert_eq!(Err(22), set_unaligned_access(PrctlUnalign::PR_UNALIGN_SIGBUS));
}
#[test]
fn check_keep_cap... | Rust | 0 |
from __future__ import annotations
from time import sleep
from beamngpy import BeamNGpy, Scenario, Vehicle, set_up_simple_logging
from beamngpy.sensors import PowertrainSensor
def test_powertrain(beamng: BeamNGpy):
with beamng as bng:
# Create a vehicle.
vehicle = Vehicle("ego_vehicle", model="e... | Python | 1 |
unt = await self._process_batch(db, pending_images)
return total_images, successful_ocr_count
finally:
db.close()
async def _run_loop(self):
"""持续运行处理任务"""
self.logger.info(f"OCR处理服务启动")
while self._running:
start_time = ... | Python | 1 |
onData: Self = Self(4096u32);
pub const PreserveRoamableApplicationData: Self = Self(128u32);
pub const RemoveForAllUsers: Self = Self(524288u32);
}
impl ::core::marker::Copy for RemovalOptions {}
impl ::core::clone::Clone for RemovalOptions {
fn clone(&self) -> Self {
*self
}
}
pub type SharedP... | Rust | 0 |
TY_ADJACENT_TO_SPACE), &map)?
}
Ok(())
})?;
with_turf_gases_write(|arena| {
arena.graph.retain_nodes(|graph, node_idx| {
graph
.node_weight(node_idx)
.map(|mix| !deletions.contains(&mix.id))
.unwrap_or(true)
});
arena.invalidate();
});
Ok(())
}
pub(crate) fn rebuild_turf_graph_no_invalidat... | Rust | 0 |
from sqlalchemy import Column, Integer, Float, ForeignKey
from app.database import Base
class Rating(Base):
__tablename__ = "ratings"
rating_id = Column(Integer, primary_key=True, index=True, autoincrement=True)
user_id = Column(Integer, ForeignKey("users.user_id", ondelete="SET NULL"), nullable=True)
... | Python | 1 |
pub(crate) inner: BTreeMap<u64, PathBuf>,
pub(crate) root: PathBuf,
}
impl SdkHeaders {
fn new(root: PathBuf) -> Self {
Self {
inner: BTreeMap::new(),
root,
}
}
#[inline]
fn get_relative_path<'path>(&self, path: &'path Path) -> anyhow::Result<&'path Path> ... | Rust | 0 |
24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M15.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM5 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5zm5.8-10l2.4-2.4.8.8c1.3 1.3 3 2.1 5.1 2.1V9c-1.5 0-2.7-.6-3.6-1.5l-1.... | Rust | 0 |
# core/presentation/admin/user_admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.html import format_html
from core.models import CustomUser
@admin.register(CustomUser)
class CustomUserAdmin(UserAdmin):
model = CustomUser
list_display = ['username', 'em... | Python | 1 |
eads = 56,
temporary_disk = 56,
weight = 56,
tres = '',
version = '', )
],
last_update = slurmrest_python.models.v0_0_41_openapi_nodes_resp_last_update.v0_0_41_openapi_nodes_resp_last_... | Python | 1 |
queue
#[serde(
default,
deserialize_with = "pubsub::deserialize_none_from_empty_string"
)]
pub resolver_id: Option<types::UserId>,
/// Username of who resolved the message in the queue
#[serde(
default,
deserialize_with = "pubsub::deserialize_none_from_empty_string"
... | Rust | 0 |
rm, mut gamestate: GS) -> Result<()> {
let now = Instant::now();
let mut prev_seconds = now.elapsed().as_secs();
let mut prev_ms = now.elapsed().as_millis();
let mut frames = 0;
// Panic handler to reset terminal
std::panic::set_hook(Box::new(|_| {
reset_terminal();
}));
'main:... | Rust | 0 |
n1 = int(input())
n2 = int(input())
nums = 0
for x in range(n1, n2+1):
cnt = 0
for y in range(1, n2+1):
if x % y == 0:
cnt += 1
if cnt == 4:
nums += 1
print('The number of RSA numbers between', n1, 'and', n2, 'is', nums) | Python | 1 |
import pytest
from rest_framework import status
@pytest.mark.parametrize(
'client_user, url, answer',
[
(
pytest.lazy_fixture('admin_client'),
pytest.lazy_fixture('url_holidays'),
status.HTTP_200_OK,
),
(
pytest.lazy_fixture('author_clien... | Python | 1 |
(Page::SIZE, 1),
(Page::SIZE / 2, 1),
(Page::SIZE + Page::SIZE / 2, 2),
(pages * Page::SIZE, pages),
];
for (s, allocated) in steps {
let addr = heap.mmap(0, s, PROT, FLAGS, -1, 0).unwrap();
for pag... | Rust | 0 |
[..CIPHERKEYLEN], 0);
}
}
<filename>src/rpc.rs
use std::sync::Arc;
use tdn::types::{
group::GroupId,
primitive::{HandleResult, PeerAddr},
rpc::{json, RpcError, RpcHandler, RpcParam},
};
use tokio::sync::RwLock;
use crate::layer::Layer;
use crate::manager::Manager;
pub(crate) struct RpcState {
pub... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
from detectron2.utils.registry import Registry
ROI_DENSEPOSE_HEAD_REGISTRY = Registry("ROI_DENSEPOSE_HEAD")
| Python | 1 |
t parts = mem.split("] = ");
let addr = parts.next().unwrap().parse().unwrap();
let value = parts.next().unwrap().parse().unwrap();
Op::Mem(addr, value)
}
}
}
#[cfg(test)]
mod tests {
use super::*;
use aoc2020::Solution;
#[test]
fn test() {
let (... | Rust | 0 |
the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR O... | Rust | 0 |
et (extracted_type, subrow) = row_add(state, id, ty, *r2)?;
Ok((
extracted_type,
TypeWrapper::Concrete(AbsType::RowExtend(id2, ty2, Box::new(subrow))),
))
}
}
TypeWrapper::Ptr(root) => {
if let Some(set) = st... | Rust | 0 |
from abc import ABC, abstractmethod
from like.admin.schemas.setting import SettingWebsiteIn
from like.utils.config import ConfigUtil
from like.utils.urls import UrlUtil
class ISettingWebsiteService(ABC):
"""网站信息配置服务抽象类"""
@abstractmethod
async def detail(self) -> dict:
pass
@abstractmethod
... | Python | 1 |
None = 0,
Min = 1,
Max = 2,
Fixed = 3,
}
/// Webview wrapper
#[derive(Clone)]
pub struct Webview {
inner: Arc<wv::webview_t>,
}
unsafe impl Send for Webview {}
unsafe impl Sync for Webview {}
impl Drop for Webview {
fn drop(&mut self) {
if Arc::strong_count(&self.inner) == 0 {
... | Rust | 0 |
4;
if config.show_progress {
bar.set_job_title("Syncing CVE Data");
bar.reach_percent((synced as f32 / to_sync as f32 * 100.0).round() as i32);
}
create_schema(&config.db)?;
let feeds = get_metafiles(config)?;
for feed in feeds {
let mut last_modified = None;
if ... | Rust | 0 |
radius_pre = ::std::option::Option::None;
self.offset_detection_blast_radius_post = ::std::option::Option::None;
self.offset_detection_max_distance_pre = ::std::option::Option::None;
self.offset_detection_max_distance_post = ::std::option::Option::None;
self.unknown_fields.clear();
}... | Rust | 0 |
rs
use crate::color::Color;
use crate::text::Text;
use crate::widget::Widget;
use skulpin::skia_safe::Canvas;
use skulpin::skia_safe::Paint;
use typetag::serde::{Deserialize, Deserializer, Serialize};
#[allow(dead_code)]
#[derive(Serialize, Deserialize) ]
pub struct Label {
#[serde(default = "default_position")]
... | Rust | 0 |
ic.return_message(-1, 0, public.lang('安装任务已存在'))
else:
execstr = "cd /www/server/panel/install && /bin/bash vhost_virtual.sh install"
public.M('tasks').add('id,name,type,status,addtime,execstr', (
None, '安装 [宝塔多用户虚拟主机面板]', 'execshell', '0', time.strftime('%Y-%m-%d %H:%M:%S'),... | Python | 1 |
),
("DISCRIMINATOR", discrim if re.match(pattern, discrim) else ""),
("BOT", str(meta_data[int(data)][2]), PARSE_MODE_NONE),
("CREATED_AT", str(creation_time), PARSE_MODE_NONE),
("JOINED_AT", str(joined_time), PARSE_MODE_NONE),
... | Python | 1 |
await?;
get_input_value(&html, "#developerProductIcon input[id=\"assetId\"]")?
.parse()
.map_err(|_| RobloxApiError::ParseAssetId)
}
pub async fn create_developer_product(
&self,
experience_id: AssetId,
name: String,
price: u32,
descripti... | Rust | 0 |
# This file automatically generated by skymarshal
# DO NOT MODIFY BY HAND
# fmt: off
# isort: off
# mypy: disallow-untyped-defs
import copy
import typing as T # pylint: disable=unused-import
from io import BytesIO
import struct
class inputs_constants_t(object):
__slots__: T.List[str] = ["epsilon"]
def __in... | Python | 1 |
from .ShippingCalculator import ShippingCalculator
from .LowerPackageCalculator import LowerPackageCalculator
from .FreePackageCalculator import FreePackageCalculator
from .MaxDiscountCalculator import MaxDiscountCalculator
| Python | 1 |
ut hash = hasher.finish();
truncate_hash(&mut hash);
hash
}
/// Truncate a given 32 byte hash, into a valid Fr bytes representation.
#[inline]
pub fn truncate_hash(hash: &mut [u8]) {
assert_eq!(hash.len(), 32);
// strip last two bits, to ensure result is in Fr.
hash[31] &= 0b0011_1111;
}
/// Read... | Rust | 0 |
'Content-Type': 'application/x-amz-json-1.1',
'Content-Length': str(len(body)),
}
http_request_kwargs = {
'method':'POST', 'path':'/', 'auth_path':'/', 'params':{},
'headers': headers, 'data':body
}
if host is not None:
headers['Host'... | Python | 1 |
rtyConsoleCmd._debug("do_rtn %r", args)
# provide the address and a list of network numbers
router_address = Address(args[0])
network_list = [int(arg) for arg in args[1:]]
# pass along to the service access point
this_application.nsap.update_router_references(
None,... | Python | 1 |
solver().into_rc(),
);
inner.add_entry(
"chrono::NaiveDateTime".to_string(),
solve_datetime.fn_solver().into_rc(),
);
inner.add_entry(
"chrono::NaiveTime".to_string(),
solve_datetime.fn_solver().into_rc(),
);
ChronoSolver {... | Rust | 0 |
j, item in enumerate(kc):
if item in base_joints:
index = j
break
if index == 0:
raise NameError("No base finger joint found")
finger_info[str(i)]["finger_plane_joint_index"] = j
#Add finger width
finger_info[str(i)]["finger_width"... | Python | 1 |
to_2tuple = _ntuple(2)
to_3tuple = _ntuple(3)
to_4tuple = _ntuple(4)
to_ntuple = lambda n, x: _ntuple(n)(x)
def is_logging(args):
def is_global_master(args):
return args.rank == 0
def is_local_master(args):
return args.local_rank == 0
def is_master(args, local=False):
return is_l... | Python | 1 |
# 提示API访问信息
print("\n" + "-"*70)
print(
f"✅ 后端API服务已启动 - 访问 http://localhost:{args.backend_port}/docs 查看API文档")
if run_id:
print(f"📝 可通过API查看Agent执行历史和推理过程")
print(f"🆔 本次运行ID: {run_id}")
print(f"🔄 可通过 POST /analysis/start 接口触发新的股票分析")
print("-"*70)
# 保持程序运行,让后端服务... | Python | 1 |
.fathom");
test!(fail_invalid_ann, "struct/fail_invalid_ann.fathom");
test!(fail_missing_ann, "struct/fail_missing_ann.fathom");
test!(fail_missing_closing_brace, "struct/fail_missing_closing_brace.fathom");
test!(fail_missing_fields, "struct/fail_missing_fields.fathom");
test!(fail_missing_name, "s... | Rust | 0 |
import yaml
with open("./config.yaml", 'r') as f:
cfg = yaml.load(f, Loader=yaml.Loader);
print(cfg)
control_bits = {}
for i in range(len(cfg['control_bits'])):
control_bits[cfg['control_bits'][i]] = 1 << i
print("{:016b}".format(control_bits[cfg['control_bits'][i]]))
rom = [0 for i in range(128)]
for key, in... | Python | 1 |
3, radius: f32) -> f32 {
let d2 = dot(¢er, ¢er);
let a = (d2 - radius * radius).sqrt();
// view-aligned "right" vector (right angle to the view plane from the center of the sphere. Since "up" is always (0,n,0), replaced cross product with vec3(-c.z, 0, c.x)
let right = (radius / a) * vec3(-cen... | Rust | 0 |
L_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible"]
#[doc = " - \\ref NVML_ERROR_UNKNOWN on any unexpected error"]
pub fn nvmlDeviceGetEnforcedPowerLimit(
device: nvmlDevice_t,
limit: *mut ::std::os::raw::c_uint,
) -> nvmlReturn... | Rust | 0 |
from flask import Flask, request, jsonify
import json
import time
import requests
from server_agg import *
from datetime import datetime
import csv
app = Flask(__name__)
shares1= []
count1 = 0
def combine1(data):
global count1
global shares1
count1 += 1
data_str = data.decode('utf-8')
data_dict = ... | Python | 1 |
t = None
index_meta = SearchIndexMeta(fields, index_setting=index_setting, index_sort=index_sort) # default with index sort
client.create_search_index(table_name, index_name, index_meta)
def delete_table():
try:
client.delete_table(table_name)
except:
pass
def delete_search_index(in... | Python | 1 |
+ left_offset.unwrap() + 1).into();
}
(balance, addr)
}
}
impl<K: Ord, Q: ?Sized, V, C: Collection<Item = Node<K, V>> + Len + Get<usize>> Index<&Q> for BTreeMap<K, V, C>
where
K: Borrow<Q>,
Q: Ord,
{
type Output = V;
/// Returns a reference to the value corresponding to the supplied key.
///
/// # Panics... | Rust | 0 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import requests
import os
import csv
import openpyxl
from datetime import datetime
from bs4 import BeautifulSoup
# In[2]:
url = 'https://cafef.vn/du-lieu/hose/fpt-cong-ty-co-phan-fpt.chn'
# In[4]:
response = requests.get(url)
soup = BeautifulSoup(response.conten... | Python | 1 |
}
pub fn handle_stale_msg(
&mut self,
msg: &RaftMessage,
cur_epoch: RegionEpoch,
need_gc: bool,
target_region: Option<metapb::Region>,
) {
let region_id = msg.get_region_id();
let from_peer = msg.get_from_peer();
let to_peer = msg.get_to_peer(... | Rust | 0 |
def main():
# Set some values
DISCOUNT = 0.15
# Ask to the user for a num
while True:
try:
num = float(input("Sartu ezazu zenbaki bat: "))
break
except:
print('Zure erantzuna ez du balio, saiatu berriz...')
pass
# Print the result
... | Python | 1 |
#[doc = ""]
#[doc = " \\return none"]
pub fn GX_SetScissorBoxOffset(xoffset: s32, yoffset: s32);
}
extern "C" {
#[doc = " \\fn void GX_SetNumChans(u8 num)"]
#[doc = " \\brief Sets the number of color channels that are output to the TEV stages."]
#[doc = ""]
#[doc = " \\details Color channels a... | Rust | 0 |
unks();
let mut chunk_itr_2 = other.chunks();
let mut chunk1 = chunk_itr_1.next().unwrap_or("").as_bytes();
let mut chunk2 = chunk_itr_2.next().unwrap_or("").as_bytes();
loop {
if chunk1.len() >= chunk2.len() {
let compared = chunk1[..chunk2.len()].cmp(chunk2... | Rust | 0 |
xs = [x.strip('\n') for x in open('p3.txt').readlines()]
xs = [int(x) for x in xs]
least = 99999999999
for x in xs:
shortest = x
ct = 0
for y in xs:
ct += abs(shortest-y)
if ct < least:
least = ct
print(least) | Python | 1 |
mlformatter
mocked_formatter = Mock()
mocked_formatter.settings = {'codeformatter_html_options': {}}
formatter = htmlformatter.HtmlFormatter(mocked_formatter)
res = formatter.format_with_beautifier('another one')
htmlbeautifier.beautify.assert_called_once_with(
'another one', fake_options... | Python | 1 |
4(self):
mod, stats = self.check(self.fanout_raise_4)
self.assertEqual(stats.fanout_raise, 0)
fanout_raise_5 = r"""
define i32 @main(i8* %ptr, i1 %cond, i8** %excinfo) {
bb_A:
call void @NRT_incref(i8* %ptr)
br i1 %cond, label %bb_B, label %bb_C
bb_B:
call void @NRT_decref(i8* %ptr)
... | Python | 1 |
r mask production here, but
/// they must satisfy the invariants listed below.
///
/// # Parameters
///
/// - `cursor`: The semantic bit index.
///
/// # Returns
///
/// A one-hot encoding of the provided `cursor`’s electrical position in the
/// `T` element`.
///
/// # Type Parameters
///
/// - `T`: the ... | Rust | 0 |
])
),
];
#[inline(always)]
fn mul_fp_by_nonresidue(x: &Self::Fp) -> Self::Fp {
// times 7
let mut y = x.clone();
y.double_in_place(); // 2x
y += x; // 3x
y.double_in_place(); // 6x
y += x; // 7x
y
}
}
#[cfg(test)]
mod test {
... | Rust | 0 |
#!/usr/bin/env python3
"""
流程测试运行脚本
运行所有流程相关的测试
"""
import sys
import subprocess
from pathlib import Path
def run_flow_tests():
"""运行流程测试"""
print("🔄 运行流程测试套件")
print("=" * 40)
tests_dir = Path(__file__).parent
flow_tests = [
"flow/test_input_function.py",
"flow/test_us... | Python | 1 |
# Copyright 2021 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 |
::exchange(&pk1, &sk2);
let key2 = ::crypto::ed25519::exchange(&pk2, &sk1);
assert_eq!(key1, key2);
}
#[test]
fn curve_roundtrip2() {
use rand::RngCore;
let mut sk1 = [0u8; 32];
let mut sk2 = [0u8; 32];
::rand::OsRng::new().expect("random works").fill_bytes(&... | Rust | 0 |
impl Results {
pub fn calc_total(rolls: &Vec<Roll>) -> i64 {
rolls.iter().filter(|r| r.keep ).map(|r| r.total).sum()
}
pub fn total(&self) -> i64 {
Results::calc_total(&self.rolls) + self.modifier
}
pub fn keep(&self) -> usize {
self.rolls.iter().filter(|r| r.keep ).map(|_|... | Rust | 0 |
xis=1)
y_train = train_processed['Degerlendirme Puani']
X_test = test_processed.drop(['Degerlendirme Puani', 'id', 'Basvuru Yili'], axis=1)
# Identify categorical features (CatBoost handles these automatically)
categorical_features = [col for col in X_train.columns if X_train[col].dtype == 'object']
# Set up the para... | Python | 1 |
0x7F, 0x00, 0x00,
0x00, 0x00, 0x00, 0x26, 0x6F, 0x49, 0x49, 0x7B, 0x32, 0x00, 0x7F, 0x7F, 0x49, 0x49, 0x41, 0x00,
0x7F, 0x7F, 0x19, 0x39, 0x6F, 0x46, 0x00, 0x0F, 0x1F, 0x30, 0x60, 0x30, 0x1F, 0x0F, 0x00, 0x41,
0x7F, 0x7F, 0x41, 0x00, 0x3E, 0x7F, 0x41, 0x41, 0x63, 0x22, 0x00, 0x7F, 0x7F, 0x49, 0xFF, 0xFF,
]... | Rust | 0 |
passes through string data without JSON serialization.
"""
queue = NotificationQueue(client=mock_redis_client)
task_data = "simple_task"
queue.enqueue(task_data)
mock_redis_client.lpush.assert_called_once_with(queue.queue_name, task_data)
def test_dequeue_malformed_json(mock_redis_client):
... | Python | 1 |
def laske_yksikköhinta(halkaisija, hinta):
pinta_ala = (halkaisija / 2) ** 2 * 3.14159
yksikköhinta = hinta / pinta_ala
return yksikköhinta
#pizza 1
halkaisija1 = float(input("Syötä ensimmäisen pizzan halkaisija (senttimetreinä): "))
hinta1 = float(input("Syötä ensimmäisen pizzan hinta (euroina): "))
#piz... | Python | 1 |
import subprocess
import os
import httpx
file = open('pubspec.yaml', 'r')
content = file.read()
file.close()
subprocess.run(["flutter", "build", "windows"], shell=True)
if os.path.exists("build/app-windows.zip"):
os.remove("build/app-windows.zip")
version = str.split(str.split(content, 'version: ')[1], '+')[0]
... | Python | 1 |
e<N> {
/// Returns the value, if this coin has already decided.
fn value(&self) -> Option<bool> {
match self {
CoinState::Decided(value) => Some(*value),
CoinState::InProgress(_) => None,
}
}
}
impl<N> From<bool> for CoinState<N> {
fn from(value: bool) -> Self {
... | Rust | 0 |
use std::ffi::{CStr, CString, OsStr, OsString};
impl JsonSchema for OsString {
fn schema_name() -> String {
"OsString".to_owned()
}
fn json_schema(gen: &mut SchemaGenerator) -> Schema {
let mut unix_schema = SchemaObject::default();
unix_schema.instance_type = Some(InstanceType::Ob... | Rust | 0 |
.
pub const PUT_OBJECT_LEGAL_HOLD_ACTION: &str = "s3:PutObjectLegalHold";
// GET_BUCKET_OBJECT_LOCK_CONFIGURATION_ACTION - GetObjectLockConfiguration Rest API action
pub const GET_BUCKET_OBJECT_LOCK_CONFIGURATION_ACTION: &str = "s3:GetBucketObjectLockConfiguration";
// PUT_BUCKET_OBJECT_LOCK_CONFIGURATION_ACTION - Put... | Rust | 0 |
9')
initial_state = swap_and_create_new_state(initial_state, blank_index, path)
print_grid(initial_state)
# 이미지 배열 동기화
imgs = [cv2.cvtColor(cv2.imread(img_dict[num]), cv2.COLOR_BGR2RGB) for row in initial_state for num in row]
# 이미지 서브플롯에 표시
for i in range(9):
... | Python | 1 |
from pathlib import Path
print(Path('.').absolute()) # /home/volodymyr/git/My_way_to_Junior
# print(type(Path)) # <class 'module'>
# file_path = Path('222.txt')
# print([i for i in dir(file_path) if not i.startswith('_')])
print(Path.cwd()) # cwd - current working directory
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>... | Python | 1 |
t::ProtoBare => {}
}
let def_id = ast_util::def_id_of_def(cap_var.def);
fcx.llupvars.insert(def_id.node, upvarptr);
i += 1u;
}
}
}
if load_ret_handle {
let flagptr = Load(bcx, GEPi(bcx, llcdata, [0u, i]));
let retptr = Load(bcx,
... | Rust | 0 |
AXS,
LAX,
SAX,
// RMW instructions - Read, modify, write
DCP,
ISC,
RLA,
RRA,
SLO,
SRE,
// Below is just a helper for unknown opcode. Useful when disassembling and you hit data and not
// instruction.
UNK,
}
#[derive(Debug, PartialEq, Clone, Copy)]
/// List of the ad... | Rust | 0 |
ity + 'static,
F: Into<T> + Component<E> + 'static,
T: Into<F> + Component<E> + 'static,
W: ComponentBackend<E, F> + Sync + Send,
{
fn load(&self, entity: &E) -> Result<Option<T>> {
Ok(self
.wrapped
.load(entity)?
.map(|other_type: F| other_type.into()))
}... | Rust | 0 |
2.0);
assert_eq!(Handicap::from_str("2.0").unwrap().0, 2.0);
assert_eq!(Handicap::from_str("2.5").unwrap().0, 2.5);
}
#[test]
fn test_handicap_from_str_errors() {
assert!(Handicap::from_str("3w5").is_err());
assert!(Handicap::from_str("3w8").is_err());
}
#[test]
... | Rust | 0 |
_ITEM_POSITION: InputTouchItem = 2;
pub const TM_INPUT_TOUCH_ITEM_PRESSURE: InputTouchItem = 3;
pub const TM_INPUT_TOUCH_ITEM_ORIENTATION: InputTouchItem = 4;
pub const TM_INPUT_TOUCH_ITEM_COUNT: InputTouchItem = 5;
pub type InputTouchItem = ::std::os::raw::c_int;
pub const TM_INPUT_KEYBOARD_ITEM_NONE: InputKeyboardIte... | Rust | 0 |
to_str() {
_ => self.make_link_to_file(note_ref),
};
Ok(events)
}
}
pub fn events_to_text(markdown: Vec<Event>) -> String {
let mut buffer = String::new();
cmark_with_options(
markdown.iter(),
&mut buffer,
None,
pulldown_cmark_to_cmark::Options::... | Rust | 0 |
(&value, &rate))| {
FastBound::new(value / rate, FastOrigin::Bottleneck(id, level))
})
.chain(iter::once(latency))
.max();
unwrap!(bound)
}
/// Adds the pressure of another computation, performed in parallel.
pub fn add_parallel(&mut self, other:... | Rust | 0 |
l=[1,82,44,6,1,1]
print(l)
# l.append(8)
# print(l)
# l.sort()
# print(l)
# l.reverse()
# print(l.index(82))
# print(l.count(44))
#l.remove(82)
# m=l.copy()
# m[0]=0
# l.insert(1,899) #.inser(index,value)
m=[900,1000,1100]
# l.extend(m)
# print(l)
print(m+l)
| Python | 1 |
o_all, create_multiple_normal_role,
create_recv_mpst_session_bundle, create_send_mpst_session_bundle, offer_mpst,
};
use rand::{thread_rng, Rng};
use std::error::Error;
use std::marker;
// See the folder scribble_protocols for the Scribble protocol
// Create the new MeshedChannels for three participants and the... | Rust | 0 |
distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2017 The developers of css-autoprefix. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/css-autoprefix/master/COPYRIGHT.
type VendorPrefixedVariants = Ha... | Rust | 0 |
st.mark.converter
# @pytest.mark.slow
# @pytest.mark.skipif(SRC_DIR_EXISTS, reason="Requires presence of the source datasets.")
# def test_seasonet():
# from make_benchmark.dataset_converters import seasonet
# converter_tester(seasonet)
if __name__ == "__main__":
test_brick_kiln()
# test_cv4a_kenya_c... | Python | 1 |
astype('str')
if len(anomalies) == len(df):
anomalies = pd.concat(
(anomalies, df['human_label']), axis=1, join='inner')
except FileNotFoundError:
pass
# This is the active learning object that will be run on demand by the
# frontend
pipeline_act... | Python | 1 |
# -*- coding: utf-8 -*-
''' Group points by distance.'''
import geom
from geom_utils import group_by_distance as gbd
__author__= "Luis C. Pérez Tato (LCPT)"
__cppyright__= "Copyright 2025 LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@ciccp.es"
points3d= [geom.Pos3d(4366.47, 5276.77, 10.7786), g... | Python | 1 |
fn XSetWMColormapWindows (_4: *mut Display, _3: c_ulong, _2: *mut c_ulong, _1: c_int) -> c_int,
pub fn XSetWMHints (_3: *mut Display, _2: c_ulong, _1: *mut XWMHints) -> c_int,
pub fn XSetWMIconName (_3: *mut Display, _2: c_ulong, _1: *mut XTextProperty) -> (),
pub fn XSetWMName (_3: *mut Display, _2: c_ulong, _1... | Rust | 0 |
ytick.labelsize'] = label_size
density_contour(rn[:,0], rn[:,1], 80, 80, ax=ax, colors=['red','white','yellow','red']) #colors follow order of contour levels
# Save to a file
plt.savefig('Lab7_FaceOn_Density.png')
print('## Part C ##')
# # Part C
#
# a) Create a scatter plot of the edge on disk particles, weighted... | Python | 1 |
'''Escreva um programa que leia três notas de um aluno, calcule e escreva a média final deste aluno. Considerar que a média é ponderada e que o peso das notas são 2, 3 e 5. Fórmula para o cálculo da média final é:
média ponderada = ((n1 * 2) + (n2 * 3) + (n3 * 5)) / 10'''
n1 = float(input())
n2 = float(input())
n3 = f... | Python | 1 |
char,
effect_name: *const ::std::os::raw::c_char,
time_scalar: f64,
metadata: *mut AnyDictionary,
) -> *mut LinearTimeWarp;
}
extern "C" {
pub fn LinearTimeWarp_time_scalar(self_: *mut LinearTimeWarp) -> f64;
}
extern "C" {
pub fn LinearTimeWarp_set_time_scalar(self_: *mut LinearTime... | Rust | 0 |
expr,
$water_pokemon:expr,
$patch_offset:expr,
$patch_data:expr
) => {
#[test]
#[ignore]
#[allow(non_snake_case)]
fn $test_name() {
let db = common::load_rom();
match db.set_map_pokemon(
&$map_id,
&MapPo... | Rust | 0 |
0, 0]
if 0 in np.sum(connected_matrix, axis=0):
return [0, 1, 0]
cluster_sizes = []
clusters = []
visited = [False for item in range(n_atoms)]
connected_matrix += np.eye(len(connected_matrix))
def visit(atom, atom_cluster):
visited[atom] = True
new_cluster = set(np.whe... | Python | 1 |
///
/// Note that due to the nature of floating-point arithmetic, it is uncertain whether the
/// resulting new AAB position will have the AAB's forward face land before, after, or
/// exactly on the boundary. The caller must compute an appropriate nudge (using TODO:
/// provide a function for this) to serve its needs... | Rust | 0 |
for i in feed:
name = i.user.userName
content = i.content if hasattr(i, 'content') else '送 ' + gift.get(i.giftId, '') \
if hasattr(i, 'giftId') else '点亮了 ❤'
info = {'name': name, 'content': content, 'msg_... | Python | 1 |
assert_eq!(
Mailbox {
local: "john".to_string(),
domain: "nexium.app".into()
},
res
);
assert_eq!("", rem);
}
#[test]
fn parse_mailbox_numbered() {
let (rem, res) = parse_mailbox("1234567890@nexium.<EMAIL>").unwrap();
assert_eq!(
Mailbox {
... | Rust | 0 |
[0]), y=float(bbox_center[1]), z=0.0)
# msg.width = float(width)
# msg.height = float(height)
# msg.distance = float(depth_value)
# # 발행 전 메시지 정보 로그
# self.get_logger().info(f"IdDistanceInfo message prepared: {msg}")
# self.publisher_id_distance.publish(... | Python | 1 |
def apple():
print("This is an Apple.")
def banana():
print("This is a Banana.")
def orange():
print("This is an Orange.")
| Python | 1 |
nstalled_count();
let mut device: k4a_device_t = ptr::null_mut();
if device_count == 0 {
println!("No K4A devices found");
return None;
}
if k4a_device_open(0, &mut device) != k4a_buffer_result_t_K4A_BUFFER_RESULT_SUCCEEDED {
println!("Failed to open ... | Rust | 0 |
import socket
print(' =========== 13.4 基于TCP的数据转换 ===========')
def main():
# 创建套接字server_socket
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 绑定地址
server_socket.bind(("", 5678))
# 设置最大连接数
server_socket.listen(5)
# 创建连接
client_socket, address = server_socket.... | Python | 1 |
import pytest
@pytest.fixture(params=[True, False])
def check_dtype(request):
return request.param
@pytest.fixture(params=[True, False])
def check_exact(request):
return request.param
@pytest.fixture(params=[True, False])
def check_index_type(request):
return request.param
@pytest.fixture(params=[0.... | Python | 1 |
-rt and dlmalloc needs some libc installed headers:
// but compiler-rt and dlmalloc must be built before musl.
fn musl_includes(&self, clang: &mut clang_driver::Invocation) {
let include = self.get_musl_root().join("include");
let arch_include = self.get_musl_root().join("arch/wasm32");
let generic_incl... | Rust | 0 |
use super::*;
impl<'a, T: 'a> Format for core::slice::ChunksExact<'a, T>
where
T: Format,
{
fn format(&self, fmt: Formatter) {
crate::write!(fmt, "ChunksExact(..)")
}
}
impl<'a, T: 'a> Format for core::slice::Iter<'a, T>
where
T: Format,
{
fn format(&self, fmt: Formatter) {
crate::... | Rust | 0 |
import io
from rest_framework import serializers
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from drf.models import Women
# Роль сериализатора: конвертирование произвольных обьектов языка python в формат json, в том числе обьекты моделей
# и кверисеты, и наоборои ... | Python | 1 |
}
#[doc = "Checks if the value of the field is `NORMAL`"]
#[inline]
pub fn is_normal(&self) -> bool {
*self == MAINREGSTATUSR::NORMAL
}
#[doc = "Checks if the value of the field is `HIGH`"]
#[inline]
pub fn is_high(&self) -> bool {
*self == MAINREGSTATUSR::HIGH
}
}
impl R... | Rust | 0 |
++ does not
/// asymptotically improve over HLL).
/// * CPC allocates, whereas certain HLL implementations may not.
///
/// To give you a sense of CPC performance, the [linked benchmarks][benches] show
/// CPC requiring only 2.5KB of space for recovering a billion distinct values
/// well within 5% relative error e... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.