text string | label_name string | labels int64 |
|---|---|---|
日期",
"高管姓名",
"期末市值",
"成交均价",
"证券代码",
"变动比例",
"变动数量",
"截止日期",
"期末持股数量",
"期初持股数量",
"变动人与董监高关系",
"董监高职务",
"董监高姓名",
"数据来源",
"持股变动原因",
]
temp_df = temp_df[
[
"证券代码",
"证券简称",... | Python | 1 |
import os
from pytest import MonkeyPatch
import openhands.agenthub # noqa: F401
from openhands.utils.microagent import MicroAgent
CONTENT = (
'# dummy header\n' 'dummy content\n' '## dummy subheader\n' 'dummy subcontent\n'
)
def test_micro_agent_load(tmp_path, monkeypatch: MonkeyPatch):
with open(os.path.... | Python | 1 |
oints: bool,
}
#[derive(BorshDeserialize, BorshSerialize, Serialize, Deserialize, Eq, PartialEq, Clone)]
#[serde(crate = "near_sdk::serde")]
pub struct Contact {
pub category: ContactCategory,
pub user_id: UserAccountId,
}
#[ext_contract(ext_self)]
pub trait ExtNearTips {
fn on_withdraw(&mut self, predec... | Rust | 0 |
#!/usr/bin/env python3
"""
Setup script for CV Maker Inteligente project.
This script installs dependencies and sets up the development environment.
"""
import subprocess
import sys
import os
def run_command(command, description):
"""Run a command and handle errors."""
print(f"🔄 {description}...")
try:
... | Python | 1 |
(MissingRequiredArgument("head-name".to_string()))?;
let head_selector = matches
.value_of("head-selector")
.context(MissingRequiredArgument("head-selector".to_string()))?;
// validate the existence of tail and head nodes
let tail_type = tail_type_str
.parse::<NodeType>()
.ma... | Rust | 0 |
Some("%="),
BinOp::BitXor => Some("^="),
BinOp::BitAnd => Some("&="),
BinOp::BitOr => Some("|="),
BinOp::Shl => Some("<<="),
BinOp::Shr => Some(">>="),
_ => None,
}
}
}
impl ToTokens for BinOp {
... | Rust | 0 |
// @severity: the severity of the error
/// @locator: a locator indicating where the error occured
///
/// Signature of an error callback from a reader parser
pub type xmlTextReaderErrorFunc = ::std::option::Option<
unsafe extern "C" fn(
arg: *mut ::std::os::raw::c_void,
msg: *const ::std::os::raw::c_char,
... | Rust | 0 |
"""filters
Revision ID: e664a2f70952
Revises: ddd2ec3a72f2
Create Date: 2022-10-19 11:30:19.374693
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'e664a2f70952'
down_revision = 'ddd2ec3a72f2'
branch_labels = None
depen... | Python | 1 |
32 = 512;
pub const TPM2_LABEL_MAX_BUFFER: u32 = 32;
pub const TPM2_PCR_SELECT_MAX: u32 = 4;
pub const TPM2_PRIVATE_VENDOR_SPECIFIC_BYTES: u32 = 1280;
pub const TPMA_LOCALITY_EXTENDED_SHIFT: u32 = 5;
pub const TPMA_CC_COMMANDINDEX_SHIFT: u32 = 0;
pub const TPMA_CC_CHANDLES_SHIFT: u32 = 25;
pub const TPMA_CC_RES_SHIFT: ... | Rust | 0 |
variate Gaussian distribution:
mean = np.mean(gaussian_points, axis=0)
covariance = np.cov(gaussian_points, rowvar=False)
# then generate new Gaussian samples and map back through the invertible network:
new_gaussian_samples = np.random.multivariate_normal(mean, covariance, num_gen_images)
new_gaussian_samples_tf = tf.... | Python | 1 |
cpuprofiler::PROFILER
.lock()
.unwrap()
.start("./profile")
.unwrap();
}
}
let mut wait_for_events = false;
loop {
let start_frame = Instant::now();
let mut new_events: Vec<Event> = Vec::new();
ev... | Rust | 0 |
R12 => "r12w".to_string(),
X86Reg::R13 => "r13w".to_string(),
X86Reg::R14 => "r14w".to_string(),
X86Reg::R15 => "r15w".to_string()
}
} else if size == 32 {
match reg {
X86Reg::AH => "ah".to_string(),
X86Reg::AL => "al".to_string(),
... | Rust | 0 |
s["umap2"] = embedding[:, 1]
# # plot the UMAP representation
sns.scatterplot(
data=(
connectomes_dropped
if cov == "Graphical-Lasso"
else connectomes
),
x="umap1",
y="umap2",
hue="dataset",
... | Python | 1 |
self.optimizer.zero_grad()
total_loss.backward()
self.optimizer.step()
sum_total_loss_mini_batch += total_loss
sum_policy_loss_mini_batch += policy_loss
sum_value_loss_mini_batch += value_loss
sum_total_loss += sum_tota... | Python | 1 |
feature = text_enc_infer_request.infer(input_data)[text_enc_output_tensor]
feature = np.reshape(feature, (feature.shape[0], feature.shape[1], -1))
feature = np.transpose(feature, (0, 2, 1))
hidden = np.zeros(hidden_shape)
prev_symbol_index = np.ones((1,)) * S... | Python | 1 |
# ---------- explicit Euler step (inviscid) --------------
_rusanov_step(rho, mom, E, dx, dt)
# ---------- implicit viscosity ---------------------------
eps = E - 0.5 * mom**2 / rho # internal energy before filter
_viscosity_filter(rho, mom, dt, nu, ksq)
... | Python | 1 |
ated. Set this to the value of the
Marker element in the response you just received.
:type max_items: int
:param max_items: Use this only when paginating results and only in a
follow-up request to indicate the maximum number of
... | Python | 1 |
config: Config,
repository: Repository,
}
/// TODO: documentation
impl Service {
/// TODO: documentation
#[must_use]
pub const fn new(config: Config, repository: Repository) -> Self {
Self { config, repository }
}
}
/// TODO: documentation
impl Service {
/// TODO: documentation
#... | Rust | 0 |
ing Instagram mobile app headers"
])
if self.successful_requests == 0:
recommendations.extend([
"🔑 Verify alx.trading session is still valid",
"🌐 Check network connectivity to Instagram",
"🛡️ Try using VPN or different IP address",
... | Python | 1 |
from selenium.webdriver.common.by import By
class AnimePageLocators:
# Локаторы для элементов страницы 'AnimePage'
# Кнопки "Посмотреть" и "Трейлер"
WATCH_BUTTON = (By.CSS_SELECTOR, '[alt="eye"]') # Посмотреть как сделать лучше(сейчас указывает на картинку с глазом)
TRAILER_BUTTON = (By.CLASS_NAME, '... | Python | 1 |
space_members {
let package = &metadata[id];
let name = &package.name;
id_by_name.insert(name.clone(), id.clone());
for dep in &package.dependencies {
dep_names_by_name.entry(name.clone()).or_default().push(dep.name.clone());
}
}
let member_names = id_by_nam... | Rust | 0 |
command_handle,
info.m_u_index,
max_vel,
);
}
ffi::b3JointControlSetDesiredPosition(command_handle, info.m_q_index, pos);
ffi::b3JointControlSetKp(command_hand... | Rust | 0 |
.footer.unwrap_or_default();
let assertion = self.implicit_assertion.unwrap_or_default();
let keypair = Keypair::from_bytes(key.as_ref())?;
let pae = PreAuthenticationEncoding::parse(&[&self.header, &self.payload, &footer, &assertion]);
let signature = keypair.sign(&pae);
let raw_payload = RawPay... | Rust | 0 |
node from ipfs")
.usage("get <ref>")
.action(cli_dag_get);
let put_dag_cmd = Command::new_with_alias("put", "p")
.about("Add a dag node to ipfs")
.usage("put <string>")
.action(cli_dag_put);
Command::new_with_alias("dag", "d")
.about("Interact with IPLD document... | Rust | 0 |
raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits =
(self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
impl R {
#[doc = "Bit 0 - Set to trigger a wake up event. Bit is cleared after wake up sequence finish... | Rust | 0 |
+ "online")
# nodes
nodeDir = root + "/sys/devices/system/node/"
cmd("mkdir -p " + nodeDir)
for f in ["has_normal_memory", "online", "possible"]: cmd("echo 0 > " + nodeDir + f)
cmd("echo > " + nodeDir + "has_cpu")
n0Dir = nodeDir + "node0/"
cmd("mkdir -p " + n0Dir)
for cpu in range(ncpus):
cmd("ln -s " + cpuDir +... | Python | 1 |
sed");
}
}
#[cfg(windows)]
/// It waits for an incoming `ctrl+c` signal on Windows.
pub async fn wait_for_ctrl_c(grace_period_secs: u8) {
tokio::signal::ctrl_c()
.await
.expect("failed to install ctrl+c signal handler");
delay_graceful_shutdown(grace_period_secs).await;
tracing::info!("... | Rust | 0 |
rigin_func)}')
self.origin_func = origin_func
wrapped_func = self.deliver_wrapper(self.origin_func)
setattr(self.module, self.func_name, wrapped_func)
def __exit__(self, exc_type, exc_value, traceback) -> None:
"""Exit the context manager.
Reset the origin function.
... | Python | 1 |
Pole2D);
}
pub struct BoundedFlowfield2D {
poles: Vec<Pole2D>,
coeff: f32,
}
impl BoundedFlowfield2D {
pub fn default() -> Self {
BoundedFlowfield2D {poles: vec![], coeff: 6.67 }
}
}
impl Flowfield2D for BoundedFlowfield2D {
fn get_vec(&self, x: f32, y: f32) -> [f32; 2] {
... | Rust | 0 |
State::HunkMinus => Painter::mark_empty_line(
&config.minus_empty_line_marker_style,
panel_line,
Some(" "),
),
State::HunkZero => {}
_ => unreachable!(),
};
};
// Pad with (maybe painted) spaces to the panel ... | Rust | 0 |
= turn;
}
}
63 => {
if self.h1_rook_first_move == 0 {
self.h1_rook_first_move = turn;
}
}
_ => (),
}
}
}
pub fn update(&mut self, mv: &Move, tu... | Rust | 0 |
, Serialize, Deserialize)]
#[serde(untagged)]
#[derive(From)]
pub enum InlineDatasetValue {
AnythingMap(HashMap<String, Option<serde_json::Value>>),
String(String),
UnionArray(Vec<serde_json::value::Value>),
}
/// The alignment to apply to symbol legends rows and columns. The supported string values
/// ar... | Rust | 0 |
rand::u32(..max + 1);
}
Self(ints)
}
#[inline(always)]
pub fn get(&self, x: u8, y: u8, z: u8) -> Option<u32> {
if x >= CHUNK_SIDE || y >= CHUNK_SIDE || z >= CHUNK_SIDE {
None
} else {
let index: usize = ((x as usize) * CHUNK_SIDE_USIZE * CHUNK_SIDE_US... | Rust | 0 |
super::POWER>;
#[doc = "Register POWER `reset()`'s with value 0"]
impl crate::ResetValue for super::POWER {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Select the low power state of the ROT memory.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, Partial... | Rust | 0 |
的知识库id+请求执行召回测试"""
# 1.检测知识库是否存在并校验
dataset = self.get(Dataset, dataset_id)
if dataset is None or dataset.account_id != account.id:
raise NotFoundException("该知识库不存在")
# 2.调用检索服务执行检索
lc_documents = self.retrieval_service.search_in_datasets(
dataset_ids=[da... | Python | 1 |
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<PUCR_HW_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PUCR_HW... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LangChain ReAct Agent 客户端测试示例
此脚本测试 LangChain ReAct Agent 服务器的多轮对话功能,
包括同步和流式请求,并且测试多次请求中的会话一致性。
使用方法:
1. 首先运行 langchain_react_agent_server.py 启动服务器
2. 然后运行此脚本: python langchain_react_agent_client_test.py
关于会话ID (session_id) 的处理:
- 首次请求时不提供会话ID,由服务器生成并返回
- 后续请求中使用服务... | Python | 1 |
unimplemented!()
}
#[inline]
fn last_ne_mut(&mut self, byte: u8) -> Option<&mut u8> {
unimplemented!()
}
}
)+ }
}
macro_rules! large {
($($base:expr)+) => {
$(large_helper! { $base => 2 3 4 5 6 7 })+
};
}
large! {
... | Rust | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 1 |
# Copyright 2009-2011 Ram Rachum.
# This program is distributed under the LGPL2.1 license.
import types
import wx
from python_toolbox import caching
from python_toolbox import address_tools
from .event_codes import get_event_codes_of_component, get_event_code_from_name
class EventHandlerGrokker(object):
'''Wr... | Python | 1 |
"""
Write a function to replace whitespaces with an underscore and vice versa in a given string.
assert replace_spaces('Jumanji The Jungle') == 'Jumanji_The_Jungle'
"""
def replace_spaces(string):
"""
Replace whitespaces with underscores and vice versa
:param string: string to be modified
:return: strin... | Python | 1 |
email(self, customer):
return customer.user.email
@admin.register(OrderItem)
class OrderItemAdmin(admin.ModelAdmin):
list_display = ['order',
'product',
'quantity',
'unit_price',
]
list_per_page = 10
autocomplete_fiel... | Python | 1 |
<code>RequestedServiceQuotaChange</code> object for the specific increase request.</p>
#[serde(rename = "RequestedQuota")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requested_quota: Option<RequestedServiceQuotaChange>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature... | Rust | 0 |
from typing import (
NewType,
Tuple,
)
from py_ecc.fields import (
optimized_bls12_381_FQ,
optimized_bls12_381_FQ2,
)
from py_ecc.typing import (
Optimized_Point3D,
)
G1Uncompressed = Optimized_Point3D[optimized_bls12_381_FQ]
G1Compressed = NewType("G1Compressed", int)
G2Uncompressed = Optimized_... | Python | 1 |
b[11]),
$op($a[12], $b[12]),
$op($a[13], $b[13]),
$op($a[14], $b[14]),
$op($a[15], $b[15]))
)
}
macro_rules! scalar_op16 {
($a: expr, $b: expr, $op: expr) => (
Compat16x16::n... | Rust | 0 |
}
}
fn vertex(pos: [i8; 3], nor: [i8; 3]) -> Vertex {
Vertex {
_pos: [pos[0], pos[1], pos[2], 1],
_normal: [nor[0], nor[1], nor[2], 0],
}
}
fn create_cube() -> (Vec<Vertex>, Vec<u16>) {
let vertex_data = [
// top (0, 0, 1)
vertex([-1, -1, 1], [0, 0, 1]),
vertex([1, ... | Rust | 0 |
form_details_for_app(self):
details = get_form_details_for_app(self.domain, self.app.id)
for i, detail in enumerate(details):
self._assert_form_details_match(i, detail)
def test_get_form_details_for_app_and_module_no_data(self):
self.assertEqual([], get_form_details_for_app_and_... | Python | 1 |
each level with shape (N, guiding_shift_channels, H, W).
Useless in this function, we keep this arg because it's the
raw output from CentripetalHead.
tl_centripetal_shifts (list[Tensor]): Top-left centripetal shifts
for each level with shape (N, centripetal... | Python | 1 |
Scope<M::Context>) -> Response<M, M::Seed>
{
let fake_result = match me.0.lock() {
Ok(mut guard) => {
let empty = guard.empty();
let fsm = mem::replace(&mut *guard, empty);
let res = fun(fsm, scope);
res.wrap(|new_machine| {
// thows off an `em... | Rust | 0 |
```
pub fn resp<T>(arg: &Result<T>) -> Response where T: Serialize + DeserializeOwned + Clone {
let res = match arg {
Ok(data) => Resp { code: "0".into(), msg: None, data: Some(data) },
Err(e) => {
match e {
RespErr::SimpleError(e) => Resp { code: "1111".into(), msg: Som... | Rust | 0 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | Python | 1 |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | Python | 1 |
rameters(*config.values(), ids=config.keys())
inp_offset = tvm.testing.parameter((0, 0), ids=["offset0x0"])
@tvm.testing.requires_hexagon
def test_conv2d(self, act_shape, wgt_shape, inp_stride, inp_offset, hexagon_session):
"""Test conv2d intrinsic implementation"""
assert act_shape[3] == w... | Python | 1 |
, f: impl Fn(U, T) -> T) -> T { self.0.into_iter().fold(self.1, |a, b| f(b, a)) }
}
/*
impl<T, U> ReduceLeft<T, U> for (T, U) {
fn reduce_left(self, f: impl Fn(U, T) -> T) -> T { f(self.1, self.0) }
}
*/
// ReduceRight
pub trait ReduceRight<T, U> {
fn reduce_right(self, f: impl Fn(T, U) -> T) -> T;
}
impl<T... | Rust | 0 |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.txt')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
'plaster_pastedeploy',
'pyramid',
'pyramid... | Python | 1 |
key.trim();
if tmp_line.starts_with("HKEY_LOCAL_MACHINE") {
"HKEY_LOCAL_MACHINE"
}
else if tmp_line.starts_with("HKEY_CLASSES_ROOT") {
"HKEY_CLASSES_ROOT"
}
else if tmp_line.starts_with("HKEY_USERS") {
"HKEY_USERS"
}
... | Rust | 0 |
mbda x: min(x[0], x[1]))
# 最右端
right_point_1 = max(horizontal_line_point_group[0], key=lambda x: max(x[0], x[1]))
right_point_2 = max(horizontal_line_point_group[1], key=lambda x: max(x[0], x[1]))
k1 = -(right_point_1[2] - left_point_1[2]) / (
max(righ... | Python | 1 |
resource("/alarm/tomorrow").to(wakeup::tomorrow))
.service(web::resource("/alarm/usually").to(wakeup::usually))
.service(web::resource(&format!("/{}", &state.bot_token)).to(bot::handle_webhook))
.service(
web::resource(&format!("/{}", ha_key)).route(we... | Rust | 0 |
import pytest
from unittest.mock import Mock, call
from omni.modules.services_user import ServicioUsuario
from omni.modules.models import Usuario
@pytest.fixture
def mock_db():
db = Mock()
db.leer.return_value = [
{"id": 1, "nombre": "admin", "password": "hash1"},
{"id": 2, "nombre": "user1", ... | Python | 1 |
slation_x1y2 = Vector3::new(x1y2.translation_x as f32, x1y2.translation_y as f32, 0.0);
let translation_x2y2 = Vector3::new(x2y2.translation_x as f32, x2y2.translation_y as f32, 0.0);
let translation_y1 = interpolate(translation_x1y1, translation_x2y1, y1_vx_factor);
let translation_y2 = interpolate(transla... | Rust | 0 |
import conftest
from PathPlanning.AStar import a_star as m
def test_1():
m.show_animation = False
m.main()
if __name__ == '__main__':
conftest.run_this_test(__file__)
| Python | 1 |
27com.opensymphony.xwork2.dispatcher.HttpServletResponse%27),%23matt.getWriter().println(%23e),%23matt.getWriter().flush(),%23matt.getWriter().close()}'
else:
path = '/login.action?redirect:${%23a%3d(new%20java.lang.ProcessBuilder(new%20java.lang.String[]{"id"})).start(),%23b... | Python | 1 |
return self.fallback(name, args, kwargs)
return self.propagate_sympy(name, args, kwargs)
return inner
def indirect_indexing(
self, index: Union[Any, IndexPropVar], size: Any, check: bool = True
) -> Any:
# nb. We do index + Where(...) rather than Where(idx >= 0,... | Python | 1 |
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2024 Univention GmbH
from copy import deepcopy
from unittest.mock import AsyncMock, call
import pytest
from test_helpers.mock_data import FLAT_MESSAGE_ENCODED, MSG, SUBSCRIPTION_NAME, SUBSCRIPTIONS
from univention.provisioning.backends.nats_mq import... | Python | 1 |
, filename.as_ptr()).into_result()
}
}
/// Checks if data exists for a given key.
///
/// ## Performance
///
/// A nul byte will be appended to `filename` if one is not present.
///
/// > [Method in official docs](https://discordapp.com/developers/docs/game-sdk/storage#exists)
... | Rust | 0 |
64"])
@pytest.mark.parametrize("b_dtype", ["category", "int64"])
def test_categoricals(a_dtype, b_dtype):
# https://github.com/pandas-dev/pandas/issues/37465
g = np.random.default_rng(2)
a = Series(g.integers(0, 3, size=100)).astype(a_dtype)
b = Series(g.integers(0, 2, size=100)).astype(b_dtype)
res... | Python | 1 |
42857142857142855
>>> expectile(a, alpha=0.8)
2.5714285714285716
>>> weights = [1, 3, 1, 1]
r r 6The expectile level alpha must be in the range [0, 1].c n > [ R " [ R " TU :* T-
5 U T-
- TS9$ )Nr r r~ r )r r... | Python | 1 |
core.write_8(canary_addr, &data)?;
}
}
log::debug!("starting device");
if core.get_available_breakpoint_units()? == 0 {
if rtt_addr.is_some() {
bail!("RTT not supported on device without HW breakpoints");
} else {
log::w... | Rust | 0 |
Point,
/// Unit expressed in centimeters
Cm,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for UnitType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"UnitType::{}",
match *self {
UnitType::Pixel => "Pixel",
... | Rust | 0 |
help_service, sample_faq):
"""測試添加FAQ"""
initial_count = len(help_service._faqs)
help_service.add_faq(sample_faq)
assert len(help_service._faqs) == initial_count + 1
assert "test_faq" in help_service._faqs
def test_get_faq(self, help_service, sample_faq):
... | Python | 1 |
if (vk_format.as_raw() as usize) < format::NUM_FORMATS && vk_format != vk::Format::UNDEFINED {
Some(unsafe { mem::transmute(vk_format) })
} else {
None
}
}
pub fn map_tiling(tiling: image::Tiling) -> vk::ImageTiling {
vk::ImageTiling::from_raw(tiling as i32)
}
pub fn map_component(com... | Rust | 0 |
0xB2); // these two bytes represent the character `不` in GB18030 encoding
bytes.push(0xBB);
bytes.push(b'\r');
bytes.push(b'\n');
for b in tail.as_bytes() {
bytes.push(*b);
}
let mut bytes = bytes.as_slice();
let drawing = unwrap_drawing(Drawing::load_with_encoding(
&mut byte... | Rust | 0 |
: Pending"]
PENDING,
}
impl From<LFCLKSTARTED_A> for bool {
#[inline(always)]
fn from(variant: LFCLKSTARTED_A) -> Self {
match variant {
LFCLKSTARTED_A::NOTPENDING => false,
LFCLKSTARTED_A::PENDING => true,
}
}
}
#[doc = "Reader of field `LFCLKSTARTED`"]
pub type ... | Rust | 0 |
Team::Red => {
let initial_coord = get_initial_checkboard_coord(r, Team::Red);
let initial_pos = get_checkboard_pos(initial_coord);
checker.pos = initial_coord;
checker.king = false;
checker.alive = true... | Rust | 0 |
Ok(Cow::Borrowed(self.uri.path()))
}
}
impl HttpRequest for http_0_2::request::Parts {
fn get_header_concatenated_values<'a>(&'a self, header_name: &str) -> Result<Cow<'a, str>, HttpRequestError> {
let mut values = Vec::new();
let all_values = self.headers.get_all(header... | Rust | 0 |
from typing import Tuple
from PyQt5 import QtCore
from PyQt5.QtCore import QPoint
import pytest
from labelCloud.control.config_manager import config
from labelCloud.control.controller import Controller
from labelCloud.model.bbox import BBox
from labelCloud.view.gui import GUI
def test_picking_mode(qtbot, startup_py... | Python | 1 |
#!/usr/bin/env python3
import argparse
import csv
import re
import sys
import openpyxl
REGEX_CSV_SUFFIX = re.compile(r'.csv$', re.I) # pylint: disable=no-member
REGEX_XLSX_SUFFIX = re.compile(r'.xlsx$', re.I) # pylint: disable=no-member
REGEX_INVALID_SHEETNAME_CHARS = re.compile(r'[][*?/\.]')
REGEX_SPACES = re.com... | Python | 1 |
-and-set from a `Shared` to an `Owned` pointer with the
/// given memory ordering, immediatley acquiring a new `Shared` reference to
/// the previously-owned pointer if successful.
///
/// This operation is analogous to `store_and_ref`.
pub fn cas_and_ref<'a>(&self, old: Option<Shared<T>>, new: Owne... | Rust | 0 |
# Generated by Django 2.2.4 on 2019-11-05 00:42
from django.db import migrations, models
import django.db.models.deletion
import pretalx.common.models.mixins
class Migration(migrations.Migration):
dependencies = [
("event", "0021_auto_20190429_0750"),
("submission", "0040_submission_created_data"... | Python | 1 |
from app.application import Application
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def browser_i... | Python | 1 |
::Throwable>> {
// class.path == "android/os/Debug", java.flags == PUBLIC | STATIC, .name == "resetGlobalAllocCount", .descriptor == "()V"
unsafe {
let __jni_args = [];
let (__jni_class, __jni_method) = __jni_env.require_class_static_method("android/os/Debug\0", "... | Rust | 0 |
;
let deck = Deck::from_input("10 1 7 6");
assert_eq!(deck.create_deck_from_top_n_cards(3), Deck::from_input("10 1 7"));
}
#[test]
fn test_recursive_combat_play_till_winner_with_sub_games() {
let mut game = RecursiveCombatGame::from_inputs(
"sub-games test",
"9 2 6 3 1",
"5 8 4 7 1... | Rust | 0 |
out)
}
PageTableType::SmallPage => {
// first we copy the C and B bits to our output variable
let mut out = val & 0b1100;
// Copy XN
out |= (val & 0b1) << 4;
// Copy AP, TEX, AP2, S, and nG
out |= (va... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
系统音频设置助手
帮助用户启用Windows立体声混音功能
"""
import subprocess
import sys
import winreg
from pathlib import Path
class SystemAudioHelper:
"""系统音频设置助手类"""
def __init__(self):
self.is_windows = sys.platform.startswith('win')
def check_stereo_mix_stat... | Python | 1 |
40324, 40326, 40330, 40333, 40334, 40338, 40339,
40341, 40342, 40343, 40344, 40353, 40362, 40364, 40366, 40369, 40373,
40377, 40380, 40383, 40387, 40391, 40393, 40394, 40404, 40405, 40406,
40407, 40410, 40414, 40415, 40416, 40421, 40423, 40425, 40427, 40430,
40432, 40435, 40436, 40446, 40458, 40450, 40... | Rust | 0 |
aders = get_common_headers()
url = f"https://www.xiaohongshu.com/explore/{note_id}"
response = requests.get(url, headers=headers)
res = response.text
video_addr = re.findall(r'<meta name="og:video" content="(.*?)">', res)[0]
except Exception as e:
succ... | Python | 1 |
, lower=0),
DegreeOfFreedomRange(upper=0, lower=-0),
],
add_free_joint=True,
),
)
else:
configs.append(
MujocoObjectInstanceConfig(
obj_... | Python | 1 |
Ok(f(Bytes::Temporary(&self.buffer)))
}
}
/// Unstable error type meant to disappear if/when `parity-scale-codec`'s `Error` implements
/// `Display` unconditionally.
#[derive(Debug)]
pub struct Error(pub &'static str);
impl Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
... | Rust | 0 |
_ => Err(format!(
"invalid socket address (should be 16 or 28 bytes): {:x?}",
buf
)
.into()),
}
}
pub fn emit_timespec(time: &SystemTime, buf: &mut [u8]) {
match time.duration_since(SystemTime::UNIX_EPOCH) {
Ok(epoch_elapsed) => {
NativeEndian... | Rust | 0 |
).unwrap();
res.zero_window = Some(Instant::now());
}
/// How long we wait for a response from the full node
/// this value must be less than or equal to the FAST_LOOP_SPEED
/// in the rita_common fast loop
pub const ORACLE_TIMEOUT: Duration = FAST_LOOP_TIMEOUT;
pub async fn update() {
let payment_settings = ... | Rust | 0 |
function is of a different type
pub const E_FORWARDER_PRODUCER_MISMATCH : HResultError = HResultError::from_constant(0x87C51012); // UTC_E_FORWARDER_PRODUCER_MISMATCH
/// RunScriptAction failed intentionally to force this escalation to terminate
pub const E_INTENTIONAL_SCRIPT_FAILURE : HResultError = HResultError::fr... | Rust | 0 |
extern crate hyper;
#[macro_use]
extern crate log;
extern crate pretty_env_logger;
extern crate tokio_core;
extern crate url;
use futures::Future;
use futures::stream::Stream;
use hyper::Client;
use std::env;
use std::io::{self, Write};
use std::str::FromStr;
fn main() {
pretty_env_logger::init();
let url =... | Rust | 0 |
NUrJWIzcuc18uRDNH5K90GTL<KEY>M~E4ATRQfhZ\
fkW9xCrBIaIQM49ms2wONsp7fvI07b1r0rt7ZwCFOFit1HSAKl8UpsAYu-EsIO1qAK7vvO\
UV~0OuBXkMZEyJT-uIVfbE~xrwPE0zPYE~parSVQgi~yNQBxukUM1smAM5xXVvJu8GjmE-\
kJZw1cxaYLGsJjDHDk4HfEsyQVVPZ0V3bQvhB1tg5cCsTH~VNjts4taDTPWfDZmjtVaxxr\... | Rust | 0 |
get_center()[0]
y = dot.get_center()[1]
if self.run_time < animation_time - 2.1*self.last_dt:
new_line = Line(last_line.get_end(),np.array([x,y,0]), color=RED)
self.curve.add(new_line)
return self.curve
def get_line(... | Python | 1 |
s sent by the client or browser as the origin of the request. It is set through an `Origin` header. * **Access-Control-Allow-Methods**: This specifies the allowed options for requests from that domain. This will generally be all available methods. * **Access-Control-Expose-Headers**: This will contain the headers t... | Python | 1 |
from django.contrib import admin
from .models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ("user_id", "content", "image")
search_fields = ("content",) | Python | 1 |
G_GPIO_27_SMT_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `reg_gpio_27_smt` writer - Schmitt trigger enabled for GPIO27."]
pub struct REG_GPIO_27_SMT_W<'a> {
w: &'a mut W,
}
impl<'a> REG_GPIO_27_SMT_W<'a> {
#[doc = r"Writes `variant` to the field"]
... | Rust | 0 |
for BorrowedEventLoop {
fn deref<'a>(&'a self) -> &'a EventLoop { unsafe { &*self.local } }
}
impl DerefMut<EventLoop> for BorrowedEventLoop {
fn deref_mut<'a>(&'a mut self) -> &'a mut EventLoop {
unsafe { &mut *self.local }
}
}
#[unsafe_destructor]
impl Drop for BorrowedEventLoop {
fn drop(&... | Rust | 0 |
is not None:
torch.manual_seed(seed)
input_ids = input_ids.to(model.device)
if decode_timing:
tic = time.time()
generate_dict = generate_fn(model, tokenizer, input_ids, *args, **kargs)
generate_ids = generate_dict['generate_ids']
if decode_timing:
toc = time.time()
... | Python | 1 |
![allow(missing_docs)]");
w.write_line("#![allow(non_camel_case_types)]");
w.write_line("#![allow(non_snake_case)]");
w.write_line("#![allow(non_upper_case_globals)]");
w.write_line("#![allow(trivial_casts)]");
w.write_line("#![allow(unsafe_code)]");
w.write_line("#![allow(unused_imports)]");
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.