text string | label_name string | labels int64 |
|---|---|---|
from dataclasses import dataclass
from cartography.models.core.common import PropertyRef
from cartography.models.core.nodes import CartographyNodeProperties
from cartography.models.core.nodes import CartographyNodeSchema
from cartography.models.core.relationships import CartographyRelProperties
from cartography.models... | Python | 1 |
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline... | Rust | 0 |
UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::box... | Rust | 0 |
logging.error('Error parsing expected output %s as %s: %s' % (outputFn, outputType, e))
raise
# Compare data
if a_parsed != b_parsed:
logging.error("Output data mismatch for " + outputFn + " (format " + outputType + ")")
data_mismatch = True
# Compare formatti... | Python | 1 |
x=int(input())
a=""
if x<10:
a="000"
elif x<100:
a="00"
elif x<1000:
a="0"
if x%400==0 or x%4==0 and x%100!=0:
a=f"12/09/{a+str(x)}"
else:
a=f"13/09/{a+str(x)}"
print(a) | Python | 1 |
v_list_req) -> Result<c_int> {
handle_error(unsafe {
ioctl(
fd,
HCI_GET_DEV_LIST_MAGIC as u64,
device_list as *mut hci_dev_list_req as *mut c_void)
})
}
fn bind_sockaddr_hci(&self, socket: c_int, address: &sockaddr_hci) -> Result<c_int... | Rust | 0 |
Client::from_options(ClientOptions::default()).unwrap()
}
}
#[macro_use]
pub mod error;
mod protocol;
mod subs;
mod tcp;
#[cfg(test)]
mod tests {
use super::AuthenticationStyle;
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
#[test]
fn credsfile_parses() {
let c... | Rust | 0 |
from fastapi import FastAPI, HTTPException
from agent import tasks_db
app = FastAPI()
@app.get("/tasks")
def list_tasks(status: str | None = None, priority: str | None = None):
"""Return tasks filtered by optional status and priority."""
tasks = tasks_db.list_tasks()
if status:
tasks = [t for t i... | Python | 1 |
'''
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it upside down and turn it into a tree where the original right nodes turned into left leaf nodes. Return the new root.
For example:
Given a binary tree {1,2,3,4,5},
... | Python | 1 |
_op),
(llvm::Ty::Int{bits: 64, signed: false}, sizeof_op),
(llvm::Ty::Int{bits: 1, signed: false}, llvm::Operand::Const(llvm::Constant::UInt{bits: 1, val: 0}))
]
}));
} else {
ctxt.stream.push(Component::Instr(String::new(), llvm::Instruction::Store{
typ: data_result.llvm_typ,
data: da... | Rust | 0 |
ruction::*;
match self {
// Control Instructions
Unreachable => encoder.push_u8(UNREACHABLE),
Nop => encoder.push_u8(NOP),
Block(block_type, instructions) => {
encoder.push_u8(BLOCK)
+ block_type.encode(encoder)
... | Rust | 0 |
def dobro(numero):
""" retorna o dobro do numero fornecido. """
return numero * 2 | Python | 1 |
from typing import List, Optional
from code_sushi.context import Context, LogLevel
from code_sushi.types import File, JobTask, TaskStatus, CodeFragment
from code_sushi.itamae import Itamae
from .model_client import ModelClient
import os
import time
class Agent:
def __init__(self, context: Context, id: int):
... | Python | 1 |
is_tracker,
pts_views_d=rays_d_pts,
ray_pts_num=ray_pts_num,
dynamic_r_query=dynamic_r_query,
exposure_feat=exposure_feat)
with torch.no_grad():
raw[torch.nonzero(~point_mask).flatten(), -1] = -100.0
raw = raw.reshape(N_rays, ray_pts_num, -1).... | Python | 1 |
ize):
el = elm_array_ext[i]
# Word overflow
if (s>=64):
s = s-64
p -= 1
#Split in 2 words if needed
if (s+IA_W)>64:
out_words[p] += ((el & IA_MASK) << s).astype(np.uint64)
out_words[p-1] += ((e... | Python | 1 |
def hate():
print("Hmm...")
return 2 | Python | 1 |
.long("suid")
.help("Enable setuid support when run as root"),
)
.arg(
Arg::with_name("v")
.short("v")
.multiple(true)
.help("Sets the level of verbosity"),
)
.get_matches();
let verbosity: u64 = ... | Rust | 0 |
from PyObjCTools.TestSupport import TestCase, min_os_level
import GameplayKit # noqa: F401
from objc import simd
class TestGKObstacle(TestCase):
def testMethods(self):
self.assertResultHasType(
GameplayKit.GKCircleObstacle.position, simd.vector_float2.__typestr__
)
self.assert... | Python | 1 |
writeln!(out, "{} {}", point.0, point.1).unwrap();
}
}
<filename>src/handler/mod.rs
use serde::{Serialize, Deserialize};
#[macro_use]
pub mod macros {
#[macro_export]
macro_rules! success {
($data:expr) => {
crate::handler::Resp { code: 0, msg: "success", data: Some($data) }
... | Rust | 0 |
y).round(),
}
.to_logical::<f32>(crate::native_pixels_per_point(window) as f64),
);
}
if drag_window {
let _ = window.drag_window();
}
}
// ----------------------------------------------------------------------------
/// For loading/saving app state and/or egui mem... | Rust | 0 |
= open_workbook(EXCELS_DIR / name)
assert get_user(workbook.excel.book) == expected_user
workbook.save(RESULTS_DIR / name, overwrite=True)
# Leading/trailing whitespace is stripped on save, thus not creating any unwanted
# `xml:space="preserve"` tag child under workbook properties. (which breaks
#... | Python | 1 |
Err(SignatureError(InternalError::VerifyError))
} else {
Ok(vrf_out)
}
}
}
<filename>kernel/crates/build-util/src/lib.rs
/* Copyright (c) 2021 <NAME> (<EMAIL>)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associat... | Rust | 0 |
import os
import json
from rest_framework import status
from rest_framework.response import Response
from app.plugins.views import TaskView, GetTaskResult, TaskResultOutputError
from app.plugins.worker import run_function_async
from django.utils.translation import gettext_lazy as _
def detect(orthophoto, model, classe... | Python | 1 |
projections = trajectory[:-1,:] + (t*diffs.T).T
# dists = np.linalg.norm(point - projections,axis=1)
# min_dist_segment = np.argmin(dists)
# return projections[min_dist_segment], dists[min_dist_segment], t[min_dist_segment], min_dist_segment
def update_params(
self, mu, h_cg, l_r, ... | Python | 1 |
Vec<Wik>;
fn next(&mut self) -> Option<Self::Item> {
if let Some((_, page)) = self.it.next() {
page.get_line()
} else {
None
}
}
}
<reponame>wlh320/webtail<gh_stars>0
use axum::{routing::get, AddExtensionLayer, Router};
use clap::Parser;
use std::{net::SocketAdd... | Rust | 0 |
# Copyright 2021 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 agreed to in writing, ... | Python | 1 |
b'A']);
}
}
<reponame>raphaelcohn/security-keys-rust
// This file is part of security-keys-rust. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/security-keys-rust/master/COPYRIGHT. No part of security... | Rust | 0 |
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `SELMS_0`"]
#[inline]
pub fn is_selms_0(&self) -> bool {
*self == SELMSR::SELMS_0
}
#[doc = "Checks if the value of the field is `SELMS_1`"]
#[inline]
pub fn is_selms_1(&self) -> bool {
... | Rust | 0 |
onvergence=False)
assert type(df) is cudf.DataFrame
assert type(converged) is bool
assert converged is False
# The default max_iter value should allow convergence for this graph
(df, converged) = cugraph.pagerank(G, fail_on_nonconvergence=False)
assert type(df) is cudf.DataFrame
assert type... | Python | 1 |
hboard."""
total_docs = db.query(Document).count()
permanent_docs = db.query(Document).filter(Document.is_permanent == True).count()
temp_docs = db.query(Document).filter(Document.is_permanent == False).count()
# Get documents by category
category_counts = {}
cat... | Python | 1 |
oms["O5'"]
RETURNS:
phosOxyCoords - a dictionary of the phosphoryl oxygen coordinates in the format atomName: [x, y, z]
or None if the residue is missing the necessary atoms
"""
try:
P = curResAtoms ["P"]
if prevResAtoms is not None:
O = prevResAtoms["O3'"]
... | Python | 1 |
fn string_trailing_newline() {
let indoc = indoc!("
a
\\b
c
");
let expected = "a\n\n \\b\nc\n";
assert_eq!(indoc, expected);
}
#[test]
fn trailing_whitespace() {
let indoc = indoc!("
2 below
0 below
-2 below
... | Rust | 0 |
}
}
impl From<String> for Topic {
fn from(topic: String) -> Self {
Topic(topic.to_string())
}
}
impl<'a> From<&'a SystemEvent> for Topic {
fn from(evt: &SystemEvent) -> Self {
match evt {
&SystemEvent::ActorCreated(_) => Topic::from("actor.created"),
&SystemEve... | Rust | 0 |
on raised Event.
Save current data as final checkpoint if configure save_final is True. This callback may be skipped
because the logic with Ignite can only trigger the first attached handler for `EXCEPTION_RAISED` event.
Args:
engine: Ignite Engine, it can be a trainer, validator or... | Python | 1 |
ION: SqlState = SqlState(Inner::EHV021);
/// HV024
pub const FDW_INVALID_ATTRIBUTE_VALUE: SqlState = SqlState(Inner::EHV024);
/// HV007
pub const FDW_INVALID_COLUMN_NAME: SqlState = SqlState(Inner::EHV007);
/// HV008
pub const FDW_INVALID_COLUMN_NUMBER: SqlState = SqlState(Inner::EHV008);
... | Rust | 0 |
VeracruzSocketError {
/// An error was returned by nix
#[error(display = "VeracruzSocketError: Nix Error: {:?}", _0)]
NixError(#[error(source)] nix::Error),
}
/// Send a buffer of data (using a length, buffer protocol) to the file
/// descriptor `fd`
pub fn send_buffer(fd: RawFd, buffer: &Vec<u8>) -> Res... | Rust | 0 |
temperature: Temperature for softmax
Returns:
torch.Tensor: Top-k entropy regularization term
"""
magnitudes = torch.abs(batch_tensor)
# Get top-k values and compute soft distribution
top_k_values, _ = torch.topk(magnitudes, k=k, dim=1)
soft_distribution = torch.softmax(top_k_values / temp... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 10 11:17:59 2024
@author: suraj
"""
"""-----------------------------assigmaent -------------------------"""
import pandas as pd
import numpy as np
df = pd.read_csv("C:/Data Science/1-python/Company_Data.csv")
df
#Get the number of Rows in the df
rows_count = len(df.i... | Python | 1 |
"for the given customer ID."
)
)
# The following argument(s) should be provided to run the example.
parser.add_argument(
"-c",
"--customer_id",
type=str,
required=True,
help="The Google Ads customer ID.",
)
parser.add_argument(
"-b",
... | Python | 1 |
e().expect("Invalid address")
}
#[test]
fn test_connection_cache() {
// Allow the test to run deterministically
// with the same pseudorandom sequence between runs
// and on different platforms - the cryptographic security
// property isn't important here but ChaChaRng provi... | Rust | 0 |
anyhow::{Context, Result};
use byte_slice_cast::{AsByteSlice, AsMutSliceOf};
use filecoin_hashers::Hasher;
use generic_array::{
typenum::{Unsigned, U64},
GenericArray,
};
use log::{debug, info};
use mapr::MmapMut;
use merkletree::store::{DiskStore, Store, StoreConfig};
use storage_proofs_core::{
cache_key:... | Rust | 0 |
the **Y axis** when used in a transformation.
#[inline]
pub const fn flip_y() -> Basis {
Basis::from_diagonal(Vector3::new(1.0, -1.0, 1.0))
}
/// The basis that will flip something along the **Z axis** when used in a transformation.
#[inline]
pub const fn flip_z() -> Basis {
Ba... | Rust | 0 |
# Portions copyright (c) Meta Platforms, Inc. and affiliates.
# pyre-strict
import sys
# operation flags
OP_ASSIGN = "OP_ASSIGN"
OP_DELETE = "OP_DELETE"
OP_APPLY = "OP_APPLY"
SC_LOCAL = 1
SC_GLOBAL_IMPLICIT = 2
SC_GLOBAL_EXPLICIT = 3
SC_FREE = 4
SC_CELL = 5
SC_TYPE_PARAM = 9
SC_UNKNOWN = 6
CO_OPTIMIZED = 0x0001
C... | Python | 1 |
\
53697817977846174064955149290862569321978468622482\
83972241375657056057490261407972968652414535100474\
82166370484403199890008895243450658541227588666881\
16427171479924442928230863465674813919123162824586\
17866458359124566529476545682848912883142607690042\
24219022671055626321111109370544217506941658960408\
071984... | Rust | 0 |
PageFaultError: u32 {
/// 0: The fault was caused by a non-present page.
/// 1: The fault was caused by a page-level protection violation
const PFAULT_ERROR_P = bit!(0),
/// 0: The access causing the fault was a read.
/// 1: The access causing the fault was a write.
cons... | Rust | 0 |
import json
import os
from string import Template
class CustomTemplate(Template):
delimiter = '%%'
def generate_config():
# 個人情報の読み込み
with open('personal-information.json', 'r', encoding='utf-8') as f:
personal_info = json.load(f)
# 環境変数からUSERを取得し、辞書に追加
user = os.environ.get('USER')
i... | Python | 1 |
I32 => Ok((left, Primitive::I32)),
Keyword::I64 => Ok((left, Primitive::I64)),
Keyword::U8 => Ok((left, Primitive::U8)),
Keyword::U16 => Ok((left, Primitive::U16)),
Keyword::U32 => Ok((left, Primitive::U32)),
Keyword::U6... | Rust | 0 |
from bs4 import BeautifulSoup
from scraper_utils import parse_directory
def test_problematic_header_extraction():
# This snippet mimics a header that might be problematic.
# For example, no <b> tag is present or it is malformed, but it contains the parenthesized content.
html = """
<dir>
<p>AB... | Python | 1 |
shift
trainer.model.config.quantization_config.shift_smooth_all_linears = (
quant_args.smooth_all_linears or quant_args.shift_all_linears
)
ptq_dataloader = trainer.get_ptq_dataloader(ptq_ds)
if quant_args.shift or quant_args.smooth:
ptq_model_config = get_ptq_mod... | Python | 1 |
("info")),
)
.with_writer(std::io::stderr)
.init();
let opts: Options = StructOpt::from_args();
let cfg_path = opts.workdir.join("client.json");
let db_path = opts.workdir.join("client.db");
let cfg: ClientAndGatewayConfig = load_from_file(&cfg_path);
let db = sled::open(&db... | Rust | 0 |
u32, r: u32) -> (u32, u32) {
if index % 2 == 0 {
let l = l ^ self.p_array[index];
(l, r ^ self.f(l))
} else {
let r = r ^ self.p_array[index];
(l ^ self.f(r), r)
}
}
fn decrypt_round(&self, index: usize, l: u32, r: u32) -> (u32, u32) {
... | Rust | 0 |
h = self.gat_layers[l](use_g, h)
hidden_list.append(h)
enc_rep, all_hidden = self.head(h), hidden_list
if self._concat_hidden:
enc_rep = torch.cat(all_hidden, dim=1)
# ---- attribute reconstruction ----
rep = self.encoder_to_decode... | Python | 1 |
deck = {
'Jack of hearts': 10,
'Jack of diamonds': 10,
'Jack of clubs': 10,
'Jack of spades': 10,
'Ace of hearts': 10,
'Ace of diamonds': 10,
'Ace of clubs': 10,
'Ace of spades': 10,
'King of hearts': 10,
'King of diamonds': 10,
'King of clubs': 10,
'King of spades': 10,
... | Python | 1 |
lang=Component.UNDEFINED,
role=Component.UNDEFINED,
spellCheck=Component.UNDEFINED,
style=Component.UNDEFINED,
tabIndex=Component.UNDEFINED,
title=Component.UNDEFINED,
loading_state=Component.UNDEFINED,
**kwargs
):
self._prop_names = [
... | Python | 1 |
from numpy import array, ndarray, sqrt, outer
__all__ = ['vector_to_symmetric', 'Variates']
def vector_to_symmetric(v):
'''Convert an iterable into a symmetric matrix.'''
np = len(v)
N = (int(sqrt(1 + 8*np)) - 1)//2
if N*(N+1)//2 != np:
raise ValueError('Cannot convert vector to symmetric ma... | Python | 1 |
el,
TF_CTRL_PRETRAINED_MODEL_ARCHIVE_MAP,
)
from .modeling_tf_albert import (
TFAlbertPreTrainedModel,
TFAlbertModel,
TFAlbertForMaskedLM,
TFAlbertForSequenceClassification,
TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_MAP,
)
from .modeling_tf_t5 import (
... | Python | 1 |
#!/usr/bin/env python3
"""
MongoDB Data Analysis Script
============================
This script analyzes the current MongoDB database structure to understand
what data we have and what needs to be improved.
"""
import sys
import os
# Add the project root to the Python path
sys.path.append(os.path.join(os.path.dirna... | Python | 1 |
kedlist.bc-g");
let module = Module::from_bc_path(&path).expect("Failed to parse module");
let debug_filename = "linkedlist.c";
let debug_directory = Some("/Users/craig/llvm-ir/tests/basic_bc".to_owned());
let func = module.get_func_by_name("simple_linked_list").expect("Failed to find function");
l... | Rust | 0 |
};
use cgmath::{Basis2, Rad, Rotation, Rotation2, Vector2};
use image::io::Reader as ImageReader;
use image::RgbImage;
use rand::distributions::{IndependentSample, Range};
use rand::Rng;
use rayon::prelude::*;
pub struct PointsSimulator {
pub points: Vec<Point>,
img: RgbImage,
space_size: SimulationSpace,
... | Rust | 0 |
== *is_positive
} else {
true
}
}
})
}
fn capture_for_index(&self, capture_index: u32) -> Option<Node<'a>> {
for c in self.captures {
if c.index == capture_index {
return Some(c.node... | Rust | 0 |
Data from dex.izu.moe"))
})
})
.await;
Ok(())
}
fn cap_first_letter(s: &str) -> String {
let mut c = s.chars();
match c.next() {
None => String::new(),
Some(f) => f.to_uppercase().collect::<String>() + c.as_str(),
}
}
<filename>src/client/plc_types.rs
#[deriv... | Rust | 0 |
ew neurons to be used
/// in tests.
#[cfg(not(target_arch = "wasm32"))]
pub fn with_test_neurons(&mut self) -> &mut Self {
use ic_nns_common::pb::v1::NeuronId as NeuronIdProto;
const TWELVE_MONTHS_SECONDS: u64 = 30 * 12 * 24 * 60 * 60;
use ic_nervous_system_common_test_keys::{
... | Rust | 0 |
okeeper-backed storage
RESPONSE_TYPE = OffsetFetchResponse_v0
SCHEMA = Schema(
('consumer_group', String('utf-8')),
('topics', Array(
('topic', String('utf-8')),
('partitions', Array(Int32))))
)
class OffsetFetchRequest_v1(Request):
API_KEY = 9
API_VERSION =... | Python | 1 |
![],
// telemetry_endpoints:
Some(TelemetryEndpoints::new(vec![(
STAGING_TELEMETRY_URL.to_string(),
STAGING_TELEMETRY_LEVEL,
)])),
// protocol_id:
Some(DEFAULT_PROTOCOL_ID),
... | Rust | 0 |
self
}
}
impl From<u8> for Intenset {
#[inline]
fn from(other: u8) -> Self {
Intenset(other)
}
}
impl ::core::fmt::Display for Intenset {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
self.0.fmt(f)
}
}
impl ::core::fmt::Debug for Intenset {
... | Rust | 0 |
use schemes::{
mke08::*,
bdabe::*
};
use bn::{Group, Gt, G1, G2};
/// A DNF policy for the MKE08 scheme and the BDABE scheme
pub struct DnfPolicy {
pub _terms: Vec<(Vec<String>, Gt, Gt, G1, G2)>,
}
#[allow(dead_code)]
impl DnfPolicy {
/// Returns a new DNF policy based on a textual dnf policy.
//... | Rust | 0 |
Assertions()
# patch basedir check to always succeed
self.setupUpIsWorkerDir(True)
# patch stopWorker() to raise an exception
mock_stopWorker = mock.Mock(side_effect=stop.WorkerNotRunning())
self.patch(stop, "stopWorker", mock_stopWorker)
exit_code = stop.stop(self.con... | Python | 1 |
ult.append(sub_seq)
result.append(tok)
return result
def split_on_tokens(tok_list, seq):
if not seq.strip():
return []
tokenized_seq = []
seq_list = [seq]
for tok in tok_list:
tokenized_seq = []
... | Python | 1 |
ValueError: If the tensor `input_` is not a Tensor, SparseTensor or
TensorArray.
"""
message = message or ""
if input_ is None:
raise ValueError("input_ must be of type "
"Tensor, SparseTensor or TensorArray")
tensor_list = _get_tensor_repr(input_, print_tensor_name, print_t... | Python | 1 |
().is_nan());
///
/// let mut y = [2.0, 1.0, 3.0, 4.0];
/// assert_almost_eq!(y.interquartile_range(), 2.166666666666667, 1e-15);
/// assert!(y != [2.0, 1.0, 3.0, 4.0]);
/// # }
/// ```
fn interquartile_range(&mut self) -> T;
/// Evaluates the rank of each entry of the data.
///
... | Rust | 0 |
pub sType: VkStructureType,
pub pNext: *const c_void,
pub commandPool: VkCommandPool,
pub level: VkCommandBufferLevel,
pub commandBufferCount: u32,
}
impl Default for VkCommandBufferAllocateInfo {
fn default() -> Self {
VkCommandBufferAllocateInfo {
sType: VK_STRUCTURE_TYPE_COM... | Rust | 0 |
# gradient variances
state["exp_avg_sq"] = torch.zeros_like(
p.data, dtype=dtype, device="cpu"
)
if self.use_fp16_stats:
assert torch.is_floating_point(p.data)
state["exp... | Python | 1 |
#Define a function that accepts roll number and returns whether the student is present or absent.
def attendence(rollno):
x = [23,43,22,56]
if rollno in x:
print(f"Roll number {rollno} is present")
else:
print(f"Roll number {rollno} is absent")
rollno = int(input("Enter roll no:... | Python | 1 |
te_store, State},
};
// Note, you can use StdResult in some functions where you do not
// make use of the custom errors and declare a custom Error variant for the ones where you will want to make use of it
#[entry_point]
pub fn instantiate(
deps: DepsMut,
_env: Env,
_: MessageInfo,
msg: InstantiateMsg... | Rust | 0 |
und ESP 032979 Plug', 'Gosund ESP 10098F Socket', 'Gosund ESP 0C3994 Plug', 'Gosund ESP 1ACEE1 Socket', 'Gosund ESP 147FF9 Plug', 'Gosund ESP 10ACD8 Plug', 'HeimVision SmartLife Radio Lamp', 'Philips Hue Bridge', 'Ring Base Station AC 1236', 'iRobot Roomba', 'Smart Board', 'Teckin Plug 1', 'Teckin Plug 2', 'Yutron Plu... | Python | 1 |
SHAREABILITY_LEVELS_0 = 0,
#[doc = "1: ARMv7-M unused"]
SHAREABILITY_LEVELS_1 = 1,
}
impl From<SHAREABILITY_LEVELS_A> for u8 {
#[inline(always)]
fn from(variant: SHAREABILITY_LEVELS_A) -> Self {
variant as _
}
}
#[doc = "Reader of field `SHAREABILITY_LEVELS`"]
pub type SHAREABILITY_LEVELS... | Rust | 0 |
ists: EnumSet::empty(),
_placeholder: (),
}
}
/// This locator type is currently unstable.
fn is_unstable() -> bool {
true
}
}
/// Implementation of `schema`, but as a real `async` function.
async fn schema_helper(
_ctx: Context,
source: DbcrossbarTsLocator,
) -> Re... | Rust | 0 |
import pytest
import pandas as pd
import pandas._testing as tm
class BaseAccumulateTests:
"""
Accumulation specific tests. Generally these only
make sense for numeric/boolean operations.
"""
def _supports_accumulation(self, ser: pd.Series, op_name: str) -> bool:
# Do we expect this accum... | Python | 1 |
].append(epoch + counter_ratio)
self.plot_data['Y'].append([losses[k] for k in self.plot_data['legend']])
self.vis.line(
X=np.stack([np.array(self.plot_data['X'])] * len(self.plot_data['legend']), 1),
Y=np.array(self.plot_data['Y']),
opts={
'title': self.name + ' loss over time',
'legend': self.plo... | Python | 1 |
i8,
) -> c_void;
/// * flags: 0
#[link_name = "?BeginDragDropSource@ImGui@@YA_NH@Z"]
pub fn BeginDragDropSource(
flags: i32,
) -> bool;
/// * type:
/// * data:
/// * sz:
/// * cond: 0
#[link_name = "?SetDragDropPayload@ImGui@@YA_NPEBDPEBX_KH@Z"]
pub fn SetDragDr... | Rust | 0 |
(
M["m01"] / M["m00"]
) # y coordinate of detected lane in sliding window that we dealing with.
rx.append(right_peak - 50 + cx)
right_peak = (
right_peak - 50 + cx
) # Changing the peak value of left lane according... | Python | 1 |
EY4, bar);
let mut baz = sha2_csr.zf(utra::sha2::KEY4_KEY4, bar);
baz |= sha2_csr.ms(utra::sha2::KEY4_KEY4, 1);
sha2_csr.wfo(utra::sha2::KEY4_KEY4, baz);
let foo = sha2_csr.r(utra::sha2::KEY5);
sha2_csr.wo(utra::sha2::KEY5, foo);
let bar = sha2_csr.rf(utra::sha2::KEY5_KE... | Rust | 0 |
alpha != 1 and beta != 1:
return F.linear(mat1, mat2.transpose(0, 1)) * alpha + input * beta
elif alpha != 1:
return F.linear(mat1, mat2.transpose(0, 1)) * alpha + input
elif beta != 1:
return F.linear(mat1, mat2.transpose(0, 1)) + input * beta
else:
return F.linear(mat1, mat... | Python | 1 |
oc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: MUX_CSX1_A) -> &'a mut W {
{
self.bits(variant.into())
}
}
#[doc = "NOR/PSRAM Address bit 25 (A25)"]
#[inline(always)]
pub fn mux_csx1_0(self) -> &'a mut W {
self.variant(MU... | Rust | 0 |
Usage:
result=CalculateWeiner(mol)
Input: mol is a molecule object
Output: result is a dict form containing all topological indices.
#################################################################
"""
result = {}
for DesLabel in _Topology.keys():
result[DesLabe... | Python | 1 |
ngsPerUser") {
Ok(0u32) => return false,
_ => return true,
}
};
true
}
fn win_inet_get_autoconfig_type(connections: RegKey) -> AutoconfigType {
if let Ok(default_connection_settings) = connections.get_raw_value("DefaultConnectionSettings") {
let bytes = default_conn... | Rust | 0 |
# EXAMPLE: set_tutorial
# HIDE_START
"""
Code samples for String doc pages:
https://redis.io/docs/latest/develop/data-types/strings/
"""
import redis
r = redis.Redis(decode_responses=True)
# HIDE_END
# STEP_START set_get
res1 = r.set("bike:1", "Deimos")
print(res1) # True
res2 = r.get("bike:1")
print(res2) # D... | Python | 1 |
import streamlit as st
from core.speech_to_text import recognize_speech_to_text
import google.generativeai as genai
import os
from dotenv import load_dotenv
from matplotlib import pyplot as plt
st.set_page_config(page_icon="🧊")
# Load environment variables
load_dotenv()
genai.configure(api_key=os.environ["GEMINI_API... | Python | 1 |
) / 255.,
alpha: 1.
};
enemy_count_text_query.single_mut().sections[1].value = format!("{:.2}", chaser_count.current);
}
}
// A unit struct to help identify the FPS UI component, since there may be many Text components
#[derive(Component)]
struct FpsText;
#[derive(Component... | Rust | 0 |
::new(slog_json::Json::default(std::io::stderr())).map(slog::Fuse),
o!()
);
/// Initializes the global logger once.
static ref INIT_GLOBAL_LOGGER: Once = Once::new();
/// Prevents the global logger from being dropped.
static ref GLOBAL_LOGGER_SCOPE_GUARD: Mutex<Option<slog_scope::GlobalLog... | Rust | 0 |
#!/usr/bin/env python
import unittest
from pyutil import randutil
from pyutil import zlibutil
class Accumulator:
def __init__(self):
self.buf = ''
def write(self, str):
self.buf += str
def make_decomp(realdecomp):
def decomp(str, maxlen, maxmem):
d = Accumulator()
reald... | Python | 1 |
#!/usr/bin/env python3
import os
import sys
import time
import subprocess
import sentry_sdk
class DisplayManager:
"""
Класс для управления отображением информации на экране.
Поддерживает различные экраны: меню, запись, воспроизведение.
"""
def __init__(self, menu_manager):
"""
... | Python | 1 |
d, turn on automatic repair
rensponse_succ = False
err_msg = "Your answer has multiple json contents, which is not the required return format."
else:
tool_name = json_objects[0].get("tool_name", None)
args = json_objects[0].get("args", None)
try:
... | Python | 1 |
# Display report URL if available
if script_exec.get('report_url'):
print(f" 📊 Report: {script_exec['report_url']}")
# Display logs URL if available
if script_exec.get('logs_url')... | Python | 1 |
if unlink:
snapshot.unlink()
# If nothing else in the snapshots folder, delete the folder
if unlink and next(snapshots_path.rglob('*'), None) is None:
snapshots_path.rmdir()
_logger.info('%i snapshots uploaded to Alyx', len(notes))
return notes
def _run(... | Python | 1 |
import time
from pages.inventory_page import InventoryPage
from pages.login_page import LoginPage
def test_login_correct_credentials_should_login_successfully(driver):
login_page = LoginPage(driver)
login_page.open()
login_page.login("standard_user", "secret_sauce")
assert login_page.get_current_url... | Python | 1 |
,
GL_FLOAT,
GL_FALSE,
size_of::<Vertex>().try_into().unwrap(),
0 as *const _,
);
glEnableVertexAttribArray(0);
}
let shader_program = ShaderProgram::from_vert_frag(VERT_SHADER, FRAG_SHADER).unwrap();
shader_program.use_program();
'main_lo... | Rust | 0 |
ualBibles": "个别圣经",
"edit_language_file": "编辑语言档案",
"openOnNewWindow": "新建视窗",
"selectTooltipTranslation": "选择工具提示翻译",
"editWorkingTranslation": "编辑修改中的翻译档案",
"checkLanguageFiles": "检查语言档案",
"hymn_lyrics": "诗歌歌词",
"populateTabsOnStartup": "在启动时,把最新的历史记录载入所有页签中。备注:此功能需要较长的时间来启动 UBA。",
"cu... | Python | 1 |
"[START] Round {self.curr_round} | LLM {llm.get_model_name()} "
f"running on thread {thread_id} at {start_time}")
try:
value, value_reasoning = llm.ask(self._generate_prompt(index))
except Exception as e:
print(f"[Error] LLM {llm.get_model_name(... | Python | 1 |
en for 60 seconds.
UnicornHATHelper.draw_scrolling_text(
unicornhathd=unicornhathd,
screen_width=screen_width,
screen_height=screen_height,
line='Error',
color=(255, 0, 0),
font=font,
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.