text string | label_name string | labels int64 |
|---|---|---|
Geometry(geo.width() / 4, geo.height() / 4, geo.width() / 2, geo.height() / 2)
main_widget = QtWidgets.QWidget()
button_test = _TestClass()
button_normal = QtWidgets.QPushButton()
test_lay = QtWidgets.QVBoxLayout()
test_lay.addWidget(button_test)
test_lay.addWidget(button_normal)
main_widge... | Python | 1 |
trace!("get_non_revoc_interval <<< interval: {:?}", interval);
interval
}
macro_rules! _id_to_unqualified {
($entity:expr, $type_:ident) => ({
if $entity.starts_with($type_::PREFIX) {
return Ok($type_($entity.to_string()).to_unqualified().0);
}
})
}
macro_rules! _object_... | Rust | 0 |
let payload = match parse_event(event_name, &body) {
Ok(p) => p,
Err(DashError::Serde(why)) => {
error!("failed to parse webhook payload: {:?}", why);
return Failure((
Status::BadRequest,
... | Rust | 0 |
and_clear();
});
Self {
handle,
stop_token,
tx,
}
}
pub fn set_message(&self, message: String) -> Result<()> {
self.tx.send(SpinnerSetting::Message(message))?;
Ok(())
}
pub fn println(&self, msg: String) -> Result<()> {
... | Rust | 0 |
# 음수끼리 스플릿
# 각 스플릿에 대해 양수로 스플릿 후 합치기
# 첫 요소 - 나머지 요소의 합 으로 답 구하기
line = input().split('-')
result = sum([int(x) for x in line[0].split('+')])
if len(line) > 1:
for each in line[1:]:
result -= sum([int(x) for x in each.split('+')])
print(result) | Python | 1 |
message: String,
) -> bool {
let mut surpress = false;
help_command(core, player.as_mut(), &message, &mut surpress);
main_command(core, player.as_mut(), &message, &mut surpress);
join_command(core, player.as_mut(), &message, &mut surpress);
tp_command(core, player.as_mut(), &message, &mut surpress)... | Rust | 0 |
eturn [stream_instance for stream_instance in stream_instances if self.format_name(stream_instance.name) in permitted_streams]
@staticmethod
def get_user_scopes(config):
session = requests.Session()
url = f"https://{config['shop']}.myshopify.com/admin/oauth/access_scopes.json"
headers =... | Python | 1 |
}
Ok(())
}
// Copyright 2012-2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT licens... | Rust | 0 |
ge1_dimensions = images.first().unwrap().dimensions();
let image2_dimensions = images.last().unwrap().dimensions();
if image1_dimensions.ne(&image2_dimensions) {
return false;
}
}
if self.is_check_enabled("image_pixels_match") {
let image... | Rust | 0 |
(0xB9, 0xB4, 0x0A),
(0x83, 0xCB, 0x0C),
(0x5B, 0xD6, 0x3F),
(0x4A, 0xD1, 0x7E),
(0x4D, 0xC7, 0xCB),
(0x4C, 0x4C, 0x... | Rust | 0 |
,
},
#[cfg(feature = "ha")]
crate::Annotation {
lang: "ha",
tts: Some("buɗaɗɗen akwatin saƙo tare tuta ƙasa-ƙasa"),
keywords: &[
"akwatin saƙo",
"akwatin wasiƙa",
"buɗaɗɗe",
"buɗaɗɗen akwatin saƙo... | Rust | 0 |
=> (Implied, 2)
},
DEY => {
0x88 => (Implied, 2)
},
// CLC - Clear carry flag.
// C = 0
// Implied, we don't need addressing modes.
// Implied $18 1 2
CLC => {
0x18 => (Implied, 2)
},
// CLD - Clear Decimal Mode
// D = 0
// Implied $D8 1 2
CLD... | Rust | 0 |
# src/wasi_analyst/ui/launch.py
from pathlib import Path
import os
def main():
# app.py vive junto a este archivo
script = Path(__file__).with_name("app.py")
# reemplaza el proceso actual por `streamlit run app.py`
os.execvp("streamlit", ["streamlit", "run", str(script)])
| Python | 1 |
ome.clone(),
None => empty_image.clone(),
},
VertexImage::Custom(img) => img.clone(),
}
})
.collect();
if images.is_empty() {
images.push(empty_image);
}
let view = ComposerView {
inst: Instant::now(),
buffers,
images,
};
... | Rust | 0 |
nts; in case of
multi-channel input array, the table should either have a single
channel (in this case the same table is used for all channels) or
the same number of channels as in the input array.
Returns:
ndarray: The transformed image.
"""
assert isinstance(im... | Python | 1 |
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, ... | Rust | 0 |
::Formatter) -> Result<(), fmt::Error> {
match self {
AccessRightsError::NoAccessRights => write!(f, "URef has no access rights"),
}
}
}
// TODO: TURef might needs to be encoded into more fine grained types
// rather than hold AccessRights as one of the fields in order to be able
// to ... | Rust | 0 |
apshot};
use txn_types::Key;
command! {
/// Check secondary locks of an async commit transaction.
///
/// If all prewritten locks exist, the lock information is returned.
/// Otherwise, it returns the commit timestamp of the transaction.
///
/// If the lock does not exist or is a pessimistic lo... | Rust | 0 |
import tabulate
import csv
def reference_chart():
"""
This is a function used to tabulate the data
of the bmi scale for the user, this requries a csv file 'bmi.csv' and two libraries "csv" and "tabulate".
It won't take any arguments and won't return anything
"""
list2 = []
with open("bmi.c... | Python | 1 |
in binary format
pub return_type: String,
/// the access flags of the methood
pub access_flags: u16,
/// the attributes of the function (including the Code attribute)
pub attributes: Vec<Attribute>,
/// the extracted code attribute of this method
/// guaranteed to be Some if this method is n... | Rust | 0 |
from fixtures import * # noqa: F401,F403
from utils import TEST_NETWORK
import pytest
import unittest
def make_pending_splice(node_factory):
l1, l2 = node_factory.line_graph(2, fundamount=1000000, wait_for_announce=True, opts={'experimental-splicing': None, 'may_reconnect': True})
chan_id = l1.get_channel_i... | Python | 1 |
e(24596),), primary_games=[], all_games=[games.JURASSIC_WORLD_EVOLUTION_2_DEV])
pc = Ms2Version(id='PC', version=(32,), primary_games=[], all_games=[games.PLANET_COASTER])
pc2 = Ms2Version(id='PC2', version=(54,), primary_games=[], all_games=[games.PLANET_COASTER_2])
pz = Ms2Version(id='PZ', version=(50, 48,), primary_... | Python | 1 |
io::Read;
use std::io::Write;
use std::fs;
use std::path::Path;
use protobuf_test_common::build::*;
fn copy_test<P1: AsRef<Path>, P2: AsRef<Path>>(src: P1, dst: P2) {
eprintln!("copy {:?} to {:?}", src.as_ref(), dst.as_ref());
let mut content = Vec::new();
fs::File::open(src.as_ref())
.expect(&fo... | Rust | 0 |
hasher = H::default();
hasher.write_usize(num);
hasher.finish() as usize
}
#[inline(always)]
pub fn hash_key<K: Hash, H: Hasher + Default>(key: &K) -> usize {
let mut hasher = H::default();
key.hash(&mut hasher);
hasher.finish() as usize
}
#[inline(always)]
fn dfence() {
compiler_fence(SeqCst... | Rust | 0 |
# Copyright 2018 The trfl 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 law... | Python | 1 |
if lru_cache.len() == 0 || message.queries().is_empty() {
return None;
}
let message_id = message.id();
let query = message.queries()[0].clone();
let cache_key = Key { query };
let cache_value = match lru_cache.get(&cache_key) {
Some(cache_value) => c... | Rust | 0 |
Lanewise saturating subtract.
///
/// # Examples
/// ```
/// # #![feature(portable_simd)]
/// # #[cfg(feature = "std")] use core_simd::Simd;
/// # #[cfg(not(feature = "std"))] use core::simd::Simd;
#[doc = concat!("# use core::", strin... | Rust | 0 |
pub name: &'static str,
pub description: Option<&'static str>,
}
impl OptionInfo {
pub const fn from_name(name: &'static str) -> Self {
Self {
name,
description: None,
}
}
pub const fn new(name: &'static str, description: Option<&'static str>) -> Self {
... | Rust | 0 |
# coding: utf-8
"""
Slurm REST API
API to access and control Slurm
The version of the OpenAPI document: Slurm-24.11.5&openapi/slurmdbd&openapi/slurmctld
Contact: sales@schedmd.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E50... | Python | 1 |
(users[0].entity_mask)
self.entity_sent_mask = torch.ByteTensor(users[0].entity_sent_mask)
self.entity_label = torch.from_numpy(users[0].entity_label)
n = len(users)
if len(edges) == 0:
self.adj = np.zeros((n, n))
else:
row = [u for u,v in edges]
... | Python | 1 |
s_range=[0,1])
subplots_fig.show()
subplots_fig.write_image(fr'/home/nadavsc/LIGHTBITS/mpiricalplus/{name}.png', width=1920, height=1080)
# MCC in results test - All: {'MPI_Init': 1392, 'MPI_Comm_rank': 1401, 'MPI_Comm_size': 1202, 'MPI_Send': 797, 'MPI_Recv': 813, 'MPI_Finalize': 1495, 'MPI_Bcast': 271, 'MPI_... | Python | 1 |
------------------------
# Make sure that the Python federate configuration object is initialized.
#---------------------------------------------------------------------------
#federate.disable()
federate.initialize()
#---------------------------------------------------------------------------
# Set... | Python | 1 |
max_ngram_size: 3
number_of_keywords: 10
result:
type: array
items:
minItems: 0
type: object
required:
- name
- value
properties:
ngram:
type: string
score:
typ... | Python | 1 |
import re
import pandas as pd
import numpy as np
def split_answers(answers, answer_dims):
answers = answers.replace("\n", "")
dims = [dim + ": " for dim in answer_dims]
dim_indices = np.array([answers.index(dim) for dim in dims])
for i in range(len(dim_indices)):
dim_indices[np.argmax(dim... | Python | 1 |
2d2_sqlite::SqliteConnectionManager;
pub struct Database {
pub pool: Pool<SqliteConnectionManager>,
}
impl Database {
pub fn open() -> Result<Self> {
let manager = SqliteConnectionManager::file("users.db");
let pool = Pool::new(manager).map_err(|why| Error::R2D2(why))?;
let db = Databas... | Rust | 0 |
if r.status == 200:
return AccessJson.wrap_object(await r.json())
else:
raise AttributeError(await r.text())
async def delete_config(self, config_id: str) -> None:
async with self.session.delete(self.base_path + f"/config/{config_id}") as r:
... | Python | 1 |
use std::process::exit;
static REGISTRY: &str = "typeable";
static REPOSITORY: &str = "octopod-web-app-example";
#[derive(Debug, Deserialize)]
struct Resp {
results: Vec<Tag>,
}
#[derive(Debug, Deserialize)]
struct Tag {
name: String,
}
async fn do_request() -> reqwest::Result<Resp> {
let url = format!(... | Rust | 0 |
_weight_loss*loss_dec
loss_loc = loss_total
PTrue = preds["keyword_prob"]
PFalseTrue = torch.cat((PTrue.add(-1).mul(-1),PTrue),1)
prec1 = module_met.accuracy(PFalseTrue.data, target, topk=(1,))[0]
PR = module_met.PrecRec(PFalseTrue.data, target, topk=(1,))
... | Python | 1 |
level("j4rs", LevelFilter::Warn)
.init();
}
fn generic_submission(clone: &str, zip: &str) -> (TempDir, PathBuf) {
let temp = tempfile::tempdir().unwrap();
let output_archive = temp.path().join("output.tar");
assert!(!output_archive.exists());
let mut tmc_params = Tm... | Rust | 0 |
_NO_LONGER_PRESENT: ONEX_REASON_CODE = 327686i32;
#[doc = "*Required features: 'Win32_NetworkManagement_WiFi'*"]
pub const ONEX_NO_RESPONSE_TO_IDENTITY: ONEX_REASON_CODE = 327687i32;
#[doc = "*Required features: 'Win32_NetworkManagement_WiFi'*"]
pub const ONEX_PROFILE_VERSION_NOT_SUPPORTED: ONEX_REASON_CODE = 327688i32... | Rust | 0 |
ing),
/// Frontend/backend channel error.
#[error("Frontend/backend channel error: {0}")]
Internal(#[from] futures_channel::mpsc::SendError),
/// Invalid response,
#[error("Invalid response: {0}")]
InvalidResponse(Mismatch<String>),
/// The background task has been terminated.
#[error("The background task been ... | Rust | 0 |
bYumHGOO+4xwzXNkeoDia8dtv5Q7SS6RlfWmDlCmJvoxvZ41IQ+rI8YABr8t6Ds9SXJJTLnV97rVBBtJDkKMxJFLsZe55INMkks0v3LlSm+ySc42yUVwbU+eAWLNbBvx5Lkk5sCZ8nQ+EfD+PSMOK7dq1Srb/UxYX5JBeoc5bA/bydeaATHiQYIvhltLE+YSsyMaBRf9aOEST2H4V6IdE10vex1InktyBaZTmfYWO5xkUVmSUDWcQJVayXOJXq5fv16MfsT8rcoYXBl7MwC3cuvWrZ78NWvWWPqiGRlCKrgkKnPdunX2JtpJ1poBQOnt... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 23:44:18 2024
@author: awei
lightgbm_train_class
"""
import os
import argparse
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report, fbeta_score, confusion_matrix
#import lightg... | Python | 1 |
#[test]
fn libc_dependency() {
let _l = lock();
let td = TempDir::new().unwrap();
let lock = td.path().join("Cargo.lock");
let registry = td.path().join("registry");
fs::create_dir(td.path().join("src")).unwrap();
File::create(&td.path().join("Cargo.toml")).unwrap().write_all(br#"
[pac... | Rust | 0 |
obtained before
pub fn obtained_at(&self) -> &Option<DateTime<FixedOffset>> {
&self.obtained_at
}
}
/// Timezone offset type wrapper for [`i32`]
///
/// Initialization requires for offset to be in range of `(-86399..86400)`
#[derive(Serialize, Deserialize, Debug, Copy, Clone)]
pub struct Offset(i32);
... | Rust | 0 |
transforms.Normalize(mean=img_mean, std=img_std)]
# else:
# norm = [
# transforms.ToTensor(),
# transforms.Normalize(mean=img_mean, std=img_std)]
# if residual:
# norm.insert(0, NoiseResidual())
# preprocess = {
# 'train': [prep, pertubation... | Python | 1 |
from pep600_compliance.images import base, package_manager
class Slackware(base.Base):
def __init__(self, image, eol, pkg_manager, packages, python="python"):
_, version = image.split(":")
self._packages = packages
super().__init__(
image, "slackware", version, eol, pkg_manager... | Python | 1 |
import stretch_show_tablet
print(dir(stretch_show_tablet))
| Python | 1 |
"""Dataset setting and data loader for MNIST."""
import torch
from torchvision import datasets, transforms
import os
def get_mnist(dataset_root, batch_size, train):
"""Get MNIST datasets loader."""
# image pre-processing
pre_process = transforms.Compose([transforms.Resize(32), # different img size settin... | Python | 1 |
try:
level_before = response.css('div.PCD_person_info a.W_icon_level span::text').extract_first()
sina_level = int(re.compile(r'Lv.(\d+)').findall(str(level_before))[0])
except Exception as e:
print('-------错误如下:', e)
... | Python | 1 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that ios app bundles are built correctly.
"""
import TestGyp
import TestMac
import os.path
import sys
# Xcode supports for a... | Python | 1 |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we a... | Python | 1 |
Make remaining lifetime < 2 hrs.
assert_eq!(run_for(&mut ctx, Duration::from_secs(1000)), 0);
// If the remaining lifetime is <= 2 hrs & valid lifetime is less than that, don't update
// valid lifetime
inner_test(&mut ctx, device, src_ip, dst_ip, subnet, expected_addr_sub, 1000, 2000, 6... | Rust | 0 |
: data_tmpl['resseq'],
'icode': data_tmpl['icode'],
# Generated
'aa': aa,
'mask_heavyatom': mask_ha,
'pos_heavyatom': pos_ha,
}, path=save_path)
# save_pdb({
# 'chain_n... | Python | 1 |
gtind = np.argmax(ols_gts)
ol_gt = np.amax(ols_gts)
else:
ol_gt = 0
# found gt?
if ol_gt > 0.25:
# get gt values
gt_x3d = gts_cen[... | Python | 1 |
el(x):
row, col = x.shape
sort = np.argsort(-x)
for i in range(row):
x[i, sort[i, 0: 7]] = 1
x[i, sort[i, 7:]] = 0
return x
def fastdecode(x):
results = ""
for i, one in enumerate(x[0]):
if one == 1:
results += chars[i]
return results
out_true = fastdec... | Python | 1 |
ruct Init {
#[structopt(possible_values = &Shell::variants(), case_insensitive = true)]
shell: Shell,
/// Renames the 'z' command and corresponding aliases
#[structopt(long, alias = "z-cmd", default_value = "z")]
cmd: String,
/// Prevents zoxide from defining any commands other than 'z'
#[... | Rust | 0 |
n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information... | Rust | 0 |
import os
class Save_Handle(object):
"""handle the number of """
def __init__(self, max_num):
self.save_list = []
self.max_num = max_num
def append(self, save_path):
if len(self.save_list) < self.max_num:
self.save_list.append(save_path)
else:
remov... | Python | 1 |
executables.push(name);
}
}
if let Some(name) = item.path().file_stem() {
let name = name.to_string_lossy();
let na... | Rust | 0 |
import sys
from ParetoLib.Search.ResultSet import ResultSet
from ParetoLib.Search.Search import create_3D_space
# python example_clipping_resultset.py sample_resultset.zip
rs = ResultSet()
rs_file_name = sys.argv[1]
rs.from_file(rs_file_name)
# Change clip_box to clip using the box and display
clip_box = create_3D_sp... | Python | 1 |
if model_class == ConvBertForMultipleChoice:
return
config.torchscript = True
model = model_class(config=config)
inputs_dict = self._prepare_for_class(inputs_dict, model_class)
traced_model = torch.jit.trace(
model, (inputs_d... | Python | 1 |
input_1 = input("Digite um valor: ")
print(input_1)
| Python | 1 |
# Copyright 2024 D-Wave 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 ... | Python | 1 |
class Solution:
def beautifulSubarrays(self, nums: List[int]) -> int:
# A subarray is beautiful if xor(subarray) = 0.
ans = 0
prefix = 0
prefixCount = collections.Counter({0: 1})
for num in nums:
prefix ^= num
ans += prefixCount[prefix]
prefixCount[prefix] += 1
return ans
| Python | 1 |
::Rel(_) => Relation::try_from(e).map(|r| Expr::Rel(Box::new(r))),
ast::Expr::Uri(_) => Uri::try_from(e).map(Expr::Uri),
ast::Expr::Array(_) => Array::try_from(e).map(|a| Expr::Array(Box::new(a))),
ast::Expr::Object(_) => Object::try_from(e).map(Expr::Object),
ast::Expr::... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
日志模块 - 简化的日志系统
"""
import os
import logging
from datetime import datetime
from typing import Optional
from PyQt5.QtCore import QObject, pyqtSignal
from .config import Config
class GuiLogHandler(logging.Handler):
"""GUI日志处理器"""
def __init__(self, signal_e... | Python | 1 |
(FRegister::EMPTY, 0x1F),
(FRegister::HALFCARRY, 0x20),
(FRegister::ZERO | FRegister::HALFCARRY, 0),
]
);
}
#[test]
fn dec() {
let code = vec![
0x21, 0x55, 0xAA, // LD HL, $AA55
0x3E, 0x21, // LD A, $21
0x3D, // DEC A
0x77, // LD (HL), A
... | Rust | 0 |
let sig = pk.sign_hash::<EthereumBasicSignature>(self.hash())?;
Ok(self.encode_signed(&sig))
}
fn encode_into(&self, rlp: &mut RlpStream, empty_sig: bool) {
rlp.begin_unbounded_list();
rlp.append(&self.nonce);
rlp.append(&trim_bytes(&self.gas_price.to_bytes_be()));
r... | Rust | 0 |
4, "Perl"),
(p5, "PythonPython"),
(p6, "a5,b7,c9,"),
(p7, "a5,b7,c9,"),
(p8, "Python"),
(p9, "Python"),
(p10, "Python"),
(p11, "Python"),
];
b.iter(move || {
for (p, s) in &tests {
let mut state = p.state(s.clone(), 0..usize::MAX);
... | Rust | 0 |
import asyncio
from typing import Sequence
from absl import app, flags
from xai_sdk import AsyncClient
from xai_sdk.chat import ReasoningEffort, user
STREAM = flags.DEFINE_bool("stream", False, "Whether streaming is enabled.")
REASONING_EFFORT = flags.DEFINE_enum("effort", "low", ["low", "high"], "The effort of the ... | Python | 1 |
use murmurhash3::murmurhash3_x64_128;
// The individual items to store in the BinaryHeap
pub type ItemHash = u64;
#[inline]
pub fn hash_f(item: &[u8], seed: u64) -> ItemHash {
murmurhash3_x64_128(item, seed).0
}
#[derive(Debug, Clone)]
pub(crate) struct HashedItem<T> {
pub(crate) hash: ItemHash,
pub(cra... | Rust | 0 |
cs_values.len(), major_indices.len());
assert_eq!(major_indices.len(), minor_indices.len());
assert_eq!(minor_indices.len(), coo_values.len());
// Count the number of occurrences of each row
for major_idx in major_indices {
major_offsets[*major_idx] += 1;
}
cs::convert_counts_to_offset... | Rust | 0 |
't set self.reached_waypoint = True here, use the per-step 'reached' for reward
# --- 4. Compute Observations, Rewards, Termination ---
# These are called by the parent's post_physics_step *after* the callback.
# We might need to recompute observations if target changed? Let's test.
# ... | Python | 1 |
last_content_hash = content_hash
else:
seed = None
keep_alive_minutes = 1 if keep_1min_in_vram else 0
# host = self.read_host_from_file()
host = ollama_url
def try_generate(host_url):
try:
client = Client(host=host_url)
... | Python | 1 |
'TOKEN_MODEL': None,
'SESSION_LOGIN': False,
'JWT_AUTH_COOKIE': 'auth',
'JWT_AUTH_HTTPONLY': True,
'USER_DETAILS_SERIALIZER': 'account.serializers.UserDetailsSerializer'
}
SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": timedelta(days=1),
}
# Allauth settings
ACCOUNT_ADAPTER = 'account.allauth.AccountAd... | Python | 1 |
b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000").unwrap();
let tx: IoResult<Transaction> = deserialize(hex_tx);
assert!(tx.is_ok());
let realtx = tx.unwrap();
// All th... | Rust | 0 |
("MyValidIdent".to_string())),
);
assert_eq!(
TSIdent::from_str("my_valid_ident"),
Ok(TSIdent("my_valid_ident".to_string())),
);
assert_eq!(
TSIdent::from_str("_my_valid_ident"),
Ok(TSIdent("_my_valid_ident".to_string())),
);
... | Rust | 0 |
-7-9")]
padding: 0,
})
}
<gh_stars>10-100
//! @ Extensions might introduce new command codes; but it's best to use
//! |extension| with a modifier, whenever possible, so that |main_control|
//! stays the same.
//
// @d immediate_code=4 {command modifier for \.{\\immediate}}
/// command modifier for `\immedi... | Rust | 0 |
Login to the SIP server
///
/// Sets ok=true if the OK fixed field is true.
pub fn login(&mut self, params: &ParamSet) -> Result<SipResponse, Error> {
let user = match params.sip_user() {
Some(u) => u,
_ => return Err(Error::MissingParamsError)
};
let pass... | Rust | 0 |
d & (bit!(14, u16) as i16);
clipped | (top_bit << 1)
}extern crate core;
mod comm;
use comm::*;
use pn_dcg_packet::block::BlockPacket;
use pn_dcg_packet::profinet::ProfinetPacket;
use pnet::packet::ethernet::EthernetPacket;
use pnet::packet::Packet;
use pnet::packet::PacketSize;
#[test]
fn test() {
let data ... | Rust | 0 |
import pytest
from dagster import (
DailyPartitionsDefinition,
MultiPartitionsDefinition,
StaticPartitionsDefinition,
)
from dagster_delta import DeltaLakePyarrowIOManager
from dagster_delta.config import LocalConfig
@pytest.fixture
def io_manager(
tmp_path,
) -> DeltaLakePyarrowIOManager:
return... | Python | 1 |
Datum::Null,
Datum::F64(f32::MIN.into()),
Datum::F64(f32::MAX.into()),
];
test_colum_datum(fields, data);
}
#[test]
fn test_column_time() {
let mut ctx = EvalContext::default();
let fields: Vec<FieldType> = vec functions proposed in Niko's
//! [blog](http://smallcultfollowing.com/babysteps/blog/2013/06/11/data-parallelism-in-rust/).
//!
//! # Cargo
//!
//! ``` text
//! # Cargo.toml
//! [dependencies.parallel]
//! git = "https://github.com/japaric/parallel.rs"
//!
//! [dependencies.p... | Rust | 0 |
#!/usr/bin/env python3
"""
Example usage of the Prompt Guessing Game
This shows how to use the game programmatically
"""
from prompt_guessing_game import PromptGuessingGame
import cv2
def run_example():
# You'll need to provide a target image path
target_image_path = "target_image.jpg" # Replace with your im... | Python | 1 |
*other.inner as *const _))
}
}
impl Hash for Src {
fn hash<H>(&self, hasher: &mut H)
where
H: Hasher,
{
(&*self.inner as *const SrcInner).hash(hasher)
}
}
impl fmt::Display for Src {
fn fmt(&self, fmtr: &mut fmt::Formatter) -> fmt::Result {
fmtr.write_str(self.name())
... | Rust | 0 |
rl`: The Manganelo URL to the manga page.
pub async fn add_new_manga(path: Option<PathBuf>, manga_url: &str, verbose: bool) {
match is_url_present(path.clone(),manga_url) {
Ok(is_present) => {
if !is_present {
match find_last_chapter(manga_url, None, &verbose).await {
... | Rust | 0 |
or this MangoGroup
/// 20. `[]` rent_ai - rent sysvar var
/// 21. `[]` dex_signer_key - signer for serum dex
/// 22. `[]` msrm_or_srm_vault_ai - the msrm or srm vault in this MangoGroup. Can be zero key
/// 23+ `[writable]` open_orders_ais - An array of MAX_PAIRS. Only OpenOrders of current market
/... | Rust | 0 |
Get your current affiliate/referral status.
pub struct GetUserAffiliateStatusRequest;
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
/// Check if a referral code is valid.
pub struct GetUserCheckReferralCodeRequest {
#[serde(rename = "referralCode")]
pub referral_code: Option<String>,
}
#[derive(Clon... | Rust | 0 |
) -> "torch.Tensor":
"""
Pads a tensor with pad_length to aligns tensor with sp size.
"""
if pad_length == 0:
return tensor
pad_shape = list(tensor.shape)
pad_shape[dim] = pad_length
pad = torch.full(pad_shape, fill_value=pad_value, dtype=tensor.dtype... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.