text string | label_name string | labels int64 |
|---|---|---|
n new_opt_ensure(value: Option<Ensure>) -> Self {
Self::OptEnsure(value.map(Box::new))
}
pub(crate) fn new_opt_else(value: Option<Else>) -> Self {
Self::OptElse(value.map(Box::new))
}
pub(crate) fn new_exc_var(value: ExcVar) -> Self {
Self::ExcVar(Box::new(value))
}
pub(c... | Rust | 0 |
", err),
Ok(_) => panic!("Expected failure"),
}
}
#[test]
fn test_result_finish() {
let conn = or_panic!(Connection::connect("postgres://postgres@localhost", &NoSsl));
or_panic!(conn.execute("CREATE TEMPORARY TABLE foo (id BIGINT PRIMARY KEY)", []));
let stmt = or_panic!(conn.prepare("SELECT * ... | Rust | 0 |
# archive-pdf-tools
# Copyright (C) 2020-2021, Internet Archive
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | Python | 1 |
sync::Arc,
};
mod generator;
mod group;
mod multiexp;
mod prover;
// mod singlecore;
mod multicore;
mod source;
mod verifier;
mod wnaf;
pub use self::{generator::*, prover::*, source::*, verifier::*};
#[cfg(test)]
mod test;
#[derive(Debug, Clone)]
pub struct Proof<E: PairingEngine> {
pub a: E::G1Affine,
p... | Rust | 0 |
(1);
//! let data: Option<&[u8]> = row.get(2);
//!
//! println!("found person: {} {} {:?}", id, name, data);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Implementation
//!
//! This crate is a lightweight wrapper over tokio-postgres. The `postgres::Client` is simply a wrapper around a
//! `tokio_postgres::Clien... | Rust | 0 |
b fn is_dcorsel_7(&self) -> bool {
*self == DCORSELR::DCORSEL_7
}
}
#[doc = "Possible values of the field `DCOFTRIM`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DCOFTRIMR {
#[doc = "DCO frequency trim: 0"]
DCOFTRIM_0,
#[doc = "DCO frequency trim: 1"]
DCOFTRIM_1,
#[doc = "DCO freq... | Rust | 0 |
tom attributes for the output array, if
high-level.
Like #ak.argmax, but treating NaN ("not a number") values as missing.
Equivalent to
ak.argmax(ak.nan_to_none(array))
with all other arguments unchanged.
See also #ak.argmax.
"""
# Dispatch
yield (array,)
# Impl... | Python | 1 |
egressor(
feature_columns=all_feature_columns,
hidden_units=[32, 10],
warm_start_from='models/autompg-dnnregressor/',
model_dir='models/autompg-dnnregressor/')
def eval_input_fn(df_test, batch_size=8):
df = df_test.copy()
test_x, test_y = df, df.pop('MPG')
dataset = tf.data.Dataset.from_... | Python | 1 |
"bubble_marble_02": "My_asset/S/BubbleMarble_02.usd",
"bubble_marble_03": "My_asset/S/BubbleMarble_03.usd",
"caster_bearing": "My_asset/S/caster_bearing.usd",
"cheerio_geom": "My_asset/S/Cheerio_geom.usd",
"d20_01": "My_asset/S/D20_01.usd",
... | Python | 1 |
from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.utils.deprecation import MiddlewareMixin
from wagtail.models import Page
from wagtail.views import serve
class BlockDodgyUserAgentMiddleware(MiddlewareMixin):
# Used to test that we're correctly handling responses returned from midd... | Python | 1 |
as f:
sql = f.read()
# with transaction(conn):
conn.executescript(sql)
@pytest.fixture(params=itertools.product(PAGE_SIZES, JOURNAL_MODES))
def get_db(request) -> Tuple[str, sqlite3.Connection]:
# if dbname in os.listdir():
# os.system(f"rm -rf {dbname}*")
conn = sqlite3.connect(dbna... | Python | 1 |
from pydantic import BaseModel
from typing import Optional
class LoraConfig(BaseModel):
r: int = 32
target_modules: str = "all-linear"
use_rslora: bool = True
modules_to_save: list = ["lm_head"]
class DiffusionForcingModelConfig(BaseModel):
num_hidden_layers: int = 2
num_diffusion_iteration... | Python | 1 |
(self) -> &'a mut W {
self.variant(ISO0RXPTR0_A::ISO0RXPTR0_0)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16);
self.w
}
}
#[doc ... | Rust | 0 |
🞛', '瀞', '🕮', '省', '𝈶', 'ꄢ',
'𛱃', '⮍', '𐴴', 'ﮂ', '𐞡', '㍴', '🨯', '؞', '𑶤', 'Ϋ', '↜', '𖬝',
'Ⰰ', '𝗻', '\u{827}', '🤻', 'ꑵ', '𑃛', 'ⴙ', '🌎', '𒉤', '𝚸', '⓳',
'🮦', '𑈮', '༤', 'ڢ', '𘭑', '🥼', '㈋', 'ꌽ', '𐐡', 'ꌿ', '\u{1ab1}',
'𞟶', '𞋩', 'ɂ', 'ܢ', 'ᆥ', '𐔷', '𑫟', '\u{1e136}', '𖦧', 'ᖥ', '⠄',
... | Rust | 0 |
# Copyright 2022 Red Hat, Inc.
# 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... | Python | 1 |
MOpcode::OpAdd => self.handle_binop(ret_node, ops, c_ast::Expr::Add, ast),
MOpcode::OpAnd => self.handle_binop(ret_node, ops, c_ast::Expr::And, ast),
MOpcode::OpDiv => self.handle_binop(ret_node, ops, c_ast::Expr::Div, ast),
MOpcode::OpEq => self.handle_binop(ret_node, ops... | Rust | 0 |
annel in updated_channels.items():
volume = channel['volume'] if not channel['mute'] else 0
muted = channel['mute']
if i < len(volumes): # Make sure we're not exceeding array bounds
# Only update if the volume has changed
if volume != volumes[i] or muted != (volumes[i] =... | Python | 1 |
either the [`Map`](super::Map) is dropped, there are no sensitive reads
/// running on that [`Map`](super::Map) or both [`Map`](super::Map)s share the
/// same incinerator.
pub struct Removed<K, V> {
nnptr: NonNull<(K, V)>,
origin: Weak<Incinerator<Garbage<K, V>>>,
}
impl<K, V> Removed<K, V> {
pub(super) ... | Rust | 0 |
{AgentSchema, MessageSchema},
},
simulation::package::creator::PackageCreators,
};
pub struct Config {
pub agent_schema: Arc<AgentSchema>,
pub message_schema: Arc<MessageSchema>,
pub context_schema: Arc<ContextSchema>,
}
impl Config {
pub fn new_sim(
exp_config: &super::ExperimentConfi... | Rust | 0 |
�
/// assert_eq!(Jaeum::from(choseong), Jaeum::Rieul);
///
/// let jongseong = Jongseong::PieupSios; // ㅄ
/// assert_eq!(Jaeum::from(jongseong), Jaeum::PieupSios);
///
/// let jaeum = Jaeum::SsangSios; // ㅆ
/// assert_eq!(Choseong::try_from(jaeum), Ok(Choseong::SsangSios));
/// assert_eq!(Jongseong::try_from(jaeum), Ok... | Rust | 0 |
self.rcs,
MatchesAll(
ContainsAllIPs([gone_ip, stay_ip]),
HasLength(2)
),
timeout=timeout_default
),
clb_other.wait_for_nodes(
self.rcs,
MatchesAll(
... | Python | 1 |
)
timbre = torch.cat(x.shape[2] * [timbre], 2)
timbre = torch.cat(x.shape[3] * [timbre], 3)
condition = torch.cat([f0, timbre], 1)
x = torch.cat([x, condition], 1)
hiddens = []
for resnet1, resnet2, attn, downsample in self.downs:
x = resnet1(x, ... | Python | 1 |
#
# Copyright (C) 2014-2025 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distri... | Python | 1 |
rgb_key] = np.moveaxis(data[rgb_key], -1, -3).astype(np.float32) / 255.
# Step2: 处理其他数据
for key in raw_data_dict:
if key == rgb_key: # RGB 图像原来就是 Uint 类型
continue
obs_dict[key] = data[key].astype(np.float32)
# Step3: 产生两个机器手之间的相对位姿,没有就不作用
# generate relative pose betwee... | Python | 1 |
self.setDefaultButton(qt.QMessageBox.StandardButton.Yes)
class SettingsDialog(qt.QDialog):
def __init__(self, title):
super(SettingsDialog, self).__init__()
self.setWindowTitle(title)
self.setMinimumHeight(200)
self.setMinimumWidth(400)
layout = qt.QVBoxLa... | Python | 1 |
# Copyright 2021 The Funnel Rocket Maintainers
#
# 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 o... | Python | 1 |
"""
Задача №13. Пользователь вводит число N (1 ≤ N ≤ 10).
Далее построчно N чисел от -50 до 50.
Нужно вывести наибольшее количество идущих подряд положительных чисел.
Input: 6 -> -20 30 -40 50 10 -10
Output: 2
"""
from random import randint
amount_of_days = int(input("Input amount of days: "))
count = 0
max_count ... | Python | 1 |
ygen);
oxygen.retain(|x| {
let ch = x.chars().nth(i).unwrap();
if m[i] == 0 {
ch == '0'
} else {
ch == '1'
}
});
}
if co2.len() > 1 {
let m = most_common_values(&c... | Rust | 0 |
galera = list()
pessoa = dict()
soma = media = 0
while True:
pessoa.clear()
pessoa['nome'] = str(input('Nome: '))
while True:
pessoa['sexo'] = str(input('Sexo: [M/F] ')).upper()[0]
if pessoa['sexo'] in 'MF':
break
print('ERRO! Por favor, Digite apenas M ou F.')
pessoa... | Python | 1 |
<(usize, String)> = self.connection.hgetall(self.session_key())?;
let mut todos: Vec<Todo> = ids_and_payloads
.into_iter()
.map(|(_, payload)| serde_json::from_str(&payload))
.flat_map(|r| r)
.collect();
todos.sort_unstable_by_key(|t| t.id);
Ok(... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import inspect
# -- Path setup ---------------------------------------------------------... | Python | 1 |
)*
}
$(
impl From<$ty> for Any {
fn from(lang: $ty) -> Self {
Self::$ty(lang)
}
}
)*
impl $crate::lang::LangItem<$lang> for Any {
fn format(
&self,
out: &mut $crate::... | Rust | 0 |
import numpy as np
import astropy.io.ascii as ascii
import matplotlib.pyplot as plt
pyout = ascii.read('test.pyout')
idlout = ascii.read('test.idlout')
fig, axarr = plt.subplots(4, 2, figsize=(10, 10))
fig.suptitle("python")
axarr[0,0].plot(pyout['alpha'])
axarr[0,0].set_ylabel('alpha')
axarr[0,1].plot(pyout['beta']... | Python | 1 |
under=101"):
should_fail_under(100.0, 101, 0)
@pytest.mark.parametrize(
"statements, lines, result",
[
({1, 2, 3, 4, 5, 10, 11, 12, 13, 14}, {1, 2, 5, 10, 11, 13, 14}, "1-2, 5-11, 13-14"),
(
[1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 98, 99],
[1, 2, 5, 10, 11, 13, 14, ... | Python | 1 |
tus'] = _SMARTRECORDERSTATUS
DESCRIPTOR.enum_types_by_name['RecordingState'] = _RECORDINGSTATE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
SmartRecorderStatus = _reflection.GeneratedProtocolMessageType('SmartRecorderStatus', (_message.Message,), {
'DESCRIPTOR' : _SMARTRECORDERSTATUS,
'__module__' : 'modules.common_... | Python | 1 |
onse.text, "html.parser")
# Find all anchor tags with the title attribute containing the ride name
ride_name_elements = soup.find_all("a", title=True)
for ride in ride_name_elements:
ride_name = ride.get_text(strip=True)
if ride_name == "Astro Orbitor":
parent_tr = ride.find_p... | Python | 1 |
.lock().init();
GAME.lock().run();
}
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under both the MIT license found in the
* LICENSE-MIT file in the root directory of this source tree and the Apache
* License, Version 2.0 found in the LICENSE-APACHE file in the root dir... | Rust | 0 |
utput();
//! # std::process::Command::new("sudo ip link set up vcan0").output();
//! let interface = RefCell::new(socketcan::CANSocket::open("vcan0").unwrap());
//!
//! let module1 = Module::new(&interface, 1);
//! let module2 = Module::new(&interface, 2);
//!
//! module1.write_command(ROR::new(0, 2... | Rust | 0 |
# Generated by Django 5.1.4 on 2024-12-07 15:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('students', '0016_alter_currentsemester_options_and_more'),
]
operations = [
migrations.AddField(
model_name='studenthistory',
... | Python | 1 |
import lmdb
import numpy as np
import cv2
import json
LMDB_ENVS = dict()
LMDB_HANDLES = dict()
LMDB_FILELISTS = dict()
def get_lmdb_handle(name):
global LMDB_HANDLES, LMDB_FILELISTS
item = LMDB_HANDLES.get(name, None)
if item is None:
env = lmdb.open(name, readonly=True, lock=False, readahead=Fal... | Python | 1 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Protocol
class AgentRole(Protocol):
"""
Contrato mínimo para roles de agentes bajo coordinación.
"""
name: str
async def act(self, context: Dict[str, Any]) -> Dict[str, Any]:
...
async def respond(self... | Python | 1 |
_DSCLKCFG_DSOSCSRCR::SYSCTL_DSCLKCFG_DSOSCSRC_MOSC => 3,
SYSCTL_DSCLKCFG_DSOSCSRCR::SYSCTL_DSCLKCFG_DSOSCSRC_RTC => 4,
SYSCTL_DSCLKCFG_DSOSCSRCR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> SYSCTL_DSC... | Rust | 0 |
SIG_IGNSIGTERMr) r r. r, r# stdinstdoutr r& |