text string | label_name string | labels int64 |
|---|---|---|
events can be generated."]
#[inline(always)]
pub fn reportper(&mut self) -> REPORTPER_W {
REPORTPER_W { w: self }
}
#[doc = "Writes raw bits to the register."]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Number of samples ... | Rust | 0 |
face_loader.get_physical_device_surface_support(
p_device.raw(), family.index, self.surface).unwrap()
}
}
pub fn get_available_format(&self, p_device: &PhysicalDevice) -> Vec<SurfaceFormat> {
let mut results = Vec::new();
let formats = unsafe {
self.instance.sur... | Rust | 0 |
t = set(params.keys())
for name, value in vars(self).items():
property_name = name[1:]
if property_name in memeber_set:
memeber_set.remove(property_name)
if len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
... | Python | 1 |
;
}
}
}
#[inline(never)]
fn bar() -> bool {
true
}
use std::collections::VecDeque;
fn fill(row: usize, col: usize, map: &mut Vec<Vec<u32>>) -> usize {
let mut q = VecDeque::new();
q.push_back((row, col));
let mut count = 0;
while !q.is_empty() {
let (row, col) = q.pop_front().u... | Rust | 0 |
or target, directory in six.iteritems(targets):
try:
logger.info("Downloading {} to {}".format(target, directory))
looter = looter_cls(
target,
add_metadata=self._getboolean(section_id, 'add-metad... | Python | 1 |
INR::GAIN_OF_1_IN_4
}
#[doc = "Checks if the value of the field is `GAIN_OF_1_IN_8`"]
#[inline]
pub fn is_gain_of_1_in_8(&self) -> bool {
*self == HFADJGAINR::GAIN_OF_1_IN_8
}
#[doc = "Checks if the value of the field is `GAIN_OF_1_IN_16`"]
#[inline]
pub fn is_gain_of_1_in_16(&se... | Rust | 0 |
Address, sender: Sender<RelayMessage>, wrap: bool) -> NodeReplyResult {
Ok(NodeReply::Sender { addr, sender, wrap })
}
/// Consume the wrapper and return [NodeReply::Sender]
pub fn take_sender(self) -> Result<(Address, Sender<RelayMessage>, bool), Error> {
match self {
Self::Se... | Rust | 0 |
_from(pkgid) {
deps.insert(krate);
}
}
(DiagnosticLevel::Ice, pkgid) => {
if let Ok(krate) = Crate::try_from(pkgid) {
deps.insert(krate);
}
... | Rust | 0 |
spect="equal",
xlim=(-0.01, 1.01),
ylim=(-0.01, 1.01),
)
# %%
# We confirm that the classes "versicolor" and "virginica" are not well
# identified by a linear classifier. Notice that the "virginica"-vs-the-rest
# ROC-AUC score (0.77) is between the OvO ROC-AUC scores for "versicolor" vs
# "virginica" (0.64) an... | Python | 1 |
&str, n: usize) -> String {
if n == 0 {
s.to_string()
} else {
s.split('\n').map(|part| indent_markdown_header_by(part, n)).collect::<Vec<_>>().join("\n")
}
}
fn indent_markdown_header_by(s: &str, n: usize) -> String {
if s.starts_with("#") {
"#".to_string().repeat(n) + &s
}... | Rust | 0 |
method = 'MAU'
# scheduled sampling
scheduled_sampling = 1
sampling_stop_iter = 50000
sampling_start_value = 1.0
sampling_changing_rate = 0.00002
# model
num_hidden = '64,64,64,64'
filter_size = 5
stride = 1
patch_size = 1
layer_norm = 0
sr_size = 2
tau = 5
cell_mode = 'normal'
model_mode = 'normal'
# training
lr = 1e-... | Python | 1 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# -----------------------------------------------------------------------------
""... | Python | 1 |
def test_full_loop_device(self):
scheduler_class = self.scheduler_classes[0]
scheduler_config = self.get_scheduler_config()
scheduler = scheduler_class(**scheduler_config)
scheduler.set_timesteps(self.num_inference_steps, device=torch_device)
model = self.dummy_model()
sample = self.dummy_sample... | Python | 1 |
ecute for user and group
except OSError as e:
# Maybe another parallel execution of theano was trying to create
# the same directory at the same time.
if e.errno != errno.EEXIST:
raise ValueError(
"Unable to create the compiledir directory"... | Python | 1 |
[derive(Deserialize, Debug)]
pub struct TopLiveGameList {
pub game_list: Vec<TopLiveGame>,
}
#[derive(Deserialize, Debug)]
pub struct TopLiveGame {
pub activate_time: i32,
pub deactivate_time: i32,
pub server_steam_id: String,
pub lobby_id: String,
pub league_id: i32,
pub lobby_type: i32,
... | Rust | 0 |
ug)]
pub enum RuleType {
Alert,
Record,
}
impl fmt::Display for RuleType {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
RuleType::Alert => write!(f, "alert"),
RuleType::Record => write!(f, "record"),
}
}
}
#[derive(Debug, Clone, Partia... | Rust | 0 |
oret! { nm_return, co::NM::RETURN,
/// [`NM_RETURN`](https://docs.microsoft.com/en-us/windows/win32/controls/nm-return-list-view-)
/// notification.
}
pub_fn_nfy_noparm_noret! { nm_set_focus, co::NM::SETFOCUS,
/// [`NM_SETFOCUS`](https://docs.microsoft.com/en-us/windows/win32/controls/nm-setfocus-list-vi... | Rust | 0 |
}
#[doc = "Field `CNT_H_LIM_U7` writer - This register is used to configure thr_h_lim value for unit7."]
pub struct CNT_H_LIM_U7_W<'a> {
w: &'a mut W,
}
impl<'a> CNT_H_LIM_U7_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
se... | Rust | 0 |
::InCycle { scc_index };
WalkReturn::Complete { scc_index }
} else {
// We are not the head of the cycle. Return back to our
// caller. They will take ownership of the
// `self.successors` data that we pushed.
self.node_states[node] = NodeState::InCycl... | Rust | 0 |
uper::types::Location{
longitude: "12.233213231".as_bytes().to_vec(),
latitude: "32.323112123".as_bytes().to_vec()
};
let resources = super::types::Resources {
hru: 1,
sru: 1,
cru: 1,
mru: 1,
};
let node = super::types::Node {
id: 0,
farm_id: 0,
twin_id,
resources,
location,
... | Rust | 0 |
first_preference=true; }
if !ballot_types_considered_unverifiable.is_empty() {
if data.is_btl_verifiable(b.from.0-num_atl,ballot_types_considered_unverifiable) { res.affected_verifiable_ballots =true; }
}
}
}... | Rust | 0 |
import flet as ft
import faq_ai.excel_io as excel_io
# 簡易DataTableのクラス、Columnコントロールを継承
class FixedHeaderDataTable(ft.Column):
def __init__(self, headers, rows, column_widths):
super().__init__()
self.headers = headers
self.rows = rows
self.column_widths = column_widths
self... | Python | 1 |
#!/usr/bin/env python
# # -*- coding: utf-8 -*-
"""Created by: Vlachas Pantelis, CSE-lab, ETH Zurich
"""
#!/usr/bin/env python
from __future__ import print_function
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import pickl... | Python | 1 |
;
});
if tr.is_ok() {
UndoRedoStack::add_undo(&mut db.ul);
}
tr
}
/// Change user password.
/// * daten: Service data for database access.
/// * client: Affected client number.
/// * user_id: Affected user ID.
/// * password_old: <PASSWORD>.
/// * password_new: <PASSWORD>.
/// * save: Save user... | Rust | 0 |
self {
Match => "✔️",
NoMatch => "⨯",
Panic => "E",
})
}
}
fn match_file_path(pattern: &git_glob::Pattern, path: &str, case: Case) -> bool {
pattern.matches_repo_relative_path(path, basename_of(path), false.into() /* is_dir */, case)
}
fn basename_of(path: &str) -> ... | Rust | 0 |
SUM(a) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 3 FOLLOWING) AS "O2",
SUM(a) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING) AS "O3",
SUM(a) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING) AS "O4",
SUM(a) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUN... | Python | 1 |
import utils.segutils as segutils
import core.denseaffinity as dautils
def fwd_pass_support_imgs(sseval, supp_imgs,supp_masks):
bsz, k, colorc, h, w = supp_imgs.shape
s_feat = sseval.feat_maker.extract_bb_feats(supp_imgs.view(-1, colorc, h, w))
s_feat = [l.view(bsz, k, *l.shape[1:]) for l in s_feat]
c_... | Python | 1 |
in query else itertools.count(1)
for page_num in pages:
query['page'] = str(page_num)
webpage = self._download_webpage(url, item_id, query=query, note=note % {'page': page_num})
results = re.findall(r'(?<=data-video-id=)["\']?(?P<videoid>.*?)(?=["\'])', webpage)
f... | Python | 1 |
V, F: FnOnce(&B) -> V>(&self, data: &Arc<A>, f: F) -> V {
self.inner.with(data, f)
}
fn with_mut<V, F: FnOnce(&mut B) -> V>(&self, data: &mut Arc<A>, f: F) -> V {
let mut temp = self.inner.with(data, |x| x.clone());
let v = f(&mut temp);
if self.inner.with(data, |x| temp != *x) ... | Rust | 0 |
impl From<ReasonElement> for Element {
fn from(reason: ReasonElement) -> Element {
Element::builder("reason", ns::JINGLE)
.append(Element::from(reason.reason))
.append_all(reason.texts.into_iter().map(|(lang, text)| {
Element::builder("text", ns::JINGLE)
... | Rust | 0 |
from rply.token import BaseBox
class BaronToken(BaseBox):
"""
Represents a syntactically relevant piece of text.
:param name: A string describing the kind of text represented.
:param value: The actual text represented.
:param source_pos: A :class:`SourcePosition` object representing the
... | Python | 1 |
import streamlit as st
from PIL import Image
import requests
from bs4 import BeautifulSoup
import numpy as np
from keras.preprocessing.image import load_img, img_to_array
from keras.models import load_model
model = load_model('FV.h5')
labels = {0: 'apple', 1: 'banana', 2: 'beetroot', 3: 'bell pepper', 4: 'cabbage', 5... | Python | 1 |
> {
fn update(&self, state: &State);
}
/// Function signature for a subscription.
///
/// A Subscription will be called, whenever an action is dispatched (and reaches the reducer).
/// It receives a reference to the current state, which might or might not be used.
///
/// # Example
///
/// ```
/// # use redux_rs::... | Rust | 0 |
der(self.settings)
# Reset tool calling counters and collectors for a new user message
self.tool_execution.reset_for_new_query(user_message)
# Prepare payload using provider abstraction
payload = provider.prepare_chat_payload(
self.history.get_provider_history(provi... | Python | 1 |
let (v, mut l, r) = node.divide();
l.meld(r);
*self = l;
Some(v)
} else {
None
}
}
pub fn peek(&self) -> Option<&T> {
self.0.as_ref().map(|node| &node.v)
}
}
#[test]
fn test_skew_heap() {
use rand::{Rng, SeedableRng, ... | Rust | 0 |
**{
'c:v': 'libx264',
'qp': '0',
'preset': 'fast',
'crf': '18',
'y': None,
'an': None
}
... | Python | 1 |
uCE = self.model.getUConceptEmbedding(cT)
return uCE
def getBClassSpace(self, c):
cT = torch.LongTensor([c])
cT = cT.to(self.device)
bCHE = self.model.getBConceptHEmbedding(cT)
bCTE = self.model.getBConceptTEmbedding(cT)
return bCHE, bCTE
def getEntityEmbedding(self, eName):
eT = ... | Python | 1 |
s={1,23,45,67,89}
e=set()
print(s) | Python | 1 |
f) -> _SYSCTL_SRGPIO_R12W {
_SYSCTL_SRGPIO_R12W { w: self }
}
#[doc = "Bit 13 - GPIO Port P Software Reset"]
#[inline(always)]
pub fn sysctl_srgpio_r13(&mut self) -> _SYSCTL_SRGPIO_R13W {
_SYSCTL_SRGPIO_R13W { w: self }
}
#[doc = "Bit 14 - GPIO Port Q Software Reset"]
#[inlin... | Rust | 0 |
let ndv1 = 42_f32;
let ndv2 = 42_f32;
let r1 = Grid2D::new(d1, vec![1_f32, 2_f32, 3_f32, 42_f32], Some(ndv1)).unwrap();
let r2 = Grid2D::new(d2, vec![1_f32, 2_f32, 3_f32, 42_f32], Some(ndv2)).unwrap();
assert!(grid_eq_with_no_data(&r1, &r2));
}
#[test]
fn test_grid_eq_with... | Rust | 0 |
from django.core.management import call_command
from django.test import TestCase
from wagtail.models import Page
from wagtailinventory.helpers import (
get_page_blocks,
get_page_inventory,
update_page_inventory,
)
class TestGetPageBlocks(TestCase):
fixtures = ["test_blocks.json"]
def test_page_... | Python | 1 |
import bpy
class DiffGrowthPanel(bpy.types.Panel):
bl_label = "Differential Growth"
bl_idname = "OBJECT_PT_diffgrow_panel"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'object'
def draw(self, context):
layout = self.layout
obj = context.object
set... | Python | 1 |
_errors += error_count;
}
debug!("TOTAL LENGTH {}", all_blocks.len());
let total_data = (all_blocks.len() as u32) * 8;
let data = super::data::data(all_blocks, qr_data.version)?;
Ok((
data,
QRInfo {
version: qr_data.version,
... | Rust | 0 |
orms(mask)
intrinsics[i, 0, 0] *= img.shape[1] / 2.0
intrinsics[i, 1, 1] *= img.shape[0] / 2.0
intrinsics[i, 0, 2] = img.shape[1] / 2.0
intrinsics[i, 1, 2] = img.shape[0] / 2.0
h, w = rgb.shape[-2:]
if (h != self.img_hw[0]) or (w != self.img_hw[1... | Python | 1 |
create_child_meta", &self.create_child_meta)
.field("begin_animation", &self.begin_animation)
.field("get_animation_progress", &self.get_animation_progress)
.field("end_animation", &self.end_animation)
.field("layout_changed", &self.layout_changed)
.field("_clutter_padding_1", &s... | Rust | 0 |
// ( declare-sort ⟨symbol⟩ ⟨numeral⟩ )
command ::= LeftParen DeclareSort symbol(x) Numeral(num) RightParen
{
extra.visit_declare_sort(x, num)
}
// ( define-fun ⟨function_dec⟩ ⟨term⟩ )
command ::= LeftParen DefineFun function_dec(d) term(x) RightParen
{
extra.visit_define_fun... | Rust | 0 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | Python | 1 |
# Env var set by job manager to pass runtime env and metadata to subprocess
RAY_JOB_CONFIG_JSON_ENV_VAR = "RAY_JOB_CONFIG_JSON_ENV_VAR"
# The plugin config which should be loaded when ray cluster starts.
# It is a json formatted config,
# e.g. [{"class": "xxx.xxx.xxx_plugin", "priority": 10}].
RAY_RUNTIME_ENV_PLUGINS_... | Python | 1 |
FI_VARIABLE_AUTHORITY: u32 = 2147483872u32;
#[doc = "*Required features: `\"Win32_NetworkManagement_QoS\"`*"]
pub const SIPAEV_EFI_VARIABLE_BOOT: u32 = 2147483650u32;
#[doc = "*Required features: `\"Win32_NetworkManagement_QoS\"`*"]
pub const SIPAEV_EFI_VARIABLE_DRIVER_CONFIG: u32 = 2147483649u32;
#[doc = "*Required fe... | Rust | 0 |
m.get_direct_map_2m")]
pub direct_map_2m: Option<u64>,
#[bttr(
tag = "SysField::MemDirectMap1g",
class = "SysField::Mem",
class_detail = true
)]
#[blink("SystemModel$mem.get_direct_map_1g")]
pub direct_map_1g: Option<u64>,
// vm stats
#[bttr(tag = "SysField::VmPgpgin"... | Rust | 0 |
Hint::new('a', Spot::At(1)),
Hint::new('r', Spot::At(2)),
Hint::new('l', Spot::At(3)),
Hint::new('y', Spot::At(4)),
]))
}
#[test]
fn all_at_false() {
assert!(!Hint::all_at(&[
Hint::new('e', Spot::At(0)),
Hint::new('a', Spot::At(1... | Rust | 0 |
, help="Prompt to generate completions for")
args = parser.parse_args()
# Create the client
client = InferenceClient(host=args.host, port=args.port)
try:
# Check server health
logger.info("Checking server health...")
health = await client.health_check()
... | Python | 1 |
aleCrop'),
dict(keep_ratio=False, scale=(
224,
224,
), type='Resize'),
dict(flip_ratio=0.5, type='Flip'),
dict(input_format='NCHW', type='FormatShape'),
dict(type='PackActionInputs'),
],
type='VideoDataset'),
... | Python | 1 |
///
/// [`TcpStream::connect`]: struct.TcpStream.html#method.connect
/// [`TcpStream`]: struct.TcpStream.html
pub struct Connect {
addrs: Option<io::Result<VecDeque<SocketAddr>>>,
last_err: Option<io::Error>,
future: Option<
Pin<Box<dyn Future<Output = io::Result<Pin<Box<dyn runtime_raw::TcpStream>... | Rust | 0 |
# Based on description from https://arxiv.org/abs/1802.01457
import math
from functools import lru_cache
import razdel
class Intervals:
def __init__(self):
self.intervals = []
def try_add(self, interval):
for i in self.intervals:
if interval[1] >= i[0] and interval[0] <= i[0]:
... | Python | 1 |
#[test]
fn should_parse_addition_expression() {
let input: Vec<(usize, char)> = "5 + 5".chars().enumerate().collect();
let res = crate::parser::expression().parse(&input);
assert_eq!(
Ok(parcel::MatchStatus::Match {
span: 0..0,
remainder: &input[... | Rust | 0 |
import pygame
pygame.init()
font = pygame.font.Font(None,30)
def debug(info ,y =10,x =10):
display_surface = pygame.display.get_surface()
debug_surf = font.render(str(info),True,'White')
debug_rect = debug_surf.get_rect(topleft = (x,y))
pygame.draw.rect(display_surface,'Black',debug_rect)
display_surface.blit(deb... | Python | 1 |
:RCurly;
res['*' as usize] = Equivalence::Star;
res['&' as usize] = Equivalence::And;
res['%' as usize] = Equivalence::Percent;
res['^' as usize] = Equivalence::Caret;
res['+' as usize] = Equivalence::Plus;
res['<' as usize] = Equivalence::Lesser;
res['=' as usize] = Equivalence::Assign;
... | Rust | 0 |
unts_async(&self, userAccountIdList: &foundation::collections::IIterable<HString>) -> Result<ComPtr<foundation::IAsyncOperation<MicrosoftAccountMultiFactorUnregisteredAccountsAndSessionInfo>>> { unsafe {
let mut out = null_mut();
let hr = ((*self.lpVtbl).GetSessionsAndUnregisteredAccountsAsync)(self as... | Rust | 0 |
if shell is not None:
eval_expression_str = shell.fmt_fn(eval_expression)
else:
eval_expression_str = str(eval_expression)
if len(eval_expression_str) > 100:
eval_expression_str = eval_expression_str[:100] + "..."
print(f"Expression: {eval_expression... | Python | 1 |
way_horizontal, hallway_vertical)
}
pub fn generate_rooms(frames: &Vec<Room>, seed: u32) -> Vec<Room> {
let rng = Rng::new_with_seed(Algo::MT, seed);
let mut rooms: Vec<Room> = Vec::new();
let mut hallways: Vec<Room> = Vec::new();
for frame in frames.iter() {
if let Some(mut r) = gen_room(fram... | Rust | 0 |
ClusterInit::KmeansPP => init_cluster_centers_kmeans_pp(loci_used, &cell_data, params, rng),
ClusterInit::RandomUniform => init_cluster_centers_uniform(loci_used, params, rng),
ClusterInit::RandomAssignment => init_cluster_centers_random_assignment(loci_used, &cell_data, params, rng... | Rust | 0 |
ny = selected_company.lower()
if selected_company in models:
try:
# Retrieve the model for the selected company
model = models[selected_company]
# Get input values from the form and convert them to float
open_price = float(request.form.get("open"))
... | Python | 1 |
ED);
}
#[test]
fn authentication_via_basic_http_header_rejects_bad_password() {
let mut service = ServiceType::new(&test_name!());
service.complete_initial_setup();
let mut request = protocol::random();
let basic = headers::Authorization::basic(TEST_PASSWORD, "garbage");
request.headers_mut().typed_insert(basic)... | Rust | 0 |
# Copyright (c) 2018 CEF Python, see the Authors file.
# All rights reserved. Licensed under BSD 3-clause license.
# Project website: https://github.com/cztomczak/cefpython
"""
Run all snippets from the examples/snippets/ directory
and display a summary at the end.
"""
from common import *
import glob
import os
impo... | Python | 1 |
Returns:
A dictionary of logs.
"""
features, labels = inputs
tokens, logits = model(features, labels['prompt'], training=False)
# loss = self.build_losses(
# outputs=outputs, labels=labels, aux_losses=model.losses)
loss = 0.0
# Multiply for logging.
# Since we expect the gradi... | Python | 1 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018-2021 CERN.
#
# Invenio-App-RDM is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Configuration helper for React-SearchKit."""
from functools import partial
from flask import current_app... | Python | 1 |
#
# Copyright (C) 2023, Inria
# GRAPHDECO research group, https://team.inria.fr/graphdeco
# All rights reserved.
#
# This software is free for non-commercial, research and evaluation use
# under the terms of the LICENSE.md file.
#
# For inquiries contact george.drettakis@inria.fr
#
import math
from typing import Name... | Python | 1 |
arm_size, (20 * scale, 48 * scale));
// copy and flip the bottom of leg
copy_flipped(&mut new_skin, (8 * scale, 16 * scale), arm_size, (24 * scale, 48 * scale));
// copy and flip the top of arm
copy_flipped(&mut new_skin, (44 * scale, 16 * scale), arm_size, (36 * scale, 48 * scale));
// copy and... | Rust | 0 |
t<T>, pk: &FVCiphertext<T>) -> FVCiphertext<T> {
// use public key to encrypt
// pk = (a, as+e) = (a,b)
let (c0, mut c1) = self.encrypt_zero(pk);
// c1 = bu+e2 + Delta*m
let iter = c1.coeffs.iter_mut().zip(pt.iter());
for (x, y) in iter {
let temp = T::mul(y, ... | Rust | 0 |
1() {} //~ NOTE expected argument named `r` here
#[post("/a", data = "<test>")] //~ ERROR unused dynamic parameter
fn h2() {} //~ NOTE expected argument named `test` here
#[get("/<_r>")] //~ ERROR unused dynamic parameter
fn h3() {} //~ NOTE expected argument named `_r` here
#[get("/<_r>/<b>")] //~ ERROR unused dyna... | Rust | 0 |
= {},
**kw: Any,
) -> Any:
"""
Evaluates an image expression. This uses Python's ``eval()`` function to process
the expression string, and carries the security risks of doing so. It is not
recommended to process expressions without considering this.
:py:meth:`~lambda_eval` is a more secure alter... | Python | 1 |
class Solution:
def solve(self, board: List[List[str]]) -> None:
"""
Do not return anything, modify board in-place instead.
"""
m, n = len(board), len(board[0])
q = deque()
safe = set()
# Mark all boundary O as safe:
for i in range(m):
for... | Python | 1 |
ter);
store
}
}
impl Extend<Quad> for MemoryStore {
fn extend<T: IntoIterator<Item = Quad>>(&mut self, iter: T) {
for quad in iter {
self.insert(quad);
}
}
}
impl fmt::Display for MemoryStore {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for t... | Rust | 0 |
e[2:]
assert len(sizes) in [2, 3]
if len(sizes) == 3:
# t x y -> x y t to match dimensions T H W in grid_sample
coords = coords[..., [1, 2, 0]]
if align_corners:
coords = coords * torch.tensor(
[2 / max(size - 1, 1) for size in reversed(sizes)], device=coords.device
... | Python | 1 |
hed against only number characters.
Token::Number(number.parse().unwrap())
}
fn string(&mut self) -> Token {
let mut string = self.consume_while(|c| match c {
'"' => false,
_ => true,
});
Token::String(string.to_string())
}
fn consume_whitespace... | Rust | 0 |
source at a given distance 'd' from
/// the light's position is
/// ```
/// Atten = 1/( att0 + att1 * d + att2 * d*d)
/// ```
/// This member corresponds to the att1 variable in the equation.
/// Naturally undefined for directional lights.
pub attenuation_linear: c_float,
/// Quadratic... | Rust | 0 |
__author__ = "Myles Dear <mdear@cisco.com>"
from unicon.plugins.iosxr.statemachine import IOSXRSingleRpStateMachine
from unicon.plugins.iosxr.iosxrv.patterns import IOSXRVPatterns
from unicon.plugins.iosxr.statements import IOSXRStatements
from unicon.statemachine import State, Path
from unicon.eal.dialogs import Sta... | Python | 1 |
#
# 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 |
_BYPASSW { w: self }
}
#[doc = "Bit 2 - Select frequency range"]
#[inline]
pub fn hf(&mut self) -> _HFW {
_HFW { w: self }
}
}
pub fn read_charray(buf: &[u8], start: usize, end: usize) -> (String, usize) {
let chunk = &buf[start..end];
let s = match std::str::from_utf8(chunk) {
... | Rust | 0 |
treemath::*};
use serde::{self, Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TreeMathTestVector {
n_leaves: u32,
n_nodes: u32,
root: Vec<u32>,
left: Vec<Option<u32>>,
right: Vec<Option<u32>>,
parent: Vec<Option<u32>>,
sibling: Vec<Option<u32>>,
}
mac... | Rust | 0 |
u8x8, m8x8, i16x8, u16x8, m16x8, i32x8, u32x8, f32x8, m32x8,
i64x8, u64x8, f64x8, m64x8, isizex8, msizex8
);
impl_from_cast_mask!(
msizex8[test_v512]: i8x8, u8x8, m8x8, i16x8, u16x8, m16x8, i32x8, u32x8, f32x8, m32x8,
i64x8, u64x8, f64x8, m64x8, isizex8, usizex8
);
<gh_stars>0
use cosmwasm_bignumber::Uint2... | Rust | 0 |
{
$bits_variant(key) => key,
_ => panic!("unexpected bits"),
}
}
};
}
unwrap_any_bits!(
unwrap_priv_key_any_2048,
RsaPrivKeyAnyBits,
RsaPrivKey<B2048>,
RsaPriv... | Rust | 0 |
)
_fix_tornado_crash()
_fix_sys_argv(main_script_path, args)
_fix_pydeck_mapbox_api_warning()
_fix_pydantic_duplicate_validators_error()
_install_config_watchers(flag_options)
_install_pages_watcher(main_script_path)
# Create the server. It won't start running yet.
server = Server(main_... | Python | 1 |
tent=tool_response))
return tool_response
else:
return f"Failed to list files: {tool_result.output}"
else:
return "File operations tool is not available. Please make sure it's properly registered."
... | Python | 1 |
}
}
}
impl std::str::FromStr for ChangeStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ChangeStatus::from(s))
}
}
impl ChangeStatus {
pub fn as_str(&self) -> &str {
match self {
ChangeStatus::Applyi... | Rust | 0 |
self.cursor += 1;
}
false
}
fn new_duet(id_a: i64, id_b: i64) -> (Self, Self) {
let (prog_a, prog_b) = (DuetProgram::new(id_a), DuetProgram::new(id_b));
prog_a.connect(prog_b)
}
fn new(id: i64) -> Self {
let prog = Program::with_id(id);
let (transmission... | Rust | 0 |
matriculas_matematica = []
for POSMAT in range(1, 10):
matricula = input(f"Digite a matrícula do aluno {POSMAT} de Matemática: ")
matriculas_matematica.append(matricula)
print("Matrículas dos alunos inscritos em Matemática:")
for matricula in matriculas_matematica:
print(matricula)
| Python | 1 |
ong_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]
pub fn foo() {}
// path attrs
#[clippy::bar]
#[clippy::bar(a, b, c)]
pub fn foo() {}
mod issue_2620 {
#[derive(Debug, StructOpt)]
#[structopt(about = "Display information about the character on FF Logs")]
pub struct Params {
#[structopt(help = "The server ... | Rust | 0 |
greed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific TON DEV software governing permissions and
* limitations under the License.
*/
#![cfg_attr(feature = "ci_run", ... | Rust | 0 |
"buildtime-bindgen")]
generator::gen_wrapper(&opencv_header_dir)?;
install_wrapper()?;
build_wrapper(&opencv_header_dir)?;
// -l linker args should be emitted after -l static
opencv.emit_cargo_metadata();
cleanup()?;
Ok(())
}
<reponame>xylix/t3rn
// Copyright 2018-2020 Parity Technologies (UK) Ltd.
// This file... | Rust | 0 |
e crate::*;
const SAMPLE: &str = indoc! {"
5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
6882881134
4846848554
5283751526
"};
#[test]
fn test_part1() {
assert_eq!(part1(SAMPLE), 1656)... | Rust | 0 |
from conch.analysis.pitch import PitchTrackFunction
import librosa
import pytest
from conch.analysis.segments import FileSegment, SignalSegment
from conch.exceptions import FunctionMismatch
def test_pitch_praat(base_filenames):
for f in base_filenames:
wavpath = f + '.wav'
func = PitchTrackFunctio... | Python | 1 |
=> Self {
scale: 1.0,
offset: Vec2::default(),
real_area,
virtual_area: Rect {
left: 0.0,
right: real_area.width(),
top: 0.0,
bottom: real_area.height(),
},
... | Rust | 0 |
# Using For Loop
for s in "PYTHON LOOP":
print(s,end='') | Python | 1 |
er
# install table-miss flow entry
#
# We specify NO BUFFER to max_len of the output action due to
# OVS bug. At this moment, if we specify a lesser number, e.g.,
# 128, OVS will send Packet-In with invalid buffer_id and
# truncated packet data. In that case, we cannot o... | Python | 1 |
`Iterator<Item = T>`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AssociatedTypeBinding {
/// The name of the associated type.
pub name: Name,
/// The type bound to this associated type (in `Item = T`, this would be the
/// `T`). This can be `None` if there are bounds instead.
pub type_... | Rust | 0 |
import os
import re
import sys
from collections import defaultdict
SNIPPETS_DIR = os.path.join(os.path.dirname(__file__), "..", "snippets")
# Gather all .md files except summaries and index
SUMMARY_FILES = {"TAG_SUMMARY.md", "CATEGORY_SUMMARY.md", "INDEX.md"}
SNIPPET_FILES = []
for root, dirs, files in os.walk(SNIPPE... | Python | 1 |
use once_cell::sync::Lazy;
use prometheus_exporter::prometheus::{
register_histogram, register_int_counter, Histogram, IntCounter,
};
use std::{
collections::{BTreeMap, HashMap, HashSet, VecDeque},
pin::Pin,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
};
use sui_adapter::adapter... | Rust | 0 |
const HUB_CONTRACT_KEY: &[u8] = b"hub_contract";
// meta is the token definition as well as the total_supply
pub fn read_hub_contract<S: ReadonlyStorage>(storage: &S) -> StdResult<CanonicalAddr> {
singleton_read(storage, HUB_CONTRACT_KEY).load()
}
pub fn store_hub_contract<S: Storage>(
storage: &mut S,
h... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.