text string | label_name string | labels int64 |
|---|---|---|
const UFormattable, status: *mut UErrorCode) -> UDate;
}
extern "C" {
pub fn ufmt_getDouble_69(fmt: *mut UFormattable, status: *mut UErrorCode) -> f64;
}
extern "C" {
pub fn ufmt_getLong_69(fmt: *mut UFormattable, status: *mut UErrorCode) -> i32;
}
extern "C" {
pub fn ufmt_getInt64_69(fmt: *mut UFormattable... | Rust | 0 |
ayer1 = get_player(args_dict['player_vs'][0])
player2 = get_player(args_dict['player_vs'][1])
referee = Referee(player1, player2, game)
print(referee.play_game(verbose=True))
else:
# train mode
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # 这样就不会有 tensorflow 的 log 了
g =... | Python | 1 |
# Copyright 2024 PKU-Alignment Team. 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/LICENSE-2.0
#
# Unless required by applicable ... | Python | 1 |
)]
extern crate foo_lib;
fn main() { foo_lib::foo(); }
"#)
.file("src/foo_lib.rs", r#"
#![feature(plugin)]
#![plugin(bar)]
pub fn foo() {}
"#);
let bar = project("bar")
.file("Cargo.toml", r#"
[package]
... | Rust | 0 |
::li();
}
<gh_stars>10-100
use bitflags::bitflags;
use std::fmt::Debug;
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, Not};
bitflags! {
struct TypeRepr: u32 {
const PROFANE = 0b0_000_000_000_000_000_111;
const OFFENSIVE = 0b0_000_000_000_000_111_000;
const SEXUAL = 0b0_000_0... | Rust | 0 |
**kwargs)
def resnet152(pretrained=False, progress=True, **kwargs):
return _resnet('resnet152', Bottleneck, [3, 8, 36, 3], pretrained, progress,
**kwargs)
def resnext50_32x4d(pretrained=False, progress=True, **kwargs):
kwargs['groups'] = 32
kwargs['width_per_group'] = 4
... | Python | 1 |
#lists
groceries = ["milk", "eggs", "steak"]
print(groceries[0])
del groceries[0]
print(groceries[0])
groceries = ["cheese"] + groceries
print(groceries)
print(groceries.index("steak"))
print(groceries.reverse)
List1= ['A', 'B', 'C', 'D', 'E']
print(List1.count('E'))
List1.append('E')
print(List1)
List1.... | Python | 1 |
returns an error if the initialization fails.
///
/// # Arguments
///
/// * `_origin` - Origin block chain instance.
/// * `auxiliary` - Auxiliary block chain instance.
/// * `config` - configuration of mosaic node.
pub fn new(
_origin: Arc<Ethereum>,
auxiliary: Arc<Ethereum... | Rust | 0 |
let vacant_entry = match m.raw_entry_mut().from_hash(1, |k| k.0 == 1) {
// EntryMut::Occupied(..) => panic!("Found entry for key 1"),
// EntryMut::Vacant(e) => e,
// };
// vacant_entry.insert_with_hasher(1, IntWrapper(1), (), |k| k.0);
// }
// {
// assert!(m.raw_entry().fr... | Rust | 0 |
> AvxF32 {
unsafe {
AvxF32(avx_sub_ps(self.0, other.0))
}
}
}
impl Sub<f32> for AvxF32 {
type Output = AvxF32;
#[inline]
fn sub(self, other: f32) -> AvxF32 {
unsafe {
AvxF32(avx_sub_ps(self.0, avx_set1_ps(other)))
}
}
}
impl Sub<AvxF32> for f... | Rust | 0 |
als::{Proposal, ProposalInput, ProposalKind, ProposalStatus};
pub use crate::types::{Action, Config};
use crate::upgrade::{internal_get_factory_info, internal_set_factory_info, FactoryInfo};
pub use crate::views::{BountyOutput, ProposalOutput};
mod bounties;
mod delegation;
mod policy;
mod proposals;
mod types;
mod up... | Rust | 0 |
assert!(!Decimal::<1>::eq_zero(&Decimal::<1>::ONE));
assert!(!Decimal::<2>::eq_zero(&Decimal::<2>::ONE));
assert!(!Decimal::<3>::eq_zero(&Decimal::<3>::ONE));
assert!(!Decimal::<4>::eq_zero(&Decimal::<4>::ONE));
assert!(!Decimal::<5>::eq_zero(&Decimal::<5>::ONE));
assert... | Rust | 0 |
import os
import infra.basetest
class TestOpensshBase(infra.basetest.BRTest):
passwd = "testpwd"
opensshconfig = \
"""
BR2_TARGET_GENERIC_ROOT_PASSWD="{}"
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_SSHPASS=y
BR2_ROOTFS_POST_BUILD_SCRIPT="{}"
# BR2_TARGET_ROOTFS_TAR is n... | Python | 1 |
import streamlit as st
# Streamlitのアプリタイトル
st.title("株価予測")
st.write("開発中")
| Python | 1 |
Oh4 j S r S rSSSS SS.SS SS
SS.SS
S/ SQSS.SSSSS/SS.SSS/ SQSS./rS SSS/ SQS./S .S! S"S#S/ S$QS.S%S&S/ S'QS./S .S( S)S*S/ S+QS.S,S-SSS/S./S .S. S/S0S/ S1QS.S2S3SSS/S./S .S4 S5S6S/ S7QS.S8S9SSS/... | Python | 1 |
a> {
condition: Box<ConditionNode<'a>>,
while_block: Box<BlockNode<'a>>,
}
impl<'a> WhileNode<'a> {
pub fn new(condition: Box<ConditionNode<'a>>, while_block: Box<BlockNode<'a>>) -> Self {
Self {
condition,
while_block,
}
}
}
#[derive(PartialEq, Debug)]
pub stru... | Rust | 0 |
.nth(1)
.expect("part name not found")
.to_owned();
let part = asset
.get::<PartAsset>()
.cloned()
.expect("trying to use non-part asset");
parts.register(id, name, part);
}
for id in assets.lately_unloaded_protocol("part")... | Rust | 0 |
from django.db import models
# Create your models here.
"""
class Post:
title: str
author: str
content: str
image: file
"""
class Post(models.Model):
title = models.CharField(max_length=255)
author = models.CharField(max_length=255)
content = models.TextField()
image = models.ImageFie... | Python | 1 |
as i32));
}
assert!(queue.tail() == 0);
assert!(queue.head() == QUEUE_SIZE - 1);
assert!(!queue.enqueue(QUEUE_SIZE as i32));
}
#[test]
fn test_dequeue_empty() {
let queue = Queue::<i32>::new("test");
assert_eq!(queue.dequeue(), None);
}
#[test]
... | Rust | 0 |
to spawn a future to set the ready flag.
block_on(mark_ready(mu.clone()));
// Now the tight loop will finish.
if let Poll::Pending = tl.as_mut().poll(&mut cx) {
panic!("tight_loop not able to finish");
}
assert_eq!(mu.raw.state.load(Ordering::Relaxed), 0);
}
... | Rust | 0 |
[
"sample_per_id"
if sampler_name == "PKSampler" else "num_instances"],
device_id=device_id,
shard_id=shard_id,
num_gpus=num_gpus,
image_root=file_root,
cls_label_path=file_list,
delim... | Python | 1 |
rices[0] > 0 else 0
# 3. 🆕 추세의 일관성 확인 (연속성)
consecutive_up = 0
max_consecutive_up = 0
for i in range(1, len(prices)):
if prices[i] > prices[i-1]:
consecutive_up += 1
max_consecutive_up = max(max_consecutive_up, con... | Python | 1 |
Input("ia", 32);
let ib = f.Input("ib", 32);
f.If(F!(ia == ib),
Form(f.clone().own().sst(1))
);
f.Else(
Form(f.clone().own().sst(0))
);
m.Function(f.clone());
m.Assign(out._e(f.using(func_args!(ina, inb))));
m.endmodule();
m.genPrint();
//m.genFile("fucn.v")
}<reponame>pearzl/proc_getter
// /proc/[pi... | Rust | 0 |
file {bank_path} does not exist")
previous_result_folder = os.path.join(search_folder, f"results/example_{previous_version}")
new_example_folder = os.path.join(search_folder, f"examples/example_{new_version}")
if not os.path.exists(new_example_folder):
os.makedirs(new_example_folder)
example_... | Python | 1 |
import abc
from dataclasses import dataclass
from typing import Any, List
from ray.data.block import Block, DataBatch
from ray.types import ObjectRef
@dataclass
class Batch:
"""A batch of data with a corresponding index.
Attributes:
batch_idx: The global index of this batch so that downstream operat... | Python | 1 |
"content": f"처리 중 오류가 발생했습니다: {str(e)}",
"search_results": [],
"processing_time": processing_time,
"framework": "Strands",
"iterations": 1,
"steps": [
{
"type": "Error",
... | Python | 1 |
nderItem],
app_path: str | None = None, absolute_url: str | None = None) -> str:
''' Render an script for Bokeh render items.
Args:
docs_json_or_id:
can be None
render_items (RenderItems) :
Specific items to render from the document and where
... | Python | 1 |
abbbbaaaababbbbbbaaaababb
aaaaabbaabaaaaababaa
aaaabbaaaabbaaa
aaaabbaabbaaaaaaabbbabbbaaabbaabaaa
babaaabbbaaabaababbaabababaaab
aabbbbbaabbbaaaaaabbbbbababaaaaabbaaabba";
#[test]
fn test_rule_parse() {
let rules = Rule::parse(RULES);
let mut exp_rules = HashMap::new();
exp_rules.inse... | Rust | 0 |
#!/usr/bin/env python
# coding: utf-8
"""
Knapsack problem
"""
import numpy as np
try:
import gurobipy as gp
from gurobipy import GRB
_HAS_GUROBI = True
except ImportError:
_HAS_GUROBI = False
from pyepo.model.grb.grbmodel import optGrbModel
class knapsackModel(optGrbModel):
"""
This class i... | Python | 1 |
}
#[derive(Deserialize)]
#[serde(rename_all(deserialize = "camelCase"))]
pub struct PollHeaderRenderer {
pub poll_question: Message,
pub live_chat_poll_type: PollType,
}
#[derive(Deserialize)]
#[serde(rename_all(deserialize = "SCREAMING_SNAKE_CASE"))]
pub enum PollType {
LiveChatPollTypeCreator,
}
#[deri... | Rust | 0 |
edcf42f562f1c/recipe/meta.yaml"
)
in_yaml = requests.get(url).text
run_minimigrator(
migrator=wheel_mig,
inp=in_yaml,
output=in_yaml,
mr_out=None,
should_filter=False,
tmp_path=tmp_dir_with_conf,
)
def test_migrate_black_no_conf(tmp_path):
"""Witho... | Python | 1 |
":
split_tp_row(self.model, name, m, tp)
def merge_tp(self):
all_qkv_tp = [[None for j in range(self.tp)] for i in range(self.model.config.num_hidden_layers)]
all_o_tp = [[None for j in range(self.tp)] for i in range(self.model.config.num_hidden_layers)]
all_gateup_t... | Python | 1 |
emoryA[int(sm_memory_size/10):]
memoryS = memoryS[int(sm_memory_size/10):]
memoryRR = memoryRR[int(sm_memory_size/10):]
#Update the states
qs=s
#Retrain every X failures after num_initial_observation
if done and game >= num_initi... | Python | 1 |
quote! {
include!( #fname );
}
}
FileLocationStrategy::Custom(_) => panic!("Should never happen in the macro"),
FileLocationStrategy::UnknownMaybeFromOutdir | FileLocationStrategy::FromOutDir(_) => {
let fname = form... | Rust | 0 |
r datatype in datatypes.iter() {
let dpath = &datatype.x.path;
let is_transparent = is_datatype_transparent(source_module, datatype);
if is_transparent {
// Encode transparent types as AIR datatypes
transparent_air_datatypes.push(datatype_to_air(ctx, datatype));
... | Rust | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.
# pyre-strict
f... | Python | 1 |
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = "j F Y"
TIME_FORMAT = "G:i"
YEAR_MONTH_FORMAT = "F Y"
MONTH_DAY_FORMAT = "j F"
SHORT_DATE_FORMAT = "... | Python | 1 |
-nft-tracker <ETHEREUM_BLOCK_NUMBER>")
} else {
if args.len() == 2 {
if let Ok(start_from) = args[1].parse::<u64>() {
let mut erc721_cb = println_callbacks::EthereumErc721EventCallback {};
let mut erc1155_cb = println_callbacks::EthereumErc1155EventCallback {};
... | Rust | 0 |
from django.utils import timezone
from jsonfield import JSONField
from .helper import Model, models
class Registery(Model):
"""scheduler/worker registery"""
class Meta:
indexes = [
models.Index(fields=["registery_node"]),
]
class Admin:
display_fields = ['registery_n... | Python | 1 |
# csbli.py
#
# A simulation of the crossing-shocks+boundary-layer interaction
# for Anand V. and David Mee's Discovery Project.
#
# Peter J. 2023-07-29
#
config.title = "Crossing shocks interacting with a boundary-layer over a short plate."
config.viscous = True
config.max_time = 1.5e-3
config.max_step = 300000
config... | Python | 1 |
g_kernel = torch.Tensor([pdf(-2), pdf(-1), pdf(0), pdf(1), pdf(2)]).to(opt.device)
gauss = Deblurring(g_kernel / g_kernel.sum(), 3, opt.image_size, opt.device)
xdim = (3, opt.image_size, opt.image_size)
assert kernel in ["uni", "gauss"]
def blur(img):
# img: [-1,1] -> [0,1]
img = (img ... | Python | 1 |
"D": np.random.default_rng(2).standard_normal(8),
}
)
gb = df.groupby(["A", "B"])
res_agg = gb.transform(reduction, engine="numba", **kwargs)
expected_agg = gb.transform(reduction, engine="cython", **kwargs)
tm.assert_frame_equal(res_agg, expected_agg)
def test_multilabel_udf_numba_vs_cy... | Python | 1 |
lient))).collect())
}
}
#[derive(Debug)]
pub struct Database {
pub name: String,
rpc_client: Arc<RpcClient>
}
impl Database {
pub(crate) fn new(name: String, rpc_client: Arc<RpcClient>) -> Self {
Database { name, rpc_client }
}
pub async fn schema(&self) -> Result<String> {
se... | Rust | 0 |
4 {
$out = $p as usize;
};
($p:f_type) => "/* usize */ ulong" "$p";
($p:f_type) <= "/* usize */ ulong" "$p";
);
foreign_typemap!(
($p:r_type) isize => i64 {
$out = $p as i64;
};
($p:r_type) isize <= i64 {
$out = $p as isize;
};
($p:f_type) => "/* isize */ long" "... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
generate_ai_improved_code.py - AI改善コード生成ツール
完全レポートから問題・助言を抽出し、LLMで100点満点の改善コードを生成してレポート化。
実ファイルは変更せず、人間が後で修正するための詳細レポートを生成します。
処理フロー:
1. 完全レポートからエントリを抽出
2. 元のソースファイルを読み込み
3. 問題箇所にコメントを追加した元ソースを表示
4. LLM(Claude/OpenAI)で100点満点の改善コードを生成
5. 詳細レポート(Mar... | Python | 1 |
from typing import Dict, Any
import torch
class Scheduler:
"""
A `Scheduler` is a generalization of PyTorch learning rate schedulers.
A scheduler can be used to update any field in an optimizer's parameter groups,
not just the learning rate.
During training using the AllenNLP `Trainer`, this is... | Python | 1 |
)(program);
(opengl.delete_texture)(1, &blit_texture);
for texture in textures.iter() {
(opengl.delete_texture)(1, texture);
}
(opengl.delete_fb)(1, &mut fb);
(opengl.delete_buffer)(2, [position_buffer, texpos_buffer].as_ptr());
}
}
// temperature.rs
use byteorde... | Rust | 0 |
))
.header("Authorization", format!("token {}", token))
.json(&Issue {
title: ISSUE_TITLE.to_string(),
body: content,
})
.send()
.await?
.json::<IssueResponse>()
.await?;
if let IssueResponse::Err { message } = resp {
epr... | Rust | 0 |
from abc import ABC
import rich
from utils.loggerUtils import LoggerUtils
"""
cada memoria vai ser um vetor
cada item do vetor vai corresponder a uma pagina
"""
[["","",""], ["", "", ""]]
class MemoriaAbstrata(ABC):
def __init__(self):
super().__init__()
self.memoria = []
self.numero_padra... | Python | 1 |
import os
from fabric.api import run
from fabric.api import task
from fabric.contrib import files
from fabric.context_managers import lcd, cd
from fabric.operations import put, local, sudo
import constants
@task
def init(hostname):
install_puppet()
update(hostname)
@task
def init_dev_instance():
install... | Python | 1 |
e extern "system" fn(param0: *mut DDHAL_SETCOLORKEYDATA) -> u32>;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`*"]
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
pub type LPDDHALSURFCB_SETOVERLAYPOSITION = ::core::option::Option... | Rust | 0 |
")?.to_num();
sprite.x.set(x);
sprite.y.set(y);
Ok(())
}
"motion_setx" => {
let x = self.input(sprite, inputs, "X")?.to_num();
sprite.x.set(x);
Ok(())
}
"motion_sety" => {
... | Rust | 0 |
img1 = img1.permute([0, 3, 1, 2])
img2 = img2.permute([0, 3, 1, 2])
return ssim_utils.ssim(img1, img2, window_size, size_average)
def lpips_score(img1, img2, net='alex', format='NCHW'):
if format == 'HWC':
img1 = img1.permute([2, 0, 1])[None, ...]
img2 = img2.permute([2, 0, 1])[... | Python | 1 |
")?,
);
let stmt = caps
.get(3)
.unwrap()
.as_str()
.parse::<usize>()
.map_err(|_| "stmt id is not a positive integer")?;
Ok(Breakpoint(def_id, bb, stmt))
}
fn parse_def_id(s: &str) -> Result<DefId, String> {
let regex = ::regex::Regex::new(r#"DefId\((\d+):(\d+)... | Rust | 0 |
= sess.channel_session().map_err(Error::ChannelSession)?;
channel.exec(command).map_err(Error::Command)?;
// Intentionally ignore these results here as their failure
// does not precipitate a repeat
let _ = channel.read_to_string(&mut s);
... | Rust | 0 |
g50axuiv62e as umz85ciqk7w, dqspmd_gchl as nl9kuuhd49c, fwu095fjz2n, oyevg3z7cvn as pova7kxb51t, l29d_g8emja, pxlt3_lbgcx, yfwlknivbt5 as jnderys452c, o319jq5yaxp, lqny_k7a6pn as sy8ydowhhub
raise b3fnbrk37_5
False .xt_v4dxtlqy **= ujn54wy747c
nonlocal uo8g15wzin0
(lv8b13lysjo): 0j = t_5u6dx_ki7
pas... | Python | 1 |
target)
loss = loss_next_proprio
self.optimizer.zero_grad()
loss.backward()
self.optimizer.step()
with torch.no_grad():
self.diagnostics["training/proprio_error"] = (
loss_next_proprio.detach().cpu().item()
)
self.diagnostics[... | Python | 1 |
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 use this file except in compliance
// with the Licen... | Rust | 0 |
s not ``Null``.
"""
if self._world_obj is None:
local_obj = self.local_obj
world_coords = self.world_coords
if (local_obj is not None) and (world_coords is not None):
# Copy local object, apply transform to move to its new home.
self._w... | Python | 1 |
_EXTICR3_EXTI8_PC: u32 = 2;
pub const SYSCFG_EXTICR3_EXTI8_PD: u32 = 3;
pub const SYSCFG_EXTICR3_EXTI8_PE: u32 = 4;
pub const SYSCFG_EXTICR3_EXTI8_PH: u32 = 7;
pub const SYSCFG_EXTICR3_EXTI9_PA: u32 = 0;
pub const SYSCFG_EXTICR3_EXTI9_PB: u32 = 16;
pub const SYSCFG_EXTICR3_EXTI9_PC: u32 = 32;
pub const SYSCFG_EXTICR3_E... | Rust | 0 |
de.count_ones() as u64);
for _ in 0..64 {
let t = code & code.wrapping_neg();
if rank == 0 {
return code.trailing_zeros() as u64;
}
rank -= 1;
code ^= t;
}
debug_assert!(false, "select1_raw past end of codeword");
0
}
#[inline]
pub fn select1(mut code... | Rust | 0 |
= mac::FrameControl(0)
.with_frame_type(mac::FrameType::MGMT)
.with_mgmt_subtype(mac::MgmtSubtype::AUTH);
let seq_ctrl = mac::SequenceControl(0).with_seq_num(seq_mgr.next_sns1(&client_addr) as u16);
mgmt_writer::write_mgmt_hdr(
buf,
mgmt_writer::mgmt_hdr_from_ap(frame_ctrl, clien... | Rust | 0 |
= 7i32;
#[doc = "*Required features: `\"Win32_UI_TabletPC\"`*"]
pub const DISPID_ICECursorOutOfRange: DISPID_InkCollectorEvent = 8i32;
#[doc = "*Required features: `\"Win32_UI_TabletPC\"`*"]
pub const DISPID_ICESystemGesture: DISPID_InkCollectorEvent = 9i32;
#[doc = "*Required features: `\"Win32_UI_TabletPC\"`*"]
pub ... | Rust | 0 |
Err(_) => None,
Ok(val) => match direction {
'U' => Some(PointAxisTranslation::Up(val)),
'R' => Some(PointAxisTranslation::Right(val)),
'D' => Some(PointAxisTranslation::Down(val)),
'L' => Some(PointAxisTranslation::Left(val)),
... | Rust | 0 |
image = random_contrast(image, limit=(-0.5, 0.5), u=0.5)
image = random_saturation(image, limit=(-0.3, 0.3), u=0.5)
image = random_gray(image, u=0.25)
image = np.asarray(image * 255, dtype=np.uint8)
elif self.aug == 0:
image, target = \
... | Python | 1 |
!(first_byte & 0xC0, 0xC0);
0xC0 + (((first_byte & !0xC0) << 8) | second_byte)
}
};
//assert!(length < 0x4000, "{:#X}", length);
Command::Note {
pitch,
veloci... | Rust | 0 |
_id: u32 = self
.iterators
.len()
.try_into()
.expect("Iterator count exceeded uint32 range. This is a bug.");
self.iterators.insert(next_id, iter); // This moves iter. Is this okay?
(Ok(next_id), gas_info)
}
fn next(&mut self, iterator_id: u32) -... | Rust | 0 |
pub raw_value_param: &'a[u8]
}
impl<'a> Header<'a> {
pub fn new(
name: &'a str,
value: HeaderValue<'a>,
parameters: Option<GenericParams<'a>>,
raw_value_param: &'a[u8],
) -> Header<'a> {
Header {
name: { Ascii::new(name) },
value: value,
... | Rust | 0 |
playpens.push(Playpen {
start_index: i,
end_index: end_i,
rust_file: base_path.join(PathBuf::from(params[0])),
editable: editable,
escaped: escaped,
})
}
playpens
}
// ---------------------------------------------------------------------... | Rust | 0 |
ensive - it's just a terminal game
// no need to try and go nuts
.add_resource(bevy::core::DefaultTaskPoolOptions::with_num_threads(1))
// The Crossterm runner respects the schedulerunnersettings. No need to run as fast as humanly
// possible - 20 fps should be more than enough for a sce... | Rust | 0 |
This value CANNOT be null.
swap_chain_description.OutputWindow = main_window;
// Set the output to windowed mode. This is a fairly important value.
// If the swap-chain is in windowed mode, the front-buffer is the desktop.
// If the swap-chain is not in windowed mode, there is a dedicat... | Rust | 0 |
remaining messages can still be received.
//!
//! The channel can also be closed manually by calling [`Sender::close()`] or
//! [`Receiver::close()`]. The API and much of the documentation is based on [async_channel](https://docs.rs/async-channel/1.6.1/async_channel/).
//!
//! # Examples
//!
//! ```
//! # futures_lit... | Rust | 0 |
RPC_BINDING_HANDLE_SECURITY_V1_A {
Version: c_ulong,
ServerPrincName: *mut c_uchar,
AuthnLevel: c_ulong,
AuthnSvc: c_ulong,
AuthIdentity: *mut SEC_WINNT_AUTH_IDENTITY_A,
SecurityQos: *mut RPC_SECURITY_QOS,
}}
pub type PRPC_BINDING_HANDLE_SECURITY_V1_A = *mut RPC_BINDING_HANDLE_SECURITY_V1_A;
ST... | Rust | 0 |
THIRTEEN_STRINGS`]
fn thirteen(&self) -> bool {
matches!(*self, "13" | "B")
|| (self.len() == 13 && self.bytes().all(|b| matches!(b, b'I' | b'l' | b'1')))
|| is_thirteen_equal_chars(self)
// The next line could be non-allocating if there is an ascii-only IsThirteen
... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .i18n import I18n
class StandardDimension(object):
_types = {
"api_name": str,
"label": I18n,
}
def __init__(self, d=None):
... | Python | 1 |
pub type BL_Err_Type = ::cty::c_uint;
pub const BL_Fun_Type_DISABLE: BL_Fun_Type = 0;
pub const BL_Fun_Type_ENABLE: BL_Fun_Type = 1;
#[doc = " @brief Functional type definition"]
pub type BL_Fun_Type = ::cty::c_uint;
pub const BL_Sts_Type_RESET: BL_Sts_Type = 0;
pub const BL_Sts_Type_SET: BL_Sts... | Rust | 0 |
a=int(input("enter first number"))
b=int(input("enter the second number"))
c=(input("add,sub,multi,div:"))
if (c == "add"):
print(a+b)
elif (c =="sub"):
print(a-b)
elif (c == "multi"):
print(a*b)
elif(c =="div"):
print(a/b)
else:
("the symbol is invalid")
| Python | 1 |
import os
import sys
from collections import namedtuple
from Crypto.Cipher import AES
from django.apps import apps as django_apps
from django.conf import settings
from django.core.checks import Critical, Error
from .cryptor import Cryptor
from .persist_key_path import (
DjangoCryptoFieldsKeyPathChangeError,
D... | Python | 1 |
let vppprocesses:[Option<VppProcess>;NUM_PROCS] = Default::default();
// default initializes the array with None
// debug!("Length is {}",tockprocesses.len());
// for i in 0..tockprocesses.len() {
// if tockprocesses[i].is_some() {
// let proc = Some(process:... | Rust | 0 |
class AdaptationProxy():
def __init__(self):
super().__init__()
def run(self, adaptability, message, ip, port):
message = {
'op': b'Adapt',
'topic': adaptability,
'msg': message
}
return AmotEngine.attached(self).run(message, ip, port)
| Python | 1 |
, 'occlusion': False},
{"name": "nfs_walking_3", "path": "sequences/walking_3", "startFrame": 1, "endFrame": 1427, "nz": 5, "ext": "jpg", "anno_path": "anno/nfs_walking_3.txt", "object_class": "person", 'occlusion': False},
{"name": "nfs_water_ski_2", "path": "sequences/water_ski_2", "startFrame... | Python | 1 |
from dependencies import get_db
from fastapi import APIRouter, Depends
from schemas.category import (CategoryCreate, CategoryResponse,
CategoryResponseList)
from services.category_service import CategoryService
from sqlalchemy.ext.asyncio import AsyncSession
router = APIRouter(tags=["Кате... | Python | 1 |
"Blueberry": "Blueberry",
# # "Raspberry": "Raspberry",
# # })
# # This should be auto upgraded from
# # select_with_custom_size_and_dict.expect_choices({
# # "Citrus": [
# # "Orange",
# # "Lemon",
# # "Lime",
# # ],
# # "Berries": [
... | Python | 1 |
#
# Copyright (c) 2024, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import numpy as np
from pipecat.frames.frames import AudioRawFrame, Frame, UserStartedSpeakingFrame, UserStoppedSpeakingFrame
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.vad.vad_analyzer im... | Python | 1 |
d metadata;
mod par_fsync;
mod storage_layer;
use delta_layer::{DeltaLayer, DeltaLayerWriter};
use ephemeral_file::is_ephemeral_file;
use filename::{DeltaFileName, ImageFileName};
use image_layer::{ImageLayer, ImageLayerWriter};
use inmemory_layer::InMemoryLayer;
use layer_map::LayerMap;
use layer_map::SearchResult;
u... | Rust | 0 |
For example, the following code shows how to specify an activity's default size
/// and location, and its minimum size, when the activity is displayed in freeform
/// mode:
///
/// ## XML Example
/// ```xml
/// <activity android:name=".MyActivity">
/// <layout android:defaultHeight="500d... | Rust | 0 |
vec![2,0,0,0,99];
assert_input_output(&mut input, &mut expected);
}
{
let mut input = vec![2,3,0,3,99];
let mut expected = vec![2,3,0,6,99];
assert_input_output(&mut input, &mut expected);
}
{
let mut input = vec![2,4,4,5,99,0];
let mut expected = v... | Rust | 0 |
0107, 256660, 40, -25120, 45)
ChrSetPos(0x00F9, 255050, 0, -25780, 47)
OP_72(0x0012, 0x0004)
OP_72(0x0013, 0x0004)
Sleep(2000)
FadeIn(1000, 0)
OP_0D()
ChrTalk(
0x0107,
(
'#0070230037V#061F#5P嗯,这样就好了。',
TxtCtl.Enter,
),
)
CloseMessage... | Python | 1 |
:Collect`.
test_cfg (dict): The testing config.
Returns:
Tensor: Output segmentation map.
"""
return self.forward(inputs)
def cls_seg(self, feat):
"""Classify each pixel."""
if self.dropout is not None:
feat = self.dropout(feat)
o... | Python | 1 |
e, image_sz, transforms):
"""Extract features from a set of transformed image samples.
args:
im: Image.
pos: Center position for extraction.
scale: Image scale to extract features from.
image_sz: Size to resize the image samples to before extraction.
... | Python | 1 |
batch.detach()
logger.update_scalar('error', e_batch/0.693147)
logger.update_scalar('accuracy', 100.0*a_batch)
if e_val < e_best:
i_best = i
e_best = e_val
state_best = model.state_dict()
logger.add_update_scalars(i, tag_suffix='val')
logger.f... | Python | 1 |
le_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<IntersectionMaskCircle_t>())).m_flCenterX as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(IntersectionMaskCircle_t),
"::",
stringify!(m_flCen... | Rust | 0 |
overworld_spot.name == "Overworld - Mac Ship Doom" or "Focus Tower" in overworld_spot.name
or "Doom Castle" in overworld_spot.name or overworld_spot.name == "Overworld - Giant Tree"):
continue
exits = list(overworld_spot.c... | Python | 1 |
nd public
// of the File
file.set_name(request.name);
file.set_file_name(request.file_name);
file.set_extension(request.extension);
file.set_folder_id(request.folder_id);
file.set_public(request.public);
// Request the DataStore update the file record
ma... | Rust | 0 |
import gdb
import re
from gdb_providers import *
from rust_types import *
_gdb_version_matched = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION)
gdb_version = [int(num) for num in _gdb_version_matched.groups()] if _gdb_version_matched else []
def register_printers(objfile):
objfile.pretty_printers.append(lookup)
... | Python | 1 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from facebook_business.adobjects.abstractobject import AbstractObject
"""
This class is auto-generated.
For any issues o... | Python | 1 |
import pandas as pd
def Volume_Weighted_MACD(close: pd.Series, volume: pd.Series, period_fast: int = 12, period_slow: int = 26, signal: int = 9, adjust: bool = True) -> pd.Series:
"""
Calculates the Volume-Weighted Moving Average Convergence Divergence (VW_MACD) and its signal line from the given price data.
... | Python | 1 |
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, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF AN... | Rust | 0 |
or KSPROPERTY_BDA_RF_TUNER_CAPS_S {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: 'Win32_Media_DirectShow', 'Win32_Media_KernelStreaming'*"]
#[cfg(feature = "Win32_Media_KernelStreaming")]
pub struct KSPROPERTY_BDA_RF_TUNER_SCAN_STATUS_S {
pub Property: super::KernelStr... | Rust | 0 |
iterator.for_each(|item,_,_| {
output.session(&item)
.give_iterator(acc.drain(..)
.enumerate()
.filter(|x| x.1 != 0.0)
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.