text string | label_name string | labels int64 |
|---|---|---|
oc, 'TensorMol.tex', u'TensorMol Documentation',
u'K. Yao, J. E. Herr, J. Parkhill', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_d... | Python | 1 |
#-----------------------------------------------------------------------------
# Copyright (c) 2022-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | Python | 1 |
from math import * #old import * from math
print("Ruudu karakteristikud")
a=int(input("Sisesta ruudu külje pikkus => ")) #added int and changed ' on "
S=a**2
print("Ruudu pindala", S)
P=4*a
print("Ruudu ümbermõõt", P) #changed '' on "
di=a*sqrt(2) #math.sqr(2) change to sqrt
print("Ruudu diagonaal", round(di,2))
print(... | Python | 1 |
ith the submutators for every field given as argument, for example:
/// ```
/// # #![feature(no_coverage)]
/// use fuzzcheck::DefaultMutator;
///
/// #[derive(Clone, DefaultMutator)]
/// enum Either<A, B> {
/// Left(A),
/// Right(B)
/// }
/// let mutator = EitherMutator::new(u8::default_mutator(), bool::default... | Rust | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# 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 ... | Python | 1 |
nt = two.clone() << (p.to_usize().unwrap() - 1);
power.clone() - 1.to_biguint().unwrap()
}
}
pub fn render(model: &crate::Model) -> Node<Msg> {
let mut html = vec![];
let mersennes = mersenne_utils::mersennes();
for n in 1..mersennes.len() {
let mersenne_download = mersenne_utils::Mers... | Rust | 0 |
s = "GST_VIDEO_COLOR_PRIMARIES_BT470M")]
Bt470m,
#[doc(alias = "GST_VIDEO_COLOR_PRIMARIES_BT470BG")]
Bt470bg,
#[doc(alias = "GST_VIDEO_COLOR_PRIMARIES_SMPTE170M")]
Smpte170m,
#[doc(alias = "GST_VIDEO_COLOR_PRIMARIES_SMPTE240M")]
Smpte240m,
#[doc(alias = "GST_VIDEO_COLOR_PRIMARIES_FILM")]... | Rust | 0 |
(x_pred):
"""Calculate the PDE residual for Burgers' equation.
The viscous Burgers equation is: ∂u/∂t + u∂u/∂x = ν∂²u/∂x²
where ν is the viscosity coefficient (0.01 in this case)
Args:
x_pred (torch.Tensor): Predicted solution tensor
Should contain single channel for u field
R... | Python | 1 |
else if map.tiles.line_of_fire(firing.x, firing.y, x, y).is_some() {
colours::ORANGE
} else {
colours::WHITE
};
// Draw the chance-to-hit
ctx.render_text(
&format!("{... | Rust | 0 |
s(vm)))
return f
do_OP_1ADD = make_unary_num_op(lambda x: x + 1)
do_OP_1SUB = make_unary_num_op(lambda x: x - 1)
do_OP_2MUL = make_unary_num_op(lambda x: x << 1)
do_OP_2DIV = make_unary_num_op(lambda x: x >> 1)
do_OP_NEGATE = make_unary_num_op(lambda x: -x)
do_OP_ABS = make_unary_num_op(lambda x: abs(x))
def do... | Python | 1 |
)]
pub struct WSMessage {
pub message_type: WSMessageType,
pub key: Option<String>,
pub data: Option<String>,
}
//! Completion tests for expressions.
use expect_test::{expect, Expect};
use crate::tests::{completion_list, BASE_ITEMS_FIXTURE};
fn check(ra_fixture: &str, expect: Expect) {
let actual = co... | Rust | 0 |
ger available, so this may not be entirely useful;
/// however, it does limit the amount of commits somewhat.
const EPOCH_COMMIT: &str = "927c55d86b0be44337f37cf5b0a76fb8ba86e06c";
const REPORT_HEADER: &str = "\
==================================================================================
= Please file this regre... | Rust | 0 |
8203;
///
/// <img src="https://raw.githubusercontent.com/dtolnay/colorous/readme/cool.png" width="100%" height="40" alt="cool">
pub const COOL: Gradient = Gradient {
eval: &InterpolateCubehelix {
name: "Cool",
start: Cubehelix {
h: 260.0,
s: 0.75,
l: 0.35,
... | Rust | 0 |
e.VERBOSE,
),
"setval": _tmplt_ospf_int_passive,
"compval": "address_family.passive",
"result": {
"name": "{{ name + '.' + vif if vif is defined else name }}",
"address_family": {
"{{ afi }}": {
"... | Python | 1 |
rial()
# self.draw_model(fraction=fraction)
self.vangogh.draw_model(fraction=fraction)
self.add_block_labels(fraction=fraction)
# # debug here
# femm.mi_maximize()
# femm.mi_zoomnatural()
# return
list_ans_file = []
for freq in freq_range:
... | Python | 1 |
c[0]) / 2.0;
qc[1] = (-ya - yb + 4.0 * xc[1]) / 2.0;
self.canvas_edges
.polycurve_add(xa, ya, PolyCode::MoveTo)
.polycurve_add(qc[0], qc[1], PolyCode::Curve3)
.polycurve_add(xb, yb, PolyCode::Curve3);
... | Rust | 0 |
= stats.pearsonr(y_true.reshape(-1), y_pred.reshape(-1))
spearmanr = stats.spearmanr(y_true.reshape(-1), y_pred.reshape(-1))
# write training summary for the epoch
print('epoch: {}\trmse:{:0.4f}\tr2: {:0.4f}\t pearsonr: {:0.4f}\tspearmanr: {:0.4f}\tmae: {:0.4f}\tpred'.format(epoch+1, mse**(1/2... | Python | 1 |
13, 14, 14, 15, 12, // left
16, 17, 18, 18, 19, 16, // front
20, 21, 22, 22, 23, 20, // back
];
let texture = factory.create_texture_rgba8(1, 1).unwrap();
factory.update_texture(
&texture, &(*texture.get_info()).into(),
&[0x20u8, 0xA0u8, 0xC0u8, 0x00u8],
None).unwra... | Rust | 0 |
from django.urls import path
from . import views
urlpatterns = [
path('login/', views.login,name='login'),
path('logout/', views.logout, name='logout'),
path('', views.products,name='products'),
path('productDetails/<int:id>', views.productDetails,name='productDetails'),
path('addProduct/', views.addProduct,name='addP... | Python | 1 |
nel>Linux-Sysmon/Operational</Channel>
/// <Computer>hostname</Computer>
/// <Security UserId="0"/>
/// </System>
/// <EventData>
/// <Data Name="RuleName">-</Data>
/// <Data Name="UtcTime">2022-01-04 19:52:56.319</Data>
/// <Data Name="ProcessGuid">{49e2a5f6-a598-61d4-5d5a-d1755b550000}</Data>
... | Rust | 0 |
should offer a refined, accurate, and comprehensive reply to the instruction. Ensure your response is well-structured, coherent, and adheres to the highest standards of accuracy and reliability.
Responses from models:"""
for i, reference in enumerate(references):
system += f"\n{i+1}. {reference}"
#... | Python | 1 |
eColor {
fn get_color(&self, repo: &TextureRepository) -> Vec3 {
self.sample(repo, self.texture)
}
fn get_material(&self) -> Material {
self.material
}
fn sample(&self, repo: &TextureRepository, id: TextureID) -> Vec3 {
let sampler = LinearSampler {};
let coords = s... | Rust | 0 |
import shutil
from pathlib import Path
from fastapi import Depends, HTTPException, status
from prisma.models import Bot, User
from app.api.helpers.security import check_user
from app.auto_gpt.api_manager import GPT_CACHE
from app.core import settings
from app.helpers.jobs import abort_job
async def get_bot(user: Us... | Python | 1 |
# -*- coding: utf-8 -*-
#
# This file is part of Bika LIMS
#
# Copyright 2011-2017 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import ClassSecurityInfo
from Products.ATExtensions.ateapi import RecordsField
from Products.Archetypes.Registry import registerField
from Product... | Python | 1 |
.setText(_translate("SystemControlWindow", "Input Function:"))
self.ControlSystems_1_Input_tabWidget.setTabText(self.ControlSystems_1_Input_tabWidget.indexOf(self.ControlSystems_1_Input_1I), _translate("SystemControlWindow", "Input"))
self.ControlSystems_1_Input_tabWidget.setTabText(self.ControlSystems_... | Python | 1 |
&mcol_scan_32x32, iscan: &av1_mcol_iscan_32x32, neighbors: &mcol_scan_32x32_neighbors },
],
[
// TX_4X8
SCAN_ORDER { scan: &default_scan_4x8, iscan: &av1_default_iscan_4x8, neighbors: &default_scan_4x8_neighbors },
SCAN_ORDER { scan: &default_scan_4x8, iscan: &av1_default_iscan_4x8, neighbors: &default_scan_4x... | Rust | 0 |
Alarm event.
self.exti.imr.modify(|_, w| w.mr17().set_bit());
// Rising edge for line 17.
self.exti.rtsr.modify(|_, w| w.tr17().set_bit());
}
fn teardown(&self) {
toggle_alarm(&self.rtc, false);
// Disable the LSI.
self.rcc.regs.csr.modify(|_, w| w.lsion().clea... | Rust | 0 |
import string
text = ("Таким образом, повышение уровня гражданского сознания позволяет оценить значение новых предложений?"
" Повседневная практика показывает, что сложившаяся структура организации способствует повышению актуальности"
" ключевых компонентов планируемого обновления. Практический опыт по... | Python | 1 |
import sys
import struct
__version__ = "0.4.2"
def get_platform():
bits = struct.calcsize("P") * 8
if sys.platform.startswith("linux"):
return "linux{}".format(bits)
elif sys.platform.startswith("win"):
return "win{}".format(bits)
elif sys.platform.startswith("cygwin"):
return... | Python | 1 |
(*(::std::ptr::null::<clfftSetupData>())).minor as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(clfftSetupData),
"::",
stringify!(minor)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<clfftSetupData>())).p... | Rust | 0 |
(opts.into())).unwrap();
let instance_id = uid.instance_id();
let snowflake_epoch_offset = uid.custom_epoch();
assert_eq!(instance_id as u16, custom_instance_id);
assert!(snowflake_epoch_offset >= now && now < snowflake_epoch_offset + 2.0)
}
#[wasm_bindgen_test]
fn create_snowflake_with_custom_instance_id_and_c... | Rust | 0 |
# print(xrange(3))
# NameError: name 'xrange' is not defined
print(range(3))
# range(0, 3)
print(type(range(3)))
# <class 'range'>
for i in range(3):
print(i)
# 0
# 1
# 2
print(list(range(3)))
# [0, 1, 2]
print(list(range(10)))
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
print(list(range(-3)))
# []
print(list(range(3, ... | Python | 1 |
AccessibilityNodeInfo;\0");
__jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
/// [addExtraDataToAccessibilityNodeInfo](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeProvider.html#addExtraDataToAccessib... | Rust | 0 |
vari()?),
None => None,
})
}
}
impl Spanned<$val> {
pub fn $into_vari(self) -> Result<$ty> {
let span = self.span;
self.value.$into_vari().map_err(move |e|
e.map_details(|d| d.downcast::<Err... | Rust | 0 |
!("3 is {:?}", get_kind('3'));
println!("n is {:?}", get_kind('n'));
println!("P is {:?}", get_kind('P'));
println!("\\t is {:?}", get_kind('\t'));
println!("* is {:?}", get_kind('*'));
}
{
enum Shape {
Rect(i32, i32, i32, i32),
Circle(i32, i32, i... | Rust | 0 |
::id(), false),
AccountMeta::new_readonly(*authorized_voter_pubkey, true),
];
Instruction::new_with_bincode(id(), &VoteInstruction::Vote(vote), account_metas)
}
pub fn vote_switch(
vote_pubkey: &Pubkey,
authorized_voter_pubkey: &Pubkey,
vote: Vote,
proof_hash: Hash,
) -> Instruction {
... | Rust | 0 |
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1
import typing, winrt
import enum
_ns_module = winrt._import_ns_module("Windows.Security.Cryptography.Certificates")
try:
import winrt.windows.foundation
except:
pass
try:
import winrt.windows.foundation.collections
ex... | Python | 1 |
10-100
impl Solution {
pub fn number_of_lines(widths: Vec<i32>, s: String) -> Vec<i32> {
if s.is_empty() {
return vec![0, 0];
}
let mut lines = 1;
let mut cur_line_num = 0;
s.as_bytes().iter().for_each(|&c| {
let cur_num = widths[(c - b'a') as usize];
if cur_line_num + cur_num > ... | Rust | 0 |
fetches = futures::stream::iter(
podcasts.into_iter().map(|podcast| {
async move {
match check_feed_is_updated(&podcast.url, &podcast.etag.as_str(), podcast.last_modified, podcast.id).await {
Ok(resp) => {
match resp {
... | Rust | 0 |
PhoneAutoReceptionists {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
PhoneAutoReceptionists { client }
}
/**
* Update auto receptionist details.
*
* This function performs a `PATCH` to the `/phone/auto_receptionists/{autoReceptionistId}` endpoint.
*
* An auto re... | Rust | 0 |
[]
if bitmap.native_mipmap_info_tag_block.count > 0:
native_mipmap_info_node = tag_format.get_xml_node(XML_OUTPUT, bitmap.native_mipmap_info_tag_block.count, bitmap_element_node, "name", "native mipmap info")
bitmap.native_mipmap_info_header = TAG.TagBlockHeader().read(input_... | Python | 1 |
h single component use path such as `use cratename;`
/// is not necessary, and thus should be removed.
///
/// **Known problems:** None.
///
/// **Example:**
///
/// ```rust,ignore
/// use regex;
///
/// fn main() {
/// regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
... | Rust | 0 |
rmal_bucket.weight_good.sum(),
'total': abnormal_bucket.weight.sum(),
})
else:
self.woe_abnormal = pd.DataFrame()
def calculate_woe(
self,
woe: DataFrame,
bucket_type: Optional[int] = 0,
reset_boundary: Optional[bool] =... | Python | 1 |
; 5] = [
BUTTON1_PIN,
BUTTON2_PIN,
BUTTON3_PIN,
BUTTON4_PIN,
BUTTON_RESET_PIN,
];
/// NRF52-DK UART RTS
pub const UART_RTS: u32 = 5;
/// NRF52-DK UART TXD
pub const UART_TXD: u32 = 6;
/// NRF52-DK UART CTS
pub const UART_CTS: u32 = 7;
/// NRF52-DK UART RXD
pub const UART_RXD: u32 = 8;
use crate::db... | Rust | 0 |
timeout.encode());
encoded.extend(app_state.session_id.encode());
return encoded;
}
} /*
* The Jira Cloud platform REST API
*
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: <EMAIL>
* Generated by: https://openapi-generator.... | Rust | 0 |
Clone for DEBUG_SYMBOL_SOURCE_ENTRY {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"]
pub const DEBUG_SYMENT_IS_CODE: u32 = 1u32;
#[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"]
pub const DEBUG_SYMENT_IS_DATA: u32 = 2u32;
#[do... | Rust | 0 |
where
R: RngCore + CryptoRng;
}
/// A scheme that can be used to randomly generate a share of a bit that is unknown to all participants.
#[delegatable_protocol]
pub trait RandomBitGenerationScheme<T, S, P>
where
T: PrimeField,
{
/// Generate a random number and obtain a share of it, without learni... | Rust | 0 |
aram.requires_grad = False
return model
models = {
'link_res':{
'model': get_link_resnet_model(),
'path': 'Models/linknet_resnet_with_cel_check_points.pt'
}
}
loss_values = {}
accuracy_values = {}
model_name = 'link_res'
multiprocessing.freeze_support()
optimizer = optim.Adam(filter(l... | Python | 1 |
{
match self {
QuerySort::Popular => "count_views",
QuerySort::Hot => "count_ups",
QuerySort::New => "created_at",
QuerySort::Active => "updated_at",
}
}
}
#[derive(Deserialize, Clone, Debug)]
pub enum QueryFlag {
#[serde(rename(deserialize = "un... | Rust | 0 |
// No CPSR register in ThreadInfo(it's not accessible via ptrace)
out.cpsr = 0;
#[cfg(not(target_os = "android"))]
{
out.float_save.fpscr = self.fpregs.fpsr as u64 | ((self.fpregs.fpcr as u64) << 32);
out.float_save.regs = [0; MD_FLOATINGSAVEAREA_ARM_FPR_COUNT];... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from .builder import (COMPONENTS, DECODERS, ENCODERS, FLOW_ESTIMATORS,
build_components, build_decoder, build_encoder,
build_flow_estimator)
from .decoders import (FlowNetCDecoder, FlowNetSDecoder, FlowRefine,
... | Python | 1 |
db.engine.get_value(b"a").unwrap();
assert!(val.is_some());
db.engine.delete(b"a").unwrap();
let val = db.engine.get_value(b"a").unwrap();
assert!(val.is_none());
wb.pop_save_point().unwrap();
wb.write().unwrap();
let val = db.engine.get_value(b"a").unwrap();
assert!(val.is_some());... | Rust | 0 |
import lemon
class MyWorkflow(lemon.Workflow):
def worker(self, entry, pdbid):
import lemon
# Selection phase
smallm = lemon.select_small_molecules(entry, lemon.small_molecule_types, 10)
if (len(smallm) == 0):
return ""
# Pruning phase
lemon.prune_ident... | Python | 1 |
self.fade = 1.0 / 8.0;
self.zoom = false;
self.zoom_offset = Self::ZOOM_OFFSET;
}
}
impl Completable for FlashBattleTransition {
fn finished(&self) -> bool {
self.index >= Self::FINAL_INDEX && self.waning
}
}
pub fn max_score_sightseeing_pair(a: Vec<i32>) -> i32 {
// 公式... | Rust | 0 |
n = int(input("Enter any number: "))
i = 2
while i<=n-1:
if n % i == 0:
break;
i = i + 1
if i==n:
print("The number is Prime")
else:
print("The number is not prime") | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright 2023 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... | Python | 1 |
n\
\n\
USAGE: {} [FLAGS] JSON_OUTPUT\n\
\n\
FLAGS:\n\
-h, --help Prints help information",
name,
);
if let Some(wrong_args) = wrong_args {
eprintln!("error: unrecognized args:... | Rust | 0 |
ub mod handle;
pub mod inspect;
pub mod interpolation;
pub mod iterator;
pub mod once;
use crate::external_command_checker;
use bio::alignment::sparse::hash_kmers;
use bio::io::fasta::IndexedReader;
use bio::stats::{
bayesian,
probs::{LogProb, PHREDProb, Prob},
};
use bird_tool_utils::command;
use estimation::c... | Rust | 0 |
.0\r\nMessage-ID: \
<{}.lettre@localhost>\r\n\r\nHello World!\r\n",
date_now.rfc822z(),
id
)
);
}
#[test]
fn test_custom_message_id() {
let email_builder = EmailBuilder::new();
let date_now = now();
let email: Sen... | Rust | 0 |
SellingResourceState::InUse;
Ok(())
}
}
<reponame>smmalis37/aoc2020<filename>src/days/day14.rs
use rustc_hash::FxHashMap;
use crate::{day_solver::DaySolver, util::*};
pub struct Day14;
#[derive(Copy, Clone)]
pub enum Op {
Mask(u64, u64, u64),
Assign(u64, u64),
}
use Op::*;
impl DaySolver<'_> ... | Rust | 0 |
_b_log, img1_warped_merged])
with nd.Scope('refNet', **self.scope_args()):
arch = Architecture_S(
num_outputs=pred_config.total_channels(),
disassembling_function=pred_config.disassemble,
conv_upsample=True,
loss_function=... | Python | 1 |
1764784474925535298,
5132268748786976403,
14007269090915984241,
16228556843064665646,
6786619220176084699,
8781872344617115798,
14818695140861444492,
3803689984658392692,
8867348272163989449,
4445582801996948090,
1814340225932887761,
7442302284644936579,
8934573719166... | Rust | 0 |
from logging import DEBUG, INFO
import pytest
import torch
from laia.utils import check_tensor
@pytest.mark.parametrize("raise_exception", [True, False])
def test_check_tensor(caplog, raise_exception):
tensor = torch.tensor([1, float("inf"), 3])
caplog.set_level(DEBUG)
if raise_exception:
with p... | Python | 1 |
import os
import xml.etree.ElementTree as ET
import xml.dom.minidom
def get_environment_variables():
username = os.getenv("CENTRAL_TOKEN_USERNAME")
password = os.getenv("CENTRAL_TOKEN_PASSWORD")
server_id = os.getenv("SONATYPE_SERVER_ID")
settings_xml_path = os.getenv("SETTINGS_XML_PATH")
if not ... | Python | 1 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# File: role.py
# Author: Super Junior
# Email: easelify@gmail.com
# Time: 2024/07/06 01:57
import traceback
from fastapi import APIRouter, HTTPException, Depends
from app.core.log import logger
from app.core.security import check_permission
from app.services import ro... | Python | 1 |
from collective.transmute.cli import app
from typer.testing import CliRunner
runner = CliRunner()
def test_run_app(test_dir):
result = runner.invoke(app, ["settings"])
assert result.exit_code == 0
stdout = result.stdout
assert "Settings used by this application" in stdout
def test_run_app_no_trans... | Python | 1 |
t self, vec3: &Vec3);
}
impl Vec3Collection for Vec<u8> {
fn push_vec(&mut self, vec: &Vec3) {
self.push((vec[0] * 255.999) as u8);
self.push((vec[1] * 255.999) as u8);
self.push((vec[2] * 255.999) as u8);
}
}
impl std::ops::Index<usize> for Vec3 {
type Output = f64;
fn index(&self, index: usize) -> &f64 {... | Rust | 0 |
name: "name",
has_profile_prefix: true
}
);
assert_eq!(
ProfileName::parse("profile name "),
ProfileName {
name: "name",
has_profile_prefix: true
}
);
assert_eq!(
P... | Rust | 0 |
::new(&(p / layer_index), config));
};
BertEncoder { output_attentions, output_hidden_states, layers }
}
pub fn forward_t(&self,
hidden_states: &Tensor,
mask: &Option<Tensor>,
encoder_hidden_states: &Option<Tensor>,
... | Rust | 0 |
/// A `///` comment, or something of the like.
/// All lines in a comment should start with the same symbol.
SingleLines,
/// A `/**` comment, where each other line can start with `*` and the
/// entire block ends with `*/`.
MultiLine,
}
/// Preprocesses a C/C++ comment so that it is a valid Rust c... | Rust | 0 |
from .cdan import train_cdan
from .plain import train_plain
from .dann import train_dann
from .safn import train_safn
from .mcc import train_mcc
from .memsac import train_memsac
from .mdd import train_mdd
from .mcd import train_mcd
from .toalign import train_toalign
from .adamatch import train_adamatch
from .daln impor... | Python | 1 |
)
}
fn interp(start_color: u8, end_color: u8, scale: f64) -> u8 {
((end_color as f64 - start_color as f64) * scale + start_color as f64) as u8
}
}use proxy_wasm::traits::{Context, StreamContext};
use proxy_wasm::types::*;
#[no_mangle]
pub fn _start() {
proxy_wasm::set_stream_context(|_, _| -> ... | Rust | 0 |
crate::global_search_ui;
use crate::global_search_ui::GlobalSearchUI;
use crate::global_search_ui::slots::GlobalSearchSlots;
use crate::LIGHT_PALETTE;
#[cfg(feature = "only_for_the_brave")]
use crate::locale::qtr;
use crate::locale::tr;
use crate::QT_PROGRAM;
use crate::QT_ORG;
use crate::packfile_contents_ui::PackFil... | Rust | 0 |
.message)
}
}
fn read_error_or_notice<T: Read>(reader: &mut T) -> io::Result<PgErrorOrNotice> {
let mut fields = BTreeMap::new();
while let field_code @ 1 ... 255 = try!(reader.read_u8()) {
fields.insert(field_code, try!(reader.read_cstr()));
}
Ok(PgErrorOrNotice {
severity: fields.... | Rust | 0 |
curve_to(&mut self, argx1: f64, argy1: f64, argx2: f64, argy2: f64) {
let mut t: f64 = 0.0;
let mut u: f64;
let mut tt: f64;
let mut uu: f64;
let mut x: f64;
let mut y: f64;
let tmp_point = self.points[self.points.len() - 1];
while t < 1.0 {
u... | Rust | 0 |
"""
pip install m3u8 first, please
"""
import sys
import m3u8
import time
import urllib2
import os
class Player:
def __init__(self, url):
self.url = url
try:
playlist = m3u8.load(url)
while playlist.is_variant: # multiple bitrates videos
self.url = playlist... | Python | 1 |
person> to <department>,\n remove <person> from <department>"
)
}
}
fn format_message(message: models::Message) -> String {
match message {
models::Message::AddedDepartment { name } => format!("Added department {}", name.bold()),
models::Message::AddedUser { name, department } => {... | Rust | 0 |
is the final output value.",)
FUNCTION = "doit"
DESCRIPTION = ""
CATEGORY = "InspirePack/List"
def doit(self, item_list):
l = ListWrapper([])
if hasattr(item_list, 'aux'):
l.aux = item_list.aux
else:
logging.warning("[Inspire Pack] DropItems: `item_li... | Python | 1 |
ove_outer_parentheses("()()".to_string()), "".to_string());
}
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
/// Output a `&str` to the browser console
#[wasm_bindgen(js_namespace = console)]
pub fn log(msg: &str);
}
/// Set `console_error_panic_hook` once. This allows to get better error
/// mess... | Rust | 0 |
o: {conflict_ratio}')
print(len(result))
print(*sorted(result))
# results = [x[0] for x in cut_candidates]
best_prop, best_conflicts = None, None
best_ratio_prop, best_ratio_conflicts = -1, 1.01
for result in results:
prop_ratio, conflict_ratio = fitness(g, result, 5000)... | Python | 1 |
losed")),
};
parsed
}
/// Specific parsing function for pushbutton
fn parse_f60201_data(payload: &Vec<u8>) -> HashMap<String, String> {
let mut result = HashMap::new();
match bit_of_byte(3, &payload[0]) {
false => result.insert(String::from("LRNB"), String::from("Teach-in telegram")),
tr... | Rust | 0 |
_base_ = [
'../../../_base_/datasets/mmdet/coco_detection.py',
'mmdet::_base_/schedules/schedule_2x.py',
'mmdet::_base_/default_runtime.py'
]
teacher_ckpt = 'https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r101_fpn_2x_coco/faster_rcnn_r101_fpn_2x_coco_bbox_mAP-0.398_20200504_210455-... | Python | 1 |
import sqlite3
import logging
import threading
import os
import time
from contextlib import contextmanager
from config import Config
import resend
import secrets
from urllib.parse import urljoin
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
class DatabaseManager:
def ... | Python | 1 |
import pygame
# Define as direções de movimento
direcoes_movimento = {
pygame.K_w: (0, -2),
pygame.K_s: (0, 2),
pygame.K_a: (-2, 0),
pygame.K_d: (2, 0),
pygame.K_UP: (0, -2),
pygame.K_DOWN: (0, 2),
pygame.K_LEFT: (-2, 0),
pygame.K_RIGHT: (2, 0)
}
LARGURA_TELA, ALTURA_TELA = 928, 576
F... | Python | 1 |
= Compressed;
}
0b10 => {
let _ = try!(self.read_dynamic_tables());
self.btype = Compressed;
}
_ => fail!("reserved block type")
}
Ok(())
}
fn read_dynamic_tables(&mut self) -> IoResult<()> {
let totalcode... | Rust | 0 |
import os, time
####---------------------AUTOSAVE---------------------------AUTOSAVE
try:
###3 autoload
a = open("game.list","r")
gamelist = eval(a.read())
a.close()
except:
gamelist = []
###-------------------------SUBROUTINES---------------------------------------SUBROUTINE
def add():
item = input("Inpu... | Python | 1 |
import dataclasses
import logging
import re
import shlex
from . import common_fs_utils
from .. import os_utils
@dataclasses.dataclass
class _Subvolume:
id: int
gen: int
top_level: int
# Note: Path varies based on directory passed.
# It may be relative if a relative path exists.
path: str
de... | Python | 1 |
def xywh2ltwh(x):
"""
Convert the bounding box format from [x, y, w, h] to [x1, y1, w, h], where x1, y1 are the top-left coordinates.
Args:
x (np.ndarray | torch.Tensor): The input tensor with the bounding box coordinates in the xywh format
Returns:
y (np.ndarray | torch.Tensor): The bo... | Python | 1 |
"""
Basic functions for diffusion prior parameters
"""
import numpy as np
import torch
def sigma_to_t(sigma, diffusion):
from scipy import interpolate
alpha_cumprod_to_t = interpolate.interp1d(
diffusion.alphas_cumprod, np.arange(0, diffusion.num_timesteps)
)
alpha_cumprod = 1.0 / (sigma**2... | Python | 1 |
#!/usr/bin/python3
""" script that takes in an argument and displays all values in
the states table of hbtn_0e_0_usa where name matches the argument
"""
import MySQLdb
from sys import argv
if __name__ == '__main__':
"""
Main execution block
Connects to the database and retrieves the states
"""
# C... | Python | 1 |
# coding=utf=8
#!/usr/bin/env python
# Code adapted from https://gis.stackexchange.com/a/418152/205005 user Nickname Nick
# converted to Python by mkrupczak3
import math
import numpy as np
from WGS84_SK42_Translator import Translator as Translator # rafasaurus' SK42 coord translator
class Projector(object):
... | Python | 1 |
fd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4}
DEFINE_PROPERTYKEY!{PKEY_Device_Service,
0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 6}
DEFINE_PROPERTYKEY!{PKEY_Device_Class,
0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 9}
DEFINE_PROPERTYKEY!... | Rust | 0 |
Set(u) => u.apply_ty(args),
ValueEnum::Product(p) => p.apply_ty(args),
ValueEnum::Parameter(p) => unimplemented!("Parameter application for parameter {}", p),
ValueEnum::Sexpr(s) => unimplemented!("Partial evaluation application for sexpr {}", s),
v => panic!(
... | Rust | 0 |
value = self.get_value();
let mut output_text = CDisposableString::default();
let mut component_rects = CVec::<Rect>::default();
let mut component_texts = CVec::<CDisposableString>::default();
let mut component_confidences = CVec::<f32>::default();
unsafe {
cv_ocr_ru... | Rust | 0 |
s)]
trait Bar<const N: usize> {}
trait Foo<'a> {
const N: usize;
type Baz: Bar<{ Self::N }>;
}
<gh_stars>0
/// "a" is base layer, "b" is top layer
/// special thanks to https://en.wikipedia.org/wiki/Blend_modes#Overlay for existing,
/// as well as https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending... | Rust | 0 |
if child.is_source() || !child.is_differentiable() {
// Add to result, but don't allow any more recursive search
// because there will be no `wrt` nodes in this direction....
ret.insert(
child.id,
... | Rust | 0 |
3665548261061424989E1);
const_f64_as_f64x4!(S3asin, -2.194779531642920639778E1);
const_f64_as_f64x4!(S2asin, 1.470656354026814941758E2);
const_f64_as_f64x4!(S1asin, -3.838770957603691357202E2);
const_f64_as_f64x4!(S0asin, 3.424398657913078477438E2);
const_f64_as_f64x4!(P5asin, 4.253011369004428248... | Rust | 0 |
# -*- coding: utf-8 -*-
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
# Observer.py ---
# --------------------------------
# Copyright (c) 2020
# L. CAPOCCHI (capocchi@univ-corse.fr)
# SPE Lab - SISU Group -... | Python | 1 |
`TEST_INFLUXDB_IOX_CATALOG_DSN=postgres://postgres@localhost/iox_shared_test` \
would connect to a Postgres catalog."
)
}
(false, Some(_)) => {
eprintln!("skipping NG end-to-end integration tests - set TEST_INTEGRATION to run");
... | Rust | 0 |
# Copyright 2016 Google Inc. 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 law or a... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.