text string | label_name string | labels int64 |
|---|---|---|
aniel5151/gdbstub/tree/master/examples/armv4t)
//! example contains basic implementations off almost all protocol extensions,
//! making it an incredibly valuable reference when implementing protocol
//! extensions.
//!
//! ### The `Connection` Trait
//!
//! First things first: `gdbstub` needs some way to communicate w... | Rust | 0 |
")]
impl ::core::clone::Clone for TF_SELECTIONSTYLE {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: 'Win32_UI_TextServices'*"]
pub const TF_SENTENCEMODE_AUTOMATIC: u32 = 4u32;
#[doc = "*Required features: 'Win32_UI_TextServices'*"]
pub const TF_SENTENCEMODE_CONVERSATION: u32 = 16u32;
... | Rust | 0 |
"""
Tests for pika.exceptions
"""
import unittest
from pika import exceptions
# missing-docstring
# pylint: disable=C0111
# invalid-name - our tests use long, descriptive names
# pylint: disable=C0103
class ExceptionTests(unittest.TestCase):
def test_amqp_connection_error_one_param_repr(self):
self.a... | Python | 1 |
import os
import sys
import types
import datetime
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
# minimal stub for the optional dateparser dependency
fake_dp = types.ModuleType("dateparser")
def _parse(text, *_, **__):
try:
return datetime.datetime.strptime(text, "%d/%m/%Y %H:%M")
ex... | Python | 1 |
}
/// An iterator over the lines of a string.
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.4.0", reason = "use lines() instead now")]
#[inline]
#[allow(deprecated)]
pub fn lines_any(&self) -> LinesAny {
core_str::StrExt::lines_any(self)
}
/// Ret... | Rust | 0 |
_dims=[1024, 1024, 1024], token_dims=[1024, 1024, 1024],
downsample_ratios=[16, 1, 1], NC_depth=[0, 0, 24], NC_heads=[1, 1, 16], RC_heads=[1, 1, 1], mlp_ratio=4., NC_group=[1, 1, 256], RC_group=[1, 1, 1], class_token=True, **kwargs)
model.default_cfg = default_cfgs['ViTAE_basic_Tiny']
... | Python | 1 |
"tir.detect_global_barrier": detect_global_barrier,
}
):
f = tvm.build(s, [s_scan, Whh], target)
dev = tvm.cuda(0) if target == "cuda" else tvm.cl(0)
# launch the kernel.
res_np = np.zeros((n_num_step, n_batch_size, n_num_hidden)).astype("float32")... | Python | 1 |
Error::ValueBufferTooLong);
}
Ok(())
}
fn copy_into_slice(&self, bytes: &mut [u8]) -> usize {
assert!(bytes.len() >= self.len());
LittleEndian::write_u16(&mut bytes[0..2], self.conn_handle.0);
LittleEndian::write_u16(&mut bytes[2..4], self.characteristic_handle.0);
... | Rust | 0 |
sens2 = (
grad_norm
* smooth_param
/ (
(lrp.num_samples * phess) * min_eval**2
+ smooth_param * min_eval
)
)
noise2 = np.random.normal(scale=sens2 * std_hess, size=lrp.dim)
return (
w_cur
- np.linalg.solve(
... | Python | 1 |
"x86_64-linux-android" => {
dst.define("ANDROID_ABI", "x86_64");
dst.define("CMAKE_ANDROID_ARCH_ABI", "x86_64");
}
_ => panic!("Unknown android triple"),
}
}
fn find_ninja(sdk_path: &Path) -> Option<PathBuf> {
let cmk = sdk_path.join("cmake");
for subdir in fs::re... | Rust | 0 |
point: egui::Vec2,
zoom_min: f32,
zoom_max: f32,
) {
let zoom_clamped = (self.zoom + zoom_delta).clamp(zoom_min, zoom_max);
let zoom_delta = zoom_clamped - self.zoom;
self.zoom += zoom_delta;
self.pan += point * zoom_delta;
}
}
extern crate rudy;
use rudy... | Rust | 0 |
for js_file in js_files:
js_url = f"{self.client.base_url}/_next/{js_file}"
js_response = requests.get(js_url)
if js_response.status_code == 200:
js_content = js_response.text
match = key_pattern.search(js_content)
... | Python | 1 |
</s> · Constant"]
pub const FN_GET_PHYSICAL_DEVICE_DISPLAY_PROPERTIES_KHR: *const std::os::raw::c_char = crate::cstr!("vkGetPhysicalDeviceDisplayPropertiesKHR");
#[doc = "<s>Vulkan Manual Page</s> · Constant"]
pub const FN_GET_PHYSICAL_DEVICE_DISPLAY_PLANE_PROPERTIES_KHR: *const std::os::raw::c_char = crate::cstr!("vkG... | Rust | 0 |
fn IsItemDeactivatedAfterEdit() -> bool;
#[link_name = "?IsItemToggledOpen@ImGui@@YA_NXZ"]
pub fn IsItemToggledOpen() -> bool;
#[link_name = "?IsAnyItemHovered@ImGui@@YA_NXZ"]
pub fn IsAnyItemHovered() -> bool;
#[link_name = "?IsAnyItemActive@ImGui@@YA_NXZ"]
pub fn IsAnyItemActive() -> bool;... | Rust | 0 |
}
}
}
<reponame>felipecsl/ferrocarril
//! Crate mruby-bin provides binaries for interacting with the mruby
//! interpreter in the [`mruby`] crate.
#![deny(missing_docs, warnings, intra_doc_link_resolution_failure)]
#![deny(clippy::all, clippy::pedantic)]
pub mod parser;
pub mod repl;
use phf::{phf_map, ... | Rust | 0 |
256.
set_attr!(set_timer_divide,timer_divide,TimerDivide);
/// Sets the timer initial count.
///
/// Default: 10_000_000.
set_attr!(set_timer_initial,timer_initial,u32);
/// Sets the IPI destination mode.
///
/// Default: Physical.
set_attr!(set_ipi_destination_mode,ipi_destinati... | Rust | 0 |
role: SingleDatabaseRole,
db: String,
},
}
impl From<Role> for Bson {
fn from(role: Role) -> Bson {
match role {
Role::All(role) => Bson::String(role.to_string()),
Role::Single { role, db } => {
Bson::Document(doc! {
"role": Bson::S... | Rust | 0 |
1ff) as u16,
);
}
pub fn get_offset(&self) -> u16 {
return (self.0 & 0xfff) as u16;
}
}
impl From<VirtualAddress> for u64 {
fn from(v: VirtualAddress) -> Self {
v.0
}
}
impl From<u64> for VirtualAddress {
fn from(v: u64) -> Self {
Self(v)
}
}
/// 56 bits(u... | Rust | 0 |
ed!(tag!("p"), hex_value));
named!(write_register<&[u8], (u64, Vec<u8>)>,
preceded!(tag!("P"),
separated_pair!(hex_value,
tag!("="),
hex_byte_sequence)));
named!(write_general_registers<&[u8], Vec<u8>>,
preceded!(tag!("G"), hex_byte_sequence));
// Helper for parse_thread_id that parses... | Rust | 0 |
):
assert c_map[P1_LABEL] > max(c_map[P2_LABEL], c_map[P3_LABEL]), \
"Incorrect {} label: {} :: {}".format(P1_LABEL, v, c_map)
c_map_p2 = list(classifier._classify_arrays(x_p2))
for v, c_map in zip(x_p2, c_map_p2):
assert c_map[P2_LABEL] > max(c_map[P1_LABEL], c_... | Python | 1 |
from google.protobuf.json_format import Parse, ParseError
from synapse.api.device_pb2 import DeviceConfiguration
from synapse.api.app_pb2 import AppManifest
import synapse as syn
def load_device_config(path_to_json, console):
# We support either a manifest or a device configuration.
# First, try to load a dev... | Python | 1 |
:s} of {1:f}".format(fluid, np.max(cp)))
if np.min(cp) < 1000:
if fluid not in checked:
print("Very low heat capacity for {0:s} of {1:f}".format(fluid, np.min(cp)))
# for fluid in CoolProp.__fluids__:
for fluid in ["Water"]:
state = CoolProp.AbstractState("HEOS", fluid)
Tmin = max(state... | Python | 1 |
"""
Production settings
"""
from core.settings import env
DEBUG = False
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': env.get('POSTGRES_HOST'),
'PORT': env.get('POSTGRES_PORT', '5432'),
'NAME': env.get('POSTGRES_DB'),
'USER': env.... | Python | 1 |
# -*- python -*-
# -*- coding: latin-1 -*-
#
# Geometry : celltissue package
#
# Copyright or or Copr. 2006 INRIA - CIRAD - INRA
#
# File author(s): Jerome Chopard <jerome.chopard@sophia.inria.fr>
#
# Distributed under the Cecill-C License.
# See accompanying file LICENSE.txt or copy at... | Python | 1 |
).await` will result in a value of type `u8`.
async fn foo() -> u8 {
println!("foo()");
5
}
fn bar() -> impl Future<Output=u8> {
// This `async` block results in a type that implements
// `Future<Output = u8>`.
async {
let x: u8 = foo().await;
x + 5
}
}
async fn count() {
u... | Rust | 0 |
dc}', '\u{1d6e1}'), ('\u{1d6fc}', '\u{1d714}'), ('\u{1d716}',
'\u{1d71b}'), ('\u{1d736}', '\u{1d74e}'), ('\u{1d750}', '\u{1d755}'), ('\u{1d770}',
'\u{1d788}'), ('\u{1d78a}', '\u{1d78f}'), ('\u{1d7aa}', '\u{1d7c2}'), ('\u{1d7c4}',
'\u{1d7c9}'), ('\u{1d7cb}', '\u{1d7cb}')
];
pub fn Lowerc... | Rust | 0 |
nse_class=HTMLResponse)
async def get_dashboard(request: Request):
"""主仪表板页面"""
return templates.TemplateResponse("dashboard.html", {"request": request})
@app.get("/api/system/status")
async def get_system_status():
"""获取系统状态API"""
return await real_dashboard.get_system_status()
@app.get("/api/account... | Python | 1 |
Option<std::string::String>,
aws_smithy_http::header::ParseError,
> {
let headers = header_map.get_all("Location").iter();
aws_smithy_http::header::one_or_none(headers)
}
pub fn deser_header_create_vault_create_vault_output_location(
header_map: &http::HeaderMap,
) -> std::result::Result<
std::opti... | Rust | 0 |
import re
MAX_ANALYSIS_HISTORY = 10
def add_to_analysis_memory(st, question, generated_sql, results_df, analysis_text):
"""Formats and adds the analysis entry to the session state history, enforcing a maximum size."""
# Format the new entry
entry = (
f"Pergunta: {question}\n"
f"SQL G... | Python | 1 |
assert_eq!(20.0, child_layout.left());
assert_eq!(20.0, child_layout.right());
assert_eq!(10.0, child_layout.top());
assert_eq!(10.0, child_layout.bottom());
assert_eq!(60.0, child_layout.width());
assert_eq!(80.0, child_layout.height());
}
#[test]
fn test_all_overridden() {
let mut root = Node::new();
styl... | Rust | 0 |
iphone_payload_1 = """
EXTENSION HELLO_OS
REM VERSION 1.0
REM AUTHOR: aMiscreant
...
END_EXTENSION
"""
iphone_payload_2 = """
EXTENSION ANOTHER_IPHONE_PAYLOAD
REM VERSION 1.0
REM AUTHOR: aMiscreant
...
END_EXTENSION
"""
payloads = {
1: iphone_payload_1,
2: iphone_payload_2,
} | Python | 1 |
points
inception_v3.default_image_size = 299
def _reduced_kernel_size_for_small_input(input_tensor, kernel_size):
"""Define kernel size which is automatically reduced for small input.
If the shape of the input images is unknown at graph construction time this
function assumes that the input images are is large... | Python | 1 |
ert_eq!(matrix::add_matrices(a, b), c);
}
#[test]
fn test_matrix_subtract(){
let a: Vec<Vec<f64>> = vec![vec![1.0, 2.0 , -1.0, -4.0],
vec![2.0, 3.0, -1.0, -11.0],
vec![-2.0, 0.0, -3.0, 22.0]];
let b = vec![vec![1.0, 0.0, 0.0, -8.0],
vec!... | Rust | 0 |
# def largestNumber(costs, coins) -> list:
# costs_copy = costs.copy()
# a = []
# for i, x in enumerate(costs):
# a.append([x, i])
# a.sort()
# ans = []
# for x, i in a:
# if coins - x >= 0:
# ans.append(i)
# coins -= x
# else:
# break
... | Python | 1 |
tate};
#[test]
fn it_works() {
rotate(&mut vec![vec![1,2,3],vec![4,5,6],vec![7,8,9]])
}
}<gh_stars>1-10
use core::borrow::Borrow;
use std::io::{self, Write};
use std::mem;
fn main() {
loop {
print!(">> ");
io::stdout().flush().unwrap();
let mut code = String::new();
... | Rust | 0 |
write ( 'rate: %f ' % self.ETH_USD_rate )
else:
self.logger.write ( 'error ETH_USD http %d' % r.status )
connection.close ( )
except Exception:
self.logger.write ( 'error ETH_USD\n' + str(traceback.format_exc()) )
pass
... | Python | 1 |
streamer_ref.get_mut().send_error(job_id, e.to_string())
} else {
streamer_ref.get_mut().streams.remove(&job_id);
}
});
StreamSender {
task_id: job_task_id,
sender: queue_sender,
instance_id,
... | Rust | 0 |
) = setup()?;
assert_eq!((0, None), l.load_term()?);
// Test loading saved term
let (mut l, store) = setup()?;
l.save_term(1, Some("a"))?;
let l = Log::new(store)?;
assert_eq!((1, Some("a".into())), l.load_term()?);
// Test replacing saved term with none
... | Rust | 0 |
hwise_shape = [kernel_size, kernel_size, depth, depth_multiplier]
depthwise_weights = variables.model_variable(
'depthwise_weights', shape=depthwise_shape)
strides = [1, 1, 1, 1]
with variable_scope.variable_scope('depthwise_conv_1'):
conv1 = nn.depthwise_conv2d(
... | Python | 1 |
ve the workers do we start listening.
s.listen(url)?;
// Now start all of the workers listening.
for (a, c) in &workers {
c.recv(a)?;
}
thread::sleep(Duration::from_secs(60 * 60 * 24 * 365));
Ok(())
}
/// Callback function for workers.
fn worker_callback(aio: Aio, ctx: &Context, res:... | Rust | 0 |
__all__ = (
"BaseModel",
"Address",
"Category",
"OrderDetail",
"OrderProduct",
"Order",
"Product",
"User",
)
from db.models.base import BaseModel
from db.models.order_detail import OrderDetail
from db.models.address import Address
from db.models.user import User
from db.models.order im... | Python | 1 |
": 52.5252832,
"lng": 13.4188422
},
"duration": 240.0
}
],
"demand": [
2
],
"tag": "d1"
}
]
}
]
},
"fleet": {
"vehicles": [
{
"typeId": "vehicle... | Rust | 0 |
ng>)>,
)>,
String,
> {
use crate::schema::{artist_rank_snapshots::dsl::*, spotify_items::dsl::*};
let query = artist_rank_snapshots.filter(user_id.eq(user.id));
if let Some(timeframe_id) = restrict_to_timeframe_id {
let query = query
.filter(timeframe.eq(timeframe_id))
... | Rust | 0 |
do?",
"Okay. ",
"Alright, this is easy.",
"Let 'em go.",
"In the back.",
"Yeah.",
"Hey, what happened to the guy I had last time?",
"Ow, ow move over.",
"Are you calling me a liar?",
"Wait a second wait a minute, You jealous of him or you jealous of me?",
"Uh, Eduardo, uh, Carochio.",
"I didn't s... | Rust | 0 |
n.
///
/// It is mandatory that all components of configuration sum up to one whole (**100%**),
/// otherwise an error `InvalidDistributionConfiguration` will be raised.
///
/// - `reward_distro_params` - reward distribution params
///
/// Emits `DistributionConfigurationChanged` with config embedded into... | Rust | 0 |
en.wikipedia.org/wiki/Discretization#Discretization_of_linear_state_space_models
.. [2] http://techteach.no/publications/discretetime_signals_systems/discrete.pdf
.. [3] G. Zhang, X. Chen, and T. Chen, Digital redesign via the generalized
bilinear transformation, Int. J. Control, vol. 82, no. 4, pp. 741-754,
... | Python | 1 |
"))
}
_ => self.replace_show_database(*left),
};
let right_expr = match *right {
Expr::Identifier(ref v) if v.value.to_uppercase() == *"DATABASE" => {
Expr::Identifier(Ident::new("name"))
... | Rust | 0 |
for u in r.iter(Uniform(min..max)).take(ROUNDS) {
assert!(min <= u && u < max, "i={}", u);
}
}
#[test]
fn u32_in_max_range() {
let mut r = Random::new();
for _ in r.iter(Uniform(u32::MIN..u32::MAX)).take(ROUNDS) {}
}
#[test]
fn random_f32_in_unit_int... | Rust | 0 |
Bits 4:7 - Fast Compare Mode Response Time"]
#[inline(always)]
pub fn fcrt(&self) -> FCRT_R {
FCRT_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[doc = "Bits 8:13 - Short Sample Time"]
#[inline(always)]
pub fn sst(&self) -> SST_R {
SST_R::new(((self.bits >> 8) & 0x3f) as u8)
}
... | Rust | 0 |
surround_advantage = opp_queen_surrounded_count - my_queen_surrounded_count
terminal_reward = np.clip(surround_advantage * 0.3, -0.8, 0.8) # 适度的平局调整
elif reason in ['max_turns_reached', 'no_legal_action']:
# 适度的超时和无合法动作惩罚
terminal_reward = -1.5
... | Python | 1 |
or backward compatibility
assert config == {"default_theme": "light", "default_show_options": "sa"}
# Test missing file
mock_exists.return_value = False
config = load_config()
assert config == {}
# Test invalid JSON (should return empty dict)
mock_exists.return_... | Python | 1 |
safe to copy if unknown.
pub fn safe_to_copy(type_: ChunkType) -> bool {
type_[3] & 32 != 0
}
<filename>src/ast/meta.rs
use std::convert::TryInto;
use std::collections::HashSet;
use indexmap::IndexMap as Map;
use crate::ast;
use crate::pos::Sp;
use crate::ident::Ident;
use crate::fmt::Formatter;
use crate::value:... | Rust | 0 |
t UpdateCtx, _old_data: &D, data: &D, env: &Env) {
for child in &mut self.children {
child.update(ctx, data, env);
}
}
fn layout(&mut self, ctx: &mut LayoutCtx, bc: &BoxConstraints, data: &D, env: &Env) -> Size {
let mut largest = Size::ZERO;
for child in &mut self.c... | Rust | 0 |
ef[gb_i][gb_j]))
stddst, skwdst, krtdst = ical_stat(math_util.abs(gabDst[gb_i][gb_j]))
mp = mp + s[gb_i] * (
torch.abs(stdref - stddst) + 2 * torch.abs(skwref - skwdst) + torch.abs(krtref - krtdst))
B, C, rows, cols = mp.shape
return torch.norm(mp.reshape(B, C, -1), dim=... | Python | 1 |
from django.db import models
from apps.users.models import AuthsExtendedUser
class CompanyRepresentativeProfile(models.Model):
id = models.BigAutoField(primary_key=True)
job_title = models.CharField(max_length=512, blank=True, null=True)
messenger = models.CharField(max_length=128, blank=True, null=True)
... | Python | 1 |
Defaults to ``False`` for float-type data.
Defaults to ``True`` for integer-type data.
Integer-type tensors must be constant.
Returns
-------
mygrad.Tensor"""
return Tensor._op(Arccsc, a, constant=constant)
def arccot(a: ArrayLike, *, constant: Optional[bool] = None) -> Tensor:
... | Python | 1 |
# we go through the list, and bubble the greatest element to the end
def bubble_sort(nums):
for i in range(len(nums) - 1, 0, -1):
for j in range(i):
if nums[j] > nums[j + 1]:
temp = nums[j]
nums[j] = nums[j+1]
nums[j+1] = temp
return nums
... | Python | 1 |
input.enabled {
scope_566.boolean(*var_567);
}
Ok(())
}
#[allow(unused_mut)]
pub fn serialize_structure_crate_model_load_permission_modifications(
mut writer: aws_smithy_query::QueryValueWriter,
input: &crate::model::LoadPermissionModifications,
) -> Result<(), aws_smithy_http::operation::Seria... | Rust | 0 |
area| area.check_write_array(ptr, count))
.map(|_|()).ok_or(VMError::InvalidPtr)
}
/// Check the null-end C string is within the readable memory, and is valid.
/// If so, clone it to a String.
///
/// Unsafe: the page table must be active.
pub unsafe fn check_and_clone_cstr(&self, pt... | Rust | 0 |
],
[
"pmon01rg",
"OFFLINE",
"pasv0450",
"non-concurrent",
"OHN",
"FNPN",
"NFB",
"ignore",
"",
... | Python | 1 |
.offset))
})
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}
}
impl<'a> DoubleEndedIterator for Utf8IterCont<'a> {
fn next_back(&mut self) -> Option<Self::Item> {
self.iter.next_back().map(|idx| unsafe {
mem::transmute::<&'_ str, &'a str>(s... | Rust | 0 |
AI match status and reason for a single job"""
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("""
UPDATE jobs
SET ai_match = ?,
ai_match_reason = ?
WHERE company = ? AND id = ?
... | Python | 1 |
from dolfin import *
import mshr
# Parameters for geometry
a = 0.04
b = a + 0.004
c = a + 0.01
L = 0.5
# Define cylinders
inner = mshr.CSGCGALDomain3D(mshr.Cylinder(Point(0, 0, 0), Point(0, 0, L), a, a))
mid = mshr.CSGCGALDomain3D(mshr.Cylinder(Point(0, 0, 0), Point(0, 0, L), b, b))
outer = mshr.CSGCGALDomain3D(mshr.... | Python | 1 |
entry(current)
.and_modify(|value| *value = !*value)
.or_insert(true);
}
floor
}
fn get_black_count(tile: &Tile, floor: &Floor) -> usize {
DIRECTIONS
.iter()
.map(|direction| tile + *direction)
.filter(|neighbor| *floor.get(neighbor).unwrap_or(&false))
... | Rust | 0 |
Py => write!(f, "mesapy"),
Executor::Echo => write!(f, "echo"),
Executor::GbdtTraining => write!(f, "gbdt_training"),
Executor::GbdtPrediction => write!(f, "gbdt_prediction"),
Executor::LogitRegTraining => write!(f, "logistic_regression_training"),
Executor::L... | Rust | 0 |
e case of an empty body is also checked above.
let ptr = unsafe { (self as *mut UnidentifiedAtom).add(1) };
// SAFETY: This type's constructor ensures the atom's body is valid
unsafe { ::core::slice::from_raw_parts_mut(ptr.cast(), self.header.size_of_body()) }
}
}
#... | Rust | 0 |
percentage = int(input())
number = int(input())
value = (percentage * 500) // 100
result = value == number
print(result)
| Python | 1 |
2691);
bencher.iter(|| {
for i in BENCH_SHIFTS {
black_box(number.wrapping_shr(*i));
}
});
}
}
//}}}
//{{{ Mul
/// Converts a signed integer `x` into the sign (whether it is negative) and the absolute value
/// `|x|`.
fn sign_abs(x: i128) -> (bool, u128) {
... | Rust | 0 |
tracer = trace.get_tracer("crewai.telemetry")
span = tracer.start_span("Flow Creation")
self._add_attribute(span, "flow_name", flow_name)
span.set_status(Status(StatusCode.OK))
span.end()
self._safe_telemetry_operation(operation)
def flow_plotting_span(self... | Python | 1 |
.filter_level(level).fuse(), o!())
} else {
slog::Logger::root(drain.filter(|_| false).fuse(), o!())
}
}
pub fn build_config(
port: u16,
mut boot_nodes: Vec<Enr>,
secret_key: Option<String>,
) -> NetworkConfig {
let mut config = NetworkConfig::default();
config.libp2p_port = port; /... | Rust | 0 |
from pydantic import BaseModel
class Water(BaseModel):
ph : float
Hardness : float
Solids : float
Chloramines : float
Sulfate : float
Conductivity : float
Organic_carbon: float
Trihalomethanes: float
Turbidity : float | Python | 1 |
, HalfRotation::Zero)
}
(FullRotation::OneEighty, HalfRotation::OneEighty) => {
(FullRotation::TwoSeventy, HalfRotation::Zero)
}
(FullRotation::TwoSeventy, HalfRotation::OneEighty) => return Err(()),
};
Ok(Orientation { short, long })
... | Rust | 0 |
riptor {
crate::bindgen::filament_backend_PixelBufferDescriptor {
_base: self.buffer.into_native(),
left: self.left,
top: self.top,
__bindgen_anon_1: crate::bindgen::filament_backend_PixelBufferDescriptor__bindgen_ty_1 {
__bindgen_anon_1:
... | Rust | 0 |
("Image width is {}, and height is {}", width, height);
}
use std::hint::unreachable_unchecked;
use std::sync::mpsc::{channel, Receiver};
use image::Bgra;
use thiserror::Error;
use windows::core::{IInspectable, Interface};
use windows::Foundation::TypedEventHandler;
use windows::Graphics::Capture::{
Direct3D11Capt... | Rust | 0 |
.0, 8.8.8.8,141.101.69.140', b'10.0.0.1')
assert str(r.source) == '8.8.8.8'
assert r.bypasses_proxy is False
r = request(harness, b'0.0.0.0, 8.8.8.8', b'10.0.0.1')
assert str(r.source) == '8.8.8.8'
assert r.bypasses_proxy is True
def test_request_source_with_forged_headers_from_untrusted_client(har... | Python | 1 |
from PF import ParticleFilter
from BPF import BlockParticleFilter
from MPF import MultipleParticleFilter
from EnKF import EnsembleKalmanFilter
from sklearn.cluster import AgglomerativeClustering
from scipy.spatial.distance import pdist, squareform
import math
import numpy as np
import matplotlib.pyplot as plt
import pi... | Python | 1 |
ata").0;
let interaction_item = InteractionData {
target: query.sell_token,
value: 0.into(),
call_data: ethcontract::Bytes(calldata),
};
solution.interaction_data.push(interaction_item);
} else {
... | Rust | 0 |
ocatorHelper::callbacks);
let mut loader = vks::InstanceProcAddrLoader::from_get_instance_proc_addr(vk_get_instance_proc_addr);
unsafe {
loader.load_vk_global();
}
let create_info_wrapper = core::VkInstanceCreateInfoWrapper::new(create_info, true);
let mut instance ... | Rust | 0 |
"]
pub const DDRAWIPAL_4: i32 = 1024i32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDRAWIPAL_ALLOW256: i32 = 512i32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDRAWIPAL_ALPHA: i32 = 8192i32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
p... | Rust | 0 |
"""Hass util.
This module contains utility functions and classes for Home Assistant.
It includes functions for handling retries, managing timers, and translating text.
External imports:
handle_retries: None
storage_json: jsonpickle
timer_trigger: None
translate: aiofiles, orjson
"""
from .config_upda... | Python | 1 |
path) = opt_ll_path {
code_gen
.module
.print_to_file(ll_path)
.map_err(|llvm_str| crate::error::plain_runner_error(llvm_str.to_string()))?;
}
Ok(())
}
impl<'hir: 'ictx, 'run, 'ictx: 'run> CodeGen<'hir, 'run, 'ictx> {
pub fn new(
mir: &'hir Mir,
c... | Rust | 0 |
new(-5.0, 0.0, 150.0)),
tuple::Vector::new(0.0, 1.0, 0.0),
);
}
#[test]
fn test_intersect_with_a_ray_parallel_to_the_plane() {
let plane = shape::Shape::default_plane();
let ray = ray::ray(
tuple::Point::new(0.0, 10.0, 0.0),
tuple::Vector::new(0.0... | Rust | 0 |
# Copyright 2015 The Shaderc Authors. 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 |
# Boundary check
# ==============
#
# Check probability at boundaries.
#
# In this case we define the probability density function (PDF) directly
# in an n-dimensional uniform box.
#
# Ideally, the correlation plots and variable distributions will be uniform.
from bumps.names import *
# Adjust domain from 1e-150 to 1... | Python | 1 |
import pytest
import progressbar
@pytest.fixture(autouse=True)
def large_interval(monkeypatch) -> None:
# Remove the update limit for tests by default
monkeypatch.setattr(
progressbar.ProgressBar,
'_MINIMUM_UPDATE_INTERVAL',
0.1,
)
def test_end() -> None:
m = 24514315
p ... | Python | 1 |
FIXME: avoid clone
}
}
// Peer timeout
if tick % (10 * TICKS_PER_SEC) == 0 {
node_peers_timeout(&mut node);
}
// Display node info
if tick % TICKS_PER_SEC == 0 {
log_heartbeat(&node);
}
}
// Sleep for 1/100 seconds
// TODO: just sleep rem... | Rust | 0 |
arg("--years")
.arg("600")
.arg("--show=israeli-holidays");
let res: Vec<Res> =
serde_json::from_str(&String::from_utf8(cmd.output().unwrap().stdout).unwrap()).unwrap();
let yom_yerushalayim = include_str!("yom_yerushalayim_5700_500")
.lines()
.collect();
find_holid... | Rust | 0 |
rat = None;
let mut prev_strat = None;
let mut prev_grid = *grid;
let mut finished = false;
loop {
if finished {
break;
}
match self.solver.solve_step(grid) {
Some(step) => {
step.delta.apply(grid);
... | Rust | 0 |
PRO",
"CAEI",
"LO",
"LOw",
"LTR.WD",
"TII.Aw",
"TIIw",
"TMXw",
"LSC",
"MRNA",
"PSDVV",
"TII.A",
"DDG",
"FSC",
"REA",
"RFL",
"RTG",
"SEF",
"SNIw",
"PNQI",
"PQBW",
"AZM",
"CTZpB",
"RDCMD",
"DTO",
"DXO",
"GLRP",
"AXD",
"BDD",
"BOM",
"BOS",
"DWT",
"FAN",
"RH... | Rust | 0 |
from django.core.management.base import BaseCommand
import json
from urllib.request import urlopen
from core.models import Batch
class Command(BaseCommand):
help = "compares batches loaded with the public site"
def handle(self, *args, **options):
url = 'http://chroniclingamerica.loc.gov/batches.json... | Python | 1 |
from datetime import datetime
fecha_hora_actual = datetime.now()
print(fecha_hora_actual) # Ejemplo de salida: 2024-09-14 12:30:45.123456
from datetime import datetime
fecha_hora_actual = datetime.now()
formato = fecha_hora_actual.strftime("%d/%m/%Y %H:%M:%S") # Día/Mes/Año Hora:Minuto:Segundo
print(formato) # E... | Python | 1 |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
# KU Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can r... | Python | 1 |
# Import necessary libraries
from Adafruit_AMG88xx import Adafruit_AMG88xx
import pygame
import os
import math
import time
import numpy as np
from scipy.interpolate import griddata
from colour import Color
# Define constants
MINTEMP = 26 # Low range of the sensor (blue on screen)
MAXTEMP = 32 # High range of the sen... | Python | 1 |
Format::Uml => "uml",
}
)
}
}
impl FromStr for FileFormat {
type Err = FormatStringError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"json" => Ok(FileFormat::Json),
"smithy" => Ok(FileFormat::Smithy),
"uml" => Ok(FileFormat::... | Rust | 0 |
trace!(this, {
for v in this.iter() {
mark(v);
}
});
}
impl<K: GcTrace, V: GcTrace> Finalize for BTreeMap<K, V> {}
unsafe impl<K: GcTrace, V: GcTrace> GcTrace for BTreeMap<K, V> {
custom_trace!(this, {
for (k, v) in this {
mark(k);
mark(v);
}
... | Rust | 0 |
import numpy as np
import torch
import torch.nn as nn
from math import ceil
from scipy import ndimage
def confusion_matrix(pred, label, num_classes):
"""
获得混淆矩阵,其中对角线上表示分类正确的像素点
:param pred: 转化为一维数组的预测结果,shape: (h, w)
:param label: 转化为一维数组的标签,shape:(h, w)
:param num_classes: 类别数
:return: s... | Python | 1 |
. A causal language modeling head is implemented in `gpt_neo_model::GptNeoForCausalLM`
//!
//! # Model set-up and pre-trained weights loading
//!
//! A full working example is provided in `examples/generation_gpt_neo`, run with `cargo run --example generation_gpt_neo`.
//! All models expect the following resources:
//!... | Rust | 0 |
def LeerDocumento(archivoRuta):
with open(archivoRuta , 'r') as archivo:
contenido = archivo.readlines()
cadena=contenido[1].strip()
return cadena
def Salidas(archivoRuta,texto):
with open(archivoRuta,'w') as archivo:
archivo.write(texto)
def esBool(abcd):
for letra i... | Python | 1 |
// Find 100th move
let start_part_1 = Instant::now();
play_game(&mut cups, NUMBER_ROUNDS_SMALL);
let mut current_index = cups[0];
let number_1 = (0..NUMBER_CUPS_SMALL - 1).fold(0, |acc, _| {
let new = (acc * 10) + (current_index + 1);
current_index = cups[current_index as usize];
... | Rust | 0 |
"The checkpoint has a fine-level model, but it could "
"not be loaded (possibly due to a mismatched config file."
)
if "height" in checkpoint.keys():
hwf[0] = checkpoint["height"]
if "width" in checkpoint.keys():
hwf[1] = checkpoint["width"]
if "foca... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.