text string | label_name string | labels int64 |
|---|---|---|
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from pydantic import BaseModel
from hass_panel.core.deps import get_db
from hass_panel.core.auth_deps import get_current_user
from hass_panel.core.hash_utils import hash_password, verify_password
fr... | Python | 1 |
server_error_detected = True
# If this is a critical error and we have retries left, restart
if "Protocol initialization error" in error_msg and retries_left > 0:
console.print(
... | Python | 1 |
elbutton.controlLeft(self.okbutton)
self.cancelbutton.controlRight(self.okbutton)
self.okbutton.controlDown(self.chkbutton[2])
self.okbutton.controlUp(self.chkbutton[8])
self.cancelbutton.controlDown(self.chkbutton[0])
self.cancelbutton.controlUp(self.chkbutton[6])
self.s... | Python | 1 |
rap();
let elements = reader
.par_map_reduce(|_element| 1, || 0_usize, |a, b| a + b)
.unwrap();
assert_eq!(elements, 5);
}
}
#[test]
fn read_ways_and_deps() {
for path in &TEST_FILE_PATHS {
let mut reader = IndexedReader::from_path(path).unwrap();
let ... | Rust | 0 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SO... | Rust | 0 |
d.write(out)
pyi_output_path = f"{no_suffix_output_path}.pyi"
print(f"Generating {pyi_output_path}")
template = env.get_template("bindings.tmpl.pyi")
out = template.render(classes=classes_specs, constants=constants_specs)
with open(pyi_output_path, "w") as fd:
fd.write(out)
pxd_output_... | Python | 1 |
pub user: UserAttrs,
}
<filename>lib/src/hierarchy.rs
//! The Hierarchy model describes how Resources are structed in a tree-like shape.
//! It dealt with authorization (read / write grants)
use core::fmt;
use crate::{errors::AtomicResult, urls, Resource, Storelike};
#[derive(Debug)]
pub enum Right {
Read,
... | Rust | 0 |
}
}
#[fasync::run_singlethreaded(test)]
async fn test_create_disk() {
let disk = TestFatDisk::empty_disk(2048 << 10); // 2048K disk.
let structure = TestDiskContents::dir()
.add_child("test", "This is a test file".into())
.add_child("empty_folder", TestDiskContents:... | Rust | 0 |
= date_obj.strftime("%Y-%m-%d")
new_date_str = date_obj_ny.strftime("%Y-%m-%d %H:%M:%S")
query = query_template.format(symbol=symbol)
try:
df = pd.read_sql_query(query, ... | Python | 1 |
V>(self, visitor: V) -> Result<V::Value, Self::Error>
where V: Visitor<'de>
{
if self.tag.is_some() {
let tag = self.tag.take().unwrap();
visitor.visit_i8(tag)
} else if self.data.is_some() {
let data = self.data.take().unwrap();
match data {
... | Rust | 0 |
'combined_dist': 'Range Deficit (miles)',
# 'count': 'Number of Blocks'
# }
# ).update_layout(yaxis_title='Number of Blocks')
# )
st.plotly_chart(
px.ecdf(
range_deficit, 'combined_dist',
title='Distribution o... | Python | 1 |
OST'
def test_http_header_host_trailing_period():
client.load('host')
resp = client.get(headers={'Host': '127.0.0.1.', 'Connection': 'close'})
assert resp['status'] == 200, 'Host trailing period status'
assert (
resp['headers']['X-Server-Name'] == '127.0.0.1'
), 'Host trailing period SER... | Python | 1 |
# Copyright 2015 Google Inc.
#
# 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 |
slug=enterprise_learner_portal_slug,
)
return learner_portal_url
return None
def add_message_if_enterprise_user(self, request, enterprise_customer, learner_portal_url):
"""
Adds a info message alert informing the user of their enterprise learner portal ... | Python | 1 |
: types::GLuint) -> () { __gl_imports::mem::transmute::<_, extern "system" fn(types::GLint, types::GLuint, types::GLuint, types::GLuint, types::GLuint) -> ()>(storage::Uniform4ui.f)(location, v0, v1, v2, v3) }
/// Fallbacks: Uniform4uivEXT
#[allow(non_snake_case, unused_variables, dead_code)] #[inline]
pub ... | Rust | 0 |
def cores():
"""
Cores e estilos no termina.
STYLE TEXT BACK COR
0 Nenhum 30 40 Branco
1 Negrito 31 41 Vermelho
4 Sublinhado 32 42 Verde
7 Negativo 33 43 Amarelo
34 44 A... | Python | 1 |
"""
Copyright 2018 The Matrix Authors
This file is part of the Matrix library.
The Matrix library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any la... | Python | 1 |
import subprocess
#llama="internlm2:latest"
#llama="llama3:8b"
#llama="gemma2:latest"
#llama="llama3:70b"
#llama="deepseek-coder-v2:16b"
#llama="deepseek-coder-v2:236b"
llama="deepseek-r1:8b"
class OllamaAgent:
def __init__(self, agent_id, config, logger):
self.agent_id = agent_id
self.config = con... | Python | 1 |
"""
Middleware for sending request statistics to statsd.
"""
import time
from galaxy.model.orm.engine_factory import QUERY_COUNT_LOCAL
from galaxy.web.statsd_client import GalaxyStatsdClient
class StatsdMiddleware:
"""
This middleware will log request durations to the configured statsd
instance.
"""... | 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 |
blocks[j] = block
self.rcol_blocks = blocks
def output_rcol(self, filename = 'tmp-Col-Rebar_new.txt') :
#### OUTPUT tmp file and update rcol_datas
self.update_rcol()
block = self.rcol_blocks
datas = self.... | Python | 1 |
let mut rng = SmallRng::from_seed(seed.to_le_bytes());
let skew_remove: u8 = rng.gen::<u8>() % 2;
println!(
"test_simple_omap.run_with_key {} seed:{}, n_ops:{} skew_remove:{}",
prefix, seed, n_ops, skew_remove
);
let mut index: OMap<K, u64> = OMap::new();
let mut btmap: BTreeMap<K, ... | Rust | 0 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer
from qiskit.visualization import plot_histogram
import matplotlib.pyplot as plt
def generate_bell_state():
"""Generate a Bell state."""
circuit = QuantumCircuit(2)
circuit.h(0) # Apply Hadamard gate to the first qubit
circuit.cx(0, 1) ... | Python | 1 |
a(minutes=900),
# "%Y-%m-%dT%H:%M:%S")
# res1 = env.api_adapter.get_planner_worker_job_dataset()
# env.api_adapter.set_horizon_start_minutes(
# team_id=env.api_adapter.team_id,
# start_datetime=round_2_dt
# )
# for stepi in range(nbr_2nd_step... | Python | 1 |
File => GenericPage {
title: En.files(),
link: format!("{}/Special:ListFiles", wiki.site()),
desc: None,
},
Template => GenericPage {
title: En.templates(),
link: format!("{}... | Rust | 0 |
#!/usr/bin/env python3
import rospy
from dynamic_reconfigure.server import Server
from spliner_planner.cfg import dyn_avoidance_tunerConfig
def callback(config, level):
config.evasion_dist = round(config.evasion_dist, 2)
config.obs_traj_tresh = round(config.obs_traj_tresh,2)
config.spline_bound_mindist = r... | Python | 1 |
-> Self
{
self.sid = sid.into();
self
}
pub fn cid( mut self, cid: impl Into<Option< ConnID >> ) -> Self
{
self.cid = cid.into();
self
}
}
impl fmt::Display for PeerErrCtx
{
fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result
{
if let Some( x ) = &self.context
{
write!( f, " Context: {... | Rust | 0 |
pstr += '[0,100],'
webserver.addHtml('var props=['+str(pstr)+'];')
webserver.addHtml("var ownurl='http://" + str(OS.get_ip())+":"+str(Settings.WebUIPort)+"';")
webserver.addHtml("refreshDatas();setInterval(function(){ getDatas(); }, "+ str(dashtask.interval*1000) +");</script>")
else:
webserver.TX... | Python | 1 |
import json
from datasets import Dataset
from opencompass.registry import LOAD_DATASET
from .base import BaseDataset
@LOAD_DATASET.register_module()
class OBQADataset(BaseDataset):
@staticmethod
def load(path):
dataset_list = []
with open(path, 'r') as f:
for line in f:
... | Python | 1 |
ntal_scores.items():
emoji = {"Air": "🌪️", "Earth": "🌍", "Fire": "🔥", "Water": "🌊", "Spirit": "✨"}[element]
print(f"{emoji} {element}: {score:.1f}/100")
print(f"\n📊 BEWUSTZIJNSNIVEAU")
print(f"Gemiddelde Score: {flow_progression['average_score']:.1f}/100")
print(f"Huidige Fase: {flow_progression['phase']}... | Python | 1 |
Ok(value) => value,
Err(_) => return None,
};
let output = String::from_utf8_lossy(&*output.stdout).to_string();
if output.contains("dev") {
return Some(String::from("nightly"));
}
let regex = Regex::new(r"v[0-9]\.[0-9]\.[0-9]").unwrap();
Some(regex.find(output.as_str()).u... | Rust | 0 |
support::{assert_ok, construct_runtime, parameter_types};
use sp_core::H256;
use sp_io::TestExternalities;
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
};
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
type Block = frame_system::mocking::MockB... | Rust | 0 |
#coding=utf-8
import face_comm
import face_detect
import cv2
import numpy as np
import os
import time
import random
class Alignment:
def align_face(self,opic,faceKeyPoint):
img = cv2.imread(opic)
faceKeyPoint = faceKeyPoint[0]
#根据两个鼻子和眼睛进行3点对齐
eye1 = faceKeyPoint[0]
... | Python | 1 |
#[serde_as]
#[derive(Serialize)]
pub struct HistoryResponse {
#[serde_as(as = "DisplayFromStr")]
pub status: ResponseStatus,
pub data: Arc<ClientFindByIdHistoryDataset>,
}
#[serde_as]
#[derive(Serialize)]
pub struct HistoryResponseSlim<'a> {
#[serde_as(as = "DisplayFromStr")]
pub status: ResponseSt... | Rust | 0 |
macro::TokenStream;
mod add_field;
use add_field::*;
use syn::{
parse_macro_input,
};
use quote::quote;
#[proc_macro_attribute]
pub fn add_field(args: TokenStream, input: TokenStream) -> TokenStream {
let mut item_struct = parse_macro_input!(input as syn::ItemStruct);
let arg = parse_macro_input!(args as A... | Rust | 0 |
T0 Status"]
pub status: crate::Reg<status::STATUS_SPEC>,
}
impl RegisterBlock {
#[doc = "0x40 - ESC Reset ECAT \\[READ Mode\\]"]
#[inline(always)]
pub fn readmode_esc_reset_ecat(&self) -> &crate::Reg<readmode_esc_reset_ecat::READMODE_ESC_RESET_ECAT_SPEC> {
unsafe { &*(((self as *const Self) as *... | Rust | 0 |
/// assert!(a.is_ascii_alphanumeric());
/// assert!(g.is_ascii_alphanumeric());
/// assert!(zero.is_ascii_alphanumeric());
/// assert!(!percent.is_ascii_alphanumeric());
/// assert!(!space.is_ascii_alphanumeric());
/// assert!(!lf.is_ascii_alphanumeric());
/// assert!(!esc.is_ascii_alphanume... | Rust | 0 |
Pair, p256::P256KeyPair};
impl FromPrior {
/// Unpacks a plaintext value from a signed `from_prior` JWT.
/// https://identity.foundation/didcomm-messaging/spec/#did-rotation
///
/// # Parameters
/// - `from_prior_jwt` signed `from_prior` JWT.
/// - `did_resolver` instance of `DIDResolver` to re... | Rust | 0 |
generator (torch.Generator): pseudo random number generator used for
stochastic rounding.
Returns:
torch.Tensor: list of dataset indices to use in one epoch. Each index
is repeated based on its calculated repeat factor.
"""
# Since repeat factors are... | Python | 1 |
et val = match NonZeroU32::new(result) {
None => Ok(transferred),
Some(err) => Err(err),
};
(*self.0.get()).as_mut_ptr().write(val)
}
/// # Safety
/// This must be the only active reference to the result and it must have been previously set
pub(crate) unsafe fn g... | Rust | 0 |
0x0D96;
#[allow(dead_code, non_upper_case_globals)] pub const MAP1_VERTEX_3: types::GLenum = 0x0D97;
#[allow(dead_code, non_upper_case_globals)] pub const MAP1_VERTEX_4: types::GLenum = 0x0D98;
#[allow(dead_code, non_upper_case_globals)] pub const MAP2_COLOR_4: types::GLenum = 0x0DB0;
#[allow(dead_code, non_upper_case... | Rust | 0 |
# 40
'''livros=[["Comer, rezar e amar", "Elizabeht gilbert", "Disponivel"], ["Mil dias na Toscana", "Madalena de Blasi", "Disponivel"], ["50 tons de cinza", "E.L Jmaes", "Disponivel"]]
while True:
usuario=input("Digite seu primeiro Nome: ")
print(f'Olá, {usuario}')
print("Opções da Biblioteca")
print(... | Python | 1 |
et("/")
.with_request_header("forwarded", "for=192.0.2.60;proto=https;host=example.com")
.with_peer_ip("10.10.10.10".parse().unwrap())
.on(&app),
"true Some(192.0.2.60) Some(\"example.com\")"
);
assert_ok!(
get("/")
.with_request_header("forwarded... | Rust | 0 |
/////////
// 要素アクセス
////////////////////////////////////////////////////////////////////////////////
impl<O: Ops, Idx: SliceIndex<[O::Value], Output = O::Value>> Index<Idx> for Segtree<O> {
type Output = O::Value;
fn index(&self, index: Idx) -> &Self::Output {
&self.as_slice()[index]
}
}
/// [`Segtr... | Rust | 0 |
# 2024-12-01T23:13:25.179679
import vitis
#PATH = "/home/andrew/Desktop/snn-soc"
#PATH = "/Users/andrew/Desktop/snn-fpga"
PATH = "$SOURCE"
#print(PATH + "/vitis/ws")
client = vitis.create_client()
client.update_workspace(path=PATH+"/vitis/ws")
client.set_workspace(path=PATH+"/vitis/ws")
platform = client.create_plat... | Python | 1 |
b'\xb7' : '*',
b'\xb8' : ',',
b'\xb9' : '1',
b'\xba' : '(th)',
b'\xbb' : '>>',
b'\xbc' : '1/4',
b'\xbd' : '1/2',
b'\xbe' : '3/4',
b'\xbf' : '?',
b'\xc0' : 'A',
b'\xc1' : 'A',
b'\xc2' : 'A',
b'\xc3' : 'A',
b'\xc4' : ... | Python | 1 |
smethod
def retrieve(
cls, id: str, **params: Unpack["PaymentMethod.RetrieveParams"]
) -> "PaymentMethod":
"""
Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https:... | Python | 1 |
at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
// THE SOURCE CODE IS AVAILABLE UNDER THE ABOVE CHOSEN LICENSE "AS IS", WITH NO WARRANTIES.
//! This module contains the Rust FFI bindings for the APIs to interact with stor... | Rust | 0 |
t9eebu(ef4dh0n59jl: wn57ye48twy, xl_k7tjr986):
assert vikyhpfulyp, False
cxag9afotcq &= ijih74puyj_
'# documentation_contrast_horizon -> wait_junctions_buzzer'
'# documentation_contrast_horizon -> wait_junctions_buzzer'
nivy3zz9ju8[None]: False = aoqeh0p2tav
from sy6c0pw3r69 import vbxjt9dm1x6, ... | Python | 1 |
ad::spawn(|| unsafe {
let hook = SetWinEventHook(
EVENT_MIN,
EVENT_MAX,
HINSTANCE::NULL,
Some(win_event_hook),
0,
0,
0,
);
*HOOK.lock().unwrap() = hook;
let m... | Rust | 0 |
print(" i am a beginner with Git")
print(" changes has been made to code")
print("again changes has been made ") | Python | 1 |
a = 3.0
b = 4.0
c = (a ** 2 + b ** 2) ** 0.5
print("c =", c)
| Python | 1 |
parse_or_warn(
&value,
&mut result.max_flat_map_regens,
"u32",
MAX_FLAT_MAP_REGENS,
),
#[cfg(feature = "fork")]
FORK => parse_or_warn(&value, &mut result.fork, "bool", FORK),
#[cfg(feature = "timeout")]
... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# chemicalFormulas.py
#
# Copyright (c) 2003,2019 Paul McGuire
#
import pyparsing as pp
atomicWeight = {
"O" : 15.9994,
"H" : 1.00794,
"Na" : 22.9897,
"Cl" : 35.4527,
"C" : 12.0107,
}
digits = "0123456789"
# Version 1
element = pp.Word(pp.alphas.upper(), pp.alpha... | Python | 1 |
45_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PDZCR45_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PDZCR45_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PDZCR45` writer"]
pub struct W(crate::W<PDZCR45_SPEC>);
impl c... | Rust | 0 |
unsafe { TODO: call ffi::gst_pad_set_element_private() }
//}
//fn set_event_full_function_full(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFullFunction, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_event_full_function_full()... | Rust | 0 |
_downloader.download_svi(output_dir, lat=11.827575599999989, lon=13.146558000000027, buffer=100)
except TimeoutException:
pass # Allow timeout, we'll check the results next
assert len(list(output_dir.iterdir())) > 0, f"No files downloaded within {timeout_seconds} seconds"
def test_downloader_kwargs(... | Python | 1 |
*/
if let Ok(c) = dt.get_property(&format!("/htif"), &format!("compatible"))
.and_then(|node| node.as_text())
.and_then(|compat| console::Console::new_non_uart(compat.as_str()).ok_or(DeviceTreeError::DeviceFailure))
{
return Ok(c)
}
/* check if the firmw... | Rust | 0 |
s $n: [$t; $size] = $acc;
};
// EXTERNAL
// entry point
(pub $storage:ident $n:ident: [$t:ty; _] = [$($vals:expr),* $(,)*]) => {
counted_array!(@parse 0usize, ($($vals),*) -> [] ((pub) $storage $n $t));
};
(pub $restr:tt $storage:ident $n:ident: [$t:ty; _] = [$($vals:expr),* $(... | Rust | 0 |
# 2) WAP to greet only the people in a list whose name starts with S
myList = ["Harry", "Soham", "Sachin", "Rahul"]
for name in myList:
if name.startswith("S"):
print("Welcome",name) | Python | 1 |
],
remainder='passthrough'
)
pipeline_optuna = ImbPipeline([
('imputer', SimpleImputer(strategy='median')),
('to_dataframe', DataFrameConverter(columns=features)),
('preprocessor', preprocessor),
('smote', SMOTE(random_state=SEED)),
('classifier', model)
])
... | Python | 1 |
{
let e = w.explain(reader, doc)?;
max_coord += 1;
if e.is_match() {
sum += e.value();
coord += 1;
match_count += 1;
should_match_count += 1;
subs.push(e);
}
}
if fail {
... | Rust | 0 |
let (t_h, t_l) = high_low(3. + s2 + r);
/* u+v = s*(1+...) */
let u = s_h * t_h;
let v = s_l * t_h + t_l * s;
/* 2/(3log2)*(s+...) */
let (p_h, p_l) = high_low(u + v);
let z_h = CP_H * p_h; /* cp_h+cp_l = 2/(3*log2) */
let z_l = CP_L * p_h + p_l * CP + DP... | Rust | 0 |
any::TypeId, hash::Hash};
let mut hasher = ComponentTypeIdHasher::default();
let type_id = TypeId::of::<T>();
type_id.hash(&mut hasher);
assert_eq!(hasher.finish(), unsafe {
core::mem::transmute::<TypeId, u64>(type_id)
});
}
verify::<usize>();
verify::<(... | Rust | 0 |
egral(true, "0b", &self.to_str_radix(2))
}
}
impl fmt::Octal for BigUint {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad_integral(true, "0o", &self.to_str_radix(8))
}
}
impl FromStr for BigUint {
type Err = ParseBigIntError;
#[inline]
fn from_str(s: &str) -> Result<... | Rust | 0 |
lections::HashMap;
use std::env;
use std::fmt;
use std::fs;
#[derive(Debug)]
struct MostCommonWord {
value: String,
occurrence: u32,
}
impl fmt::Display for MostCommonWord {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"\"{}\" is the most common wor... | Rust | 0 |
"""
Example uses Open Library Books API (https://openlibrary.org/dev/docs/api/books)
"""
import requests
from json_to_models.generator import MetadataGenerator
from json_to_models.models.attr import AttrsModelCodeGenerator
from json_to_models.models.base import generate_code
from json_to_models.models.structure import... | Python | 1 |
class Solution:
def subarraySum(self, nums: List[int], k: int) -> int:
summ = 0
counter = {
summ: 1
}
count = 0
for x in nums:
summ += x
count += counter.get(summ - k, 0)
counter[summ] = counter.get(summ, 0) + 1
return ... | Python | 1 |
use box2d_rs::shapes::b2_edge_shape::*;
use box2d_rs::shapes::b2_polygon_shape::*;
use glium::backend::Facade;
use std::cell::RefCell;
use std::rc::Rc;
// It is difficult to make a cantilever made of links completely rigid with weld joints.
// You will have to use a high number of iterations to make them stiff.
// So... | Rust | 0 |
ultiaddr::
/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
The disconnect is not permanent; if IPFS needs to talk to that address
later, it will reconnect. To avoid this, add a filter for the given
address before disconnecting.
.. code-block:: python
>>> client... | Python | 1 |
# The contents of this file are subject to the Common Public Attribution
# License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... | Python | 1 |
./tests/fixtures/basic/main.js".to_owned());
// let mut graph = GraphContainer::from_single_entry("./tests/fixtures/symbols.js".to_owned());
// let mut graph = GraphContainer::from_single_entry("../testcase/custom/samples/default-export/main.js".to_owned());
// let mut graph = GraphContainer::from_single_entry(".... | Rust | 0 |
)
self.retranslateUi(MainWindow)
self.actionQuit.triggered.connect(MainWindow.close) # type: ignore
self.clearButton.clicked.connect(self.password1.clear) # type: ignore
self.enterButton.clicked.connect(MainWindow.printContent) # type: ignore
self.actionVersion.triggered.connect... | Python | 1 |
Acc, mut f: F) -> Acc
where F: FnMut(Acc, Self::Item) -> Acc,
{
self.0.fold(init, move |acc, (&id, c)| f(acc, (id, c)))
}
}
impl<'a, I: Id + Ord + 'a, C: Component + 'a> Iterate<'a, I, C> for BTreeStorage<I, C> {
type Ids = IdsMap<'a, I, C>;
type Iter = IterMap<'a, I, C>;
type Iter... | Rust | 0 |
mul(self.tz).unwrap_or(0);
s1.iter().zip(s2.iter()).for_each(|(k,v)|{
match *k {
"%Y" => {
self.year = v.parse::<i64>().unwrap_or_default();
let ally = self.year.checked_sub(1970).unwrap_or(0);
let loopy= ally.checked_div(4)... | Rust | 0 |
"ast_symbol_node",
"ast_symbol_stub_node",
"ast_impl_needing_node",
"ast_access_node",
"token_symbol",
"literal",
"ast_doc_node",
"ast_sem_str_node",
"python_module_ast",
... | Python | 1 |
} else {
#[cfg(all(target_arch = "wasm32", debug_assertions))]
web_sys::console::warn_1(
&"Effects created outside of a reactive root will never get disposed.".into(),
);
#[cfg(all(not(target_arch = "wasm32"), debug_assertions))]
eprin... | Rust | 0 |
dt in parsed_data_type]) \
or any([dt in found_data_type for dt in data_type]):
result.append(col_name)
return result
def name_col(col_names: str, append: str = None) -> str:
"""
Whenever you want to name and output use this function. This ensure that we use and Standard when n... | Python | 1 |
24149a8',
'info_dict': {
'id': '1032333',
'ext': 'flac',
'title': 'Shearer - Warmachine',
'artist': 'Shearer',
'track': 'Warmachine',
'timestamp': 1368089771,
'upload_date': '20130509',
... | Python | 1 |
s_console should be a no-op
just_fix_windows_console()
self.assertIs(sys.stdout, orig_stdout)
self.assertIs(sys.stderr, orig_stderr)
else:
def fake_std():
# Emulate stdout=not a tty, stderr=tty
# to check that we handle both cases c... | Python | 1 |
try:
response = requests.get("http://127.0.0.1:8000/", timeout=5)
print(f"✅ Root endpoint works: {response.status_code}")
print(f"Response: {response.json()}")
except Exception as e:
print(f"❌ Root endpoint failed: {e}")
if __name__ == "__main__":
print("🔧 Login Endpoint Diag... | Python | 1 |
"1${}${}",
// base64::encode(&self.salt).as_ref(),
base64::encode(&self.salt),
// base64::encode(&self.hash).as_ref(),
base64::encode(&self.hash),
);
as_str
}
}
/// Into() String implementation for V1Hash
impl Into<String> for V1Hash {
fn into(self) -> String {
self.to_string()
}
}
/// argon2id ... | Rust | 0 |
`U7` without bounds checking.
///
/// # Safety
/// Behavior is undefined if data > 127.
#[inline(always)]
pub unsafe fn from_unchecked(data: u8) -> U7 {
U7(data)
}
/// Create a `U7` from a `u8`. Only the 7 least significant bits of `note` are kept.
#[inline(always)]
pub con... | Rust | 0 |
(&ctx.http, format!("Voice stats measurement: {:?}", &om,))
.await,
);
},
Ok(None) => {
check_msg(
msg.channel_id
.say(
&ctx.http,
format!("I support the modes: {:?}", &OptInOutMode::LABEL_LIST),
)
.await,
);
},
Err(e) => {
check_msg(msg.channel_id.say(&ctx.htt... | Rust | 0 |
pub const RCC_APB2LPENR_TIM10LPEN_Msk: u32 = 131072;
pub const RCC_APB2LPENR_TIM10LPEN: u32 = 131072;
pub const RCC_APB2LPENR_TIM11LPEN_Pos: u32 = 18;
pub const RCC_APB2LPENR_TIM11LPEN_Msk: u32 = 262144;
pub const RCC_APB2LPENR_TIM11LPEN: u32 = 262144;
pub const RCC_BDCR_LSEON_Pos: u32 = 0;
pub const RCC_BDCR_LSEON_Msk... | Rust | 0 |
_UI_TextServices'*"]
pub const TF_DISABLE_SPEECH: u32 = 1u32;
#[repr(C)]
#[doc = "*Required features: 'Win32_UI_TextServices', 'Win32_Foundation'*"]
#[cfg(feature = "Win32_Foundation")]
pub struct TF_DISPLAYATTRIBUTE {
pub crText: TF_DA_COLOR,
pub crBk: TF_DA_COLOR,
pub lsStyle: TF_DA_LINESTYLE,
pub fBo... | Rust | 0 |
b[wi[i]] = window_lb[wi[i+1]] - 1
window_ub[wi[11]] = 80 # last window has upper bound 80
prod = np.zeros((12,3)) # accumulate resources for stations
selection = x[12:].astype(numba.int32) # @njit requires numba types
for i, s in enumerate(selection):
ssize = sel_size[i] # start trying sele... | Python | 1 |
because we form a slice, a [*T,int] pair, not
/// a pointer to an LLVM array type.
pub const_globals: RefCell<HashMap<int, ValueRef>>,
/// Cache of emitted const values
pub const_values: RefCell<NodeMap<ValueRef>>,
/// Cache of external const values
pub extern_const_values: RefCell<DefIdMap<V... | Rust | 0 |
///
/// This is a workaround for being unable to do `&foo[start..end]` at compile time.
///
/// # Additional Errors
///
/// This method returns `Error::NotOnCharBoundary` if the range is not
/// on a character boundary.
///
/// Out of bounds range bounds are treated as being at `s.len()`... | Rust | 0 |
());
}
#[test]
fn enum_with_tuple_variants() {
#[derive(Serialize, TypescriptDefinition)]
enum Enum {
#[allow(unused)]
V1(i64, String),
#[allow(unused)]
V2(i64, bool),
#[allow(unused)]
V3(i64, u64),
}
assert_eq!(Enum___typescript_definition(), quote!{
... | Rust | 0 |
let body = offsets
.chain([exclusive_lim - 1].into_iter())
.tuple_windows()
.step_by(2)
.map(|(lower, upper)| InclRange::new(lower, upper));
head.chain(body)
.collect::<Vec<_>>()
.into()
}
}
impl<T, U> From<T> for RangeVec
w... | Rust | 0 |
olve
:returns: An instance of `Resource`, if it was found
"""
if self._resolved and refid in self._resolved:
return self._resolved[refid]
return self._owner.resolvedReference(refid) if self._owner is not None else None
def didResolveReference(self, refid, resolved):
... | Python | 1 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Classifier trained on dialogue safety datasets: WikiToxicComments, Build it Break it Fix
it standard and adversarial ... | Python | 1 |
= spim::Spim::new(cx.device.SPIM0, pins, spim::Frequency::M1, spim::MODE_0, 0);
let neopixel = port0.p0_26.into_push_pull_output(Level::High).degrade();
let mut pwm = pwm::Pwm::new(cx.device.PWM0);
pwm.set_output_pin(pwm::Channel::C0, &neopixel);
pwm.set_period(800u32.hz());
// ... | Rust | 0 |
# !/usr/bin/env python3
# -*- encoding utf-8 -*-
"""
--------------------------------------------------------------------------------
_4.py | analogical reasoning with word embeddings
--------------------------------------------------------------------------------
Author : Simone Santoni, simone.santoni.1@... | Python | 1 |
auth token
if self.auth_token.read().unwrap().is_none() {
return Ok(vec![]);
}
}
self.connect().await?;
// Lock access token for reading
let access_token = self.access_token.read().unwrap();
let reqwest_client = Client::new();
l... | Rust | 0 |
arg3: *mut PyObject, arg4: *mut PyObject,
arg5: *mut PyCompilerFlags) -> *mut PyObject;
pub fn PyRun_FileExFlags(arg1: *mut FILE, arg2: *const c_char,
arg3: c_int, arg4: *mut PyObject,
arg5: *mut PyOb... | Rust | 0 |
}
}
def_tag!(break_tag, "break");
#[derive(Deserialize, Debug, Clone)]
pub struct Break(break_tag, pub ParenOrArgsAddBlock, pub LineCol);
#[derive(RipperDeserialize, Debug, Clone)]
pub enum ParenOrArgsAddBlock {
YieldParen(YieldParen),
ArgsAddBlock(ArgsAddBlock),
Empty(Vec<()>),
}
impl ParenOrArgsAddBlo... | Rust | 0 |
_xmmm128
0x4502_0081,// XOP_Vfrczpd_ymm_ymmm256
0x4402_0082,// XOP_Vfrczss_xmm_xmmm32
0x4402_0083,// XOP_Vfrczsd_xmm_xmmm64
0x4402_0090,// XOP_Vprotb_xmm_xmmm128_xmm
0x4442_0090,// XOP_Vprotb_xmm_xmm_xmmm128
0x4402_0091,// XOP_Vprotw_xmm_xmmm128_xmm
0x4442_0091,// XOP_Vprotw_xmm_xmm_xmmm128
0x4402_0092,// XOP_V... | Rust | 0 |
{}", e),
};
} else if args[0] == "read" {
match read() {
Ok(_) => {}
Err(e) => stop!("{}", e),
};
match state::state.lock() {
Ok(mut state) => {
state.middleware = true;
}
Err(e) => {
stop!("F... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.