text string | label_name string | labels int64 |
|---|---|---|
ype)
with torch.no_grad():
output = self.language_model.generate(inputs_embeds=input_embeddings,
max_new_tokens=512)
output = self.tokenizer.decode(output.detach().cpu().numpy()[0])
return output
if __name__ == '__main__':
pred... | Python | 1 |
, "w") as f:
for meta in self.manifest:
f.write(json.dumps(meta) + "\n")
@staticmethod
def load() -> "PartIndex":
faiss = _lazy_import_faiss()
yaml = _lazy_import_yaml()
if not faiss or not yaml:
logging.warning("Could not load PartIndex due to mi... | Python | 1 |
def duplicate(x, scale, scope='duplicate',
**kwargs):
"""
Our implementation of duplicate-based upsampling module used in PU-Net Paper
"""
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
batch_size, n_points, _, n_channels = x.get_shape().as_list()
grid = gen_grid(np.... | Python | 1 |
number, "type"))]
if var_initial is not None:
program += [(" := ", ()),
(self.ParentGenerator.ComputeValue(var_initial, var_type), (self.TagName, variable_type, var_number, "initial value"))]
program += [(";\n", ())]
var... | Python | 1 |
/// identifier of a rust function. This is where your actual NIF will be implemented.
///
/// The third argument is an `Option<fn(env: &Env, load_info: Term) -> bool>`. If this is
/// `Some`, the function will execute when the NIF is first loaded by the BEAM.
#[macro_export]
#[deprecated(since = "0.22.0", note = "Plea... | Rust | 0 |
#
# The contents of the this file are based on publicly available code, which falls under the MIT license.
# Title: fast_blind_video_consistency
# Project code: https://github.com/phoenix104104/fast_blind_video_consistency
# Copyright (c) 2018 UC Merced Vision and Learning Lab
# License: https://github.com/phoenix104... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. 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 requir... | Python | 1 |
# Copyright (C) 2015-2023 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import types
from rbnics.backends.dolfin.wrapping.compute_theta_for_derivative import compute_theta_for_derivative
from rbnics.utils.decorators import overload
def compute_theta_for_derivat... | Python | 1 |
from enum import Enum
from typing import Dict, Any, List, Optional
from pydantic import BaseModel, Field
class NodeType(str, Enum):
"""
Enum for the different types of nodes that can be used in the graph.
"""
AGENT = "agent"
HTTP_REQUEST = "http_request"
KNOWLEDGE_BASE = "knowledge_base"
... | Python | 1 |
from __future__ import absolute_import
from . import * | Python | 1 |
td: &mut Rtd, nick: &str, chan: &str) {
if !rtd.conf.features.invite {
return;
}
if nick != client.current_nickname() {
return;
}
info!("invited to channel: {}", chan);
client.send_join(chan).unwrap_or_else(|err| {
error!("error joining channel: {}", err);
retur... | Rust | 0 |
fo.
Notes:
Note that file ending of `path` sets the container but not the codec!
The support for different stem writers depends on the specified output
container format (aka. the `path` extension/appendix).
We differentiate between
### Container supports multiple stems (`mp... | Python | 1 |
expected.assert_eq(&error);
}
#[test]
fn id_field_attribute_not_allowed() {
let schema = indoc! {r#"
type A {
field Int @id
}
model B {
id Int @id
a A
}
"#};
let dml = with_header(schema, crate::Provider::Mongo, &["mongoDb"]);
let e... | Rust | 0 |
"""The tests for Netatmo platforms."""
| Python | 1 |
No weights for group:", name)
return
# Here we expect that the vertex group already exist with the proper vertices
# already added, although with 1.0 as weight for all vertices. We will iterate
# over the two parallel arrays constructed in arrange_weights() and pick the
# ve... | Python | 1 |
otobuf::UnknownFields,
cached_size: ::std::cell::Cell<u32>,
}
impl VoteReq {
pub fn new() -> VoteReq {
::std::default::Default::default()
}
pub fn default_instance() -> &'static VoteReq {
static mut instance: ::protobuf::lazy::Lazy<VoteReq> = ::protobuf::lazy::Lazy {
lock: ... | Rust | 0 |
(imbalance, UpdateBalanceOutcome::Updated)
}
}
pub struct RFUELProvider<T>(rstd::marker::PhantomData<T>);
impl<T: Trait> AssetIdProvider for RFUELProvider<T> {
type AssetId = T::AssetId;
fn asset_id() -> Self::AssetId {
protocol::RFUEL.into()
}
}
pub struct LockedRFUELProvider<T>(rstd::mark... | Rust | 0 |
'NED': 'val_NED',
'accuracy': 'val_accuracy'
})
ckpt_path = None if checkpoint_dir is None else os.path.join(checkpoint_dir, 'checkpoint')
trainer: Trainer = hydra.utils.instantiate(config.trainer, enable_progress_bar=False, enable_checkpointing=False,
... | Python | 1 |
_TIME_TYPE_DAYLIGHT: GTimeType = 1;
pub const G_TIME_TYPE_UNIVERSAL: GTimeType = 2;
pub type GTokenType = c_int;
pub const G_TOKEN_EOF: GTokenType = 0;
pub const G_TOKEN_LEFT_PAREN: GTokenType = 40;
pub const G_TOKEN_RIGHT_PAREN: GTokenType = 41;
pub const G_TOKEN_LEFT_CURLY: GTokenType = 123;
pub const G_TOKEN_RIGHT_... | Rust | 0 |
from src.utils.extracttags import extract_tags_from_filename
import pytest
def test_empty_filename():
assert extract_tags_from_filename("", "{tracknumber} - {title}") == {}
def test_match_track_number_and_title():
tags = extract_tags_from_filename("02 - Pais E Filhos", "{tracknumber} - {title}")
assert... | Python | 1 |
# SPDX-FileCopyrightText: 2018-2024 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
class GmpGetAuditsTestMixin:
def test_get_audits_simple(self):
self.gmp.get_audits()
self.connection.send.has_been_called_with(
b'<get_tasks usage_type="audit"/>'
)
def test_g... | Python | 1 |
######################
# (Some) variables
######################
voltage = pybamm.boundary_value(phi_s_p, "right")
# The `variables` dictionary contains all variables that might be useful for
# visualising the solution of the model
self.variables = {
... | Python | 1 |
# CutLeft.py
#
# script for cutting TRS keys
# from start to current time
# for all selected objects in scene
#
# Author Sergey Solohin (Neill3d), mail to: neill.solow@gmail.com
# homepage: http://neill3d.com
from pyfbsdk import *
list = FBModelList()
FBGetSelectedModels(list)
def curveCutLeft(node, time):
c... | Python | 1 |
nLast Updated : '
'2014-03-25T14:24:32Z\nDescription : '
'A Python AUR helper/library.\n'
'Keywords : foo bar\n')
req = pkgbuilder.utils.print_package_info([self.fpkg], True)
self.assertEqual(req, sample)
def test_main(self):
... | Python | 1 |
'''
class Library:
def __init__(self):
self.noBooks = 0
self.books = []
def addBooks(self, book):
self.books.append(book)
self.noBooks = len(self.books)
def showInfo(self):
print(f"The library has {self.noBooks} books. The books are")
for b... | Python | 1 |
y`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcdclncompctrl](dcdclncompctrl) module"]
pub type DCDCLNCOMPCTRL = crate::Reg<u32, _DCDCLNCOMPCTRL>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _DCDCLNCOMPCTRL;
#[doc = "`... | Rust | 0 |
4;
pub const XCHAL_NO_PAGES_MAPPED: i32 = -1;
pub const XTHAL_AR_NONE: u32 = 0;
pub const XTHAL_AR_R: u32 = 4;
pub const XTHAL_AR_RX: u32 = 5;
pub const XTHAL_AR_RW: u32 = 6;
pub const XTHAL_AR_RWX: u32 = 7;
pub const XTHAL_AR_Ww: u32 = 8;
pub const XTHAL_AR_RWrwx: u32 = 9;
pub const XTHAL_AR_RWr: u32 = 10;
pub const X... | Rust | 0 |
am: &'a mut [u8],
io: &'a mut [u8],
vic_registers: &'a mut vic_ii::Registers,
vic_bank_start: u16,
char_rom_enabled: &'a mut bool,
color_ram: &'a mut [u8],
cia1: &'a mut Cia1
}
impl<'a> Mos6510Memory<'a> {
fn new(ram: &'a mut [u8], io: &'a mut [u8], vic_registers: &'a mut vic_ii::Registers,... | Rust | 0 |
import numpy as np
from matplotlib import pyplot as plt
t=np.arange(0,1,0.01)
sin_dict={'w1':[1,2],'w2':[3,2],'w3':[1,6],'w4':[3,6],'w5':[1,5]}
print("choose: {'w1':[1,2],'w2':[3,2],'w3':[1,6],'w4':[3,6],'w5':[1,5]}")
k=input("Enter sinusoidal key to generate:")
if sin_dict[k]:
x=sin_dict[k][0]*np.sin(2*np.pi*s... | Python | 1 |
mark.parametrize("streaming, param_dict", TEST_CASES)
def test_reasoning(
streaming: bool,
param_dict: dict,
):
output = tokenizer.tokenize(param_dict["output"])
# decode everything to tokens
output_tokens: List[str] = [
tokenizer.convert_tokens_to_string([token]) for token in output
]
... | Python | 1 |
.map_err(|_| MjolnirError::InternalClientError)?,
);
}
}
if self.config.measure() {
for overall_result in results {
if let Ok(measurement) = &overall_result {
println!("{}", measurement);
}
... | Rust | 0 |
1, probably.
os.environ["GDK_BACKEND"] = "x11"
_x11_display = None
def get_alt_x11_display():
"""Get (the pointer to) a process-global x11 display instance."""
# Ideally we'd get the real display object used by the backend.
# But this is not always possible. In that case, using an alt display
# ... | Python | 1 |
pace root
if not os.path.isdir('src'):
click.secho("Error: This command must be run from the root of a Genesys workspace.", fg="red")
click.secho("(A 'src' directory was not found.)", fg="yellow")
sys.exit(1)
click.echo(f"Creating new ROS 2 package: {package_name}")
# Interactive p... | Python | 1 |
# -*- coding: utf-8 -*-
# AROSICS - Automated and Robust Open-Source Image Co-Registration Software
#
# Copyright (C) 2017–2025
# - Daniel Scheffler (GFZ Potsdam, daniel.scheffler@gfz.de)
# - GFZ Helmholtz Centre for Geosciences, Potsdam, Germany (https://www.gfz.de/)
#
# This software was developed within the context... | Python | 1 |
doc) clarify the different type of queues and what is accessible from the high-level API
// vs what belongs to core-ll. There doesn't seem to be a "ComputeEncoder" can I submit something
// built with a GraphicsEncoder to a ComputeQueue?
//! # gfx
//!
//! An efficient, low-level, bindless graphics API for Rust.
//!
//... | Rust | 0 |
tin-log.py" in cmd:
return 0
elif "unattended-upgrades" in cmd:
return 3 * self.delay
elif "chzdev" in cmd:
return 0.4 * random.random() * self.delay
else:
return self.delay
async def start(
self,
cmd: List[str],
*,
... | Python | 1 |
"""
Bài 1: Viết chương trình tính cạnh huyền của
một tam giác vuông cho trước.
"""
import math
a = float(input("Nhập giá trị a: "))
b = float(input("Nhập giá trị b: "))
c = math.sqrt(math.pow(a,2)+ math.pow(b,2))
print ("Độ dài cạnh huyền là: ",c)
| Python | 1 |
Some(Protocol::Tlsv10)`.
pub fn min_protocol_version(&mut self, protocol: Option<Protocol>) -> &mut TlsAcceptorBuilder {
self.inner.min_protocol_version(protocol);
self
}
/// Sets the maximum supported protocol version.
///
/// A value of `None` enables support for the newest protoc... | Rust | 0 |
0xD000 ... 0xDFFF => { println!("Internal RAM - Bank 1 - 7 (switchable - CGB only)") },
0xE000 ... 0xFDFF => { println!("Echo RAM - Reserved, Do Not Use") },
0xFE00 ... 0xFE9F => { println!("OAM - Object Attribute Memory") },
0xFEA0 ... 0xFEFF => { println!("Unusable... | Rust | 0 |
ing_sub(self.logical_start.load(Ordering::Relaxed))
as u32,
)
.unwrap(),
)
} else {
None
}
}
}
pub struct BatchTsoProvider<C: PdClient> {
pd_client: Arc<C>,
batch: Arc<RwLock<TsoBatch>>,
batch_mi... | Rust | 0 |
employee_name = input("Enter employee name: ")
employee_salary = float(input("Enter employee salary: "))
performance_rating = float(input("Enter performance rating (1.0 to 5.0): "))
if performance_rating < 1.0 or performance_rating > 5.0:
print("Invalid performance rating! Please enter a value between 1.0 and 5.0.... | Python | 1 |
from rest_framework import serializers
from .models import Product, ProductImage, Category
class ProductImageSerializer(serializers.ModelSerializer):
class Meta:
model = ProductImage
fields = ['image_type', 'image_url']
class ProductSerializer(serializers.ModelSerializer):
images = ProductImage... | Python | 1 |
from heapq import *
#Dijkstra algorithm
class Dijkstra:
def __init__(self):
pass
def convert(self,gridworld):
h=gridworld.height;w=gridworld.width
a=[[0]*w for i in range(h)]
for obstacle in gridworld.obstacles:
a[obstacle[0]][obstacle[1]]=1
return a
d... | Python | 1 |
1_1,
0b_1_0_1,
0b_1_1_1,
];
#[rustfmt::skip]
const SMALL_SEVEN: [u8; 5] = [
0b_1_1_1,
0b_0_0_1,
0b_0_1_1,
0b_0_0_1,
0b_0_0_1,
];
#[rustfmt::skip]
const SMALL_EIGHT: [u8; 5] = [
0b_1_1_1,
0b_1_0_1,
0b_1_1_1,
0b_1_0_1,
0b_1_1_1,
];
#[rustfmt::skip]
const SMALL_NINE: [u8; 5]... | Rust | 0 |
FilterPrepend,
Unset,
Unknown(u32),
}
impl From<u32> for RuleFlags {
fn from(value: u32) -> Self {
use self::RuleFlags::*;
match value {
AUDIT_FILTER_USER => FilterUser,
AUDIT_FILTER_TASK => FilterTask,
AUDIT_FILTER_ENTRY => FilterEntry,
AUDIT... | Rust | 0 |
@property
def hidden_size(self):
return self.emb_dim
| Python | 1 |
import threading
from smb.SMBConnection import SMBConnection, OperationFailure, NotReadyError
# ANSI color code https://ansi.gabebanks.net/ and list ips
green = '\033[32;3m'
yellow = '\033[33;3m'
fail = '\x1b[31;3m'
end = '\033[0m'
def smb_connect(ip, port, thr):
try:
username = 'User'
password =... | Python | 1 |
pub mean : Array1<f32>,
pub precision : Array2<f32>
}
impl InverseSchmear {
///Given a matrix M representing a linear transformation _from_ a space
///of smaller dimension _to_ the dimension of this [`InverseSchmear`],
///yields the [`CompressedInverseSchmear`] representing the quadratic
///fo... | Rust | 0 |
from neomodel import db
from rest_framework import status
from rest_framework.response import Response
class ReadBookSearchDao():
'''ReadBookSearchDao This class handles the search on the db for all the Book nodes that match some criteria.
This class controls how to retrieve all book nodes that match some ... | Python | 1 |
formation about avaliable fields see [pdac_w1_1_40](pdac_w1_1_40) module"]
pub type PDAC_W1_1_40 = crate::Reg<u32, _PDAC_W1_1_40>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _PDAC_W1_1_40;
#[doc = "`read()` method returns [pdac_w1_1_40::R](pdac_w1_1_40::R) reader structure"]
impl crate::Readable for PDAC_W1_1_40 ... | Rust | 0 |
($($k: ident: $t: path);* $(;)?) => {
TsType::TypeLit(TsTypeLit {
members: vec![$(
TsTypeElement {
key: stringify!($k).to_string(),
type_ann: $t,
optional: false,
}
),*],
})
};
}
imp... | Rust | 0 |
else None,
use_checkpoint=use_checkpoint,
pretrained_window_size=pretrained_window_sizes[i_layer],
)
self.layers.append(layer)
self.norm = norm_layer(self.num_features)
self.avgpool = nn.AdaptiveAvgPool1d(1)
self.head = (
nn.Li... | Python | 1 |
nce length.
padding = [0] * (max_seq_length - len(input_ids))
input_ids += padding
input_mask += padding
segment_ids += padding
assert len(input_ids) == max_seq_length
assert len(input_mask) == max_seq_length
assert len(segment_ids) == max_seq_length
lab... | Python | 1 |
@pytest.mark.parametrize(
"n_batch,batch_count,reuse_cache",
[
(64, 15, False),
(64, 1, True),
]
)
def test_return_progresssss(n_batch, batch_count, reuse_cache):
global server
server.n_batch = n_batch
server.n_ctx = 2048
server.n_slots = 1
server.start()
def make_c... | Python | 1 |
l
/// [`ContextualAudioRenderer`]: trait.ContextualAudioRenderer.html
/// [`ContextualEventHandler`]: ./event/trait.ContextualEventHandler.html
/// [`HostCallback`]: ./backend/vst_backend/vst/plugin/struct.HostCallback.html
/// [`HostInterface`]: ./backend/trait.HostInterface.html
/// [`CommonMidiPortMeta`]: ./trait.Co... | Rust | 0 |
# sistema de login e senha
from time import sleep
import os
import getpass
clear = "cls" if os.name == "nt" else "clear"
time = "date"
usuarios ={
"junior":"root123",
"ana":"1234",
"carlos":"admin"
}
while True:
os.system(time)
print("ATENÇÃO ESSE SISTEMA É DE USO EXCLUSIVO DA T.I , TODOS OS ACE... | Python | 1 |
:
rmtree(os.path.join(opt.crop_dir,opt.reference))
if os.path.exists(os.path.join(opt.avi_dir,opt.reference)):
rmtree(os.path.join(opt.avi_dir,opt.reference))
if os.path.exists(os.path.join(opt.frames_dir,opt.reference)):
rmtree(os.path.join(opt.frames_dir,opt.reference))
if os.path.exists(os.path.join(opt.tmp... | Python | 1 |
-> Self {
unsafe { intrinsics::copysignf32(z1, z2) }
}
fn rint(z: Self) -> Self {
unsafe { intrinsics::rintf32(z) }
}
fn nearbyint(z: Self) -> Self {
unsafe { intrinsics::nearbyintf32(z) }
}
}
impl FloatIntrinsics for f64 {
fn copysign(z1: Self, z2: Self) -> Self {
... | Rust | 0 |
}
}
/// Gets the value of the given symbol if defined.
pub fn get(&self, symbol: &str) -> Option<&(Expr, T)> {
self.raw.get(symbol)
}
/// Undefines all symbols, effectively restoring the newly-constructed state.
/// This is meant to support resource reuse, and should not be u... | Rust | 0 |
pha: f32, beta: f32) -> Clarke {
Clarke {
a: 0.0,
b: 0.0,
c: 0.0,
alpha: alpha,
beta: beta,
zero: 0.0,
}
}
#[allow(dead_code)]
pub fn calculate(&mut self) {
self.alpha = ((2.0 / 3.0) * self.a) - ((1.0 / 3.0) * (s... | Rust | 0 |
elif engine == "bing":
search_results = soup.select('.b_algo')[:max_results]
for result in search_results:
title_elem = result.find('h2')
link_elem = title_elem.find('a') if title_elem else None
... | Python | 1 |
Ok(AscBigDecimal {
exp: asc_new(heap, &BigInt::from(-negative_exp))?,
digits: asc_new(heap, &BigInt::from(digits))?,
})
}
}
impl TryFromAscObj<AscBigDecimal> for BigDecimal {
fn try_from_asc_obj<H: AscHeap + ?Sized>(
big_decimal: AscBigDecimal,
heap: &H,
) ->... | Rust | 0 |
gnment, enabled) in self.dynamic_alignments {
raw_el = raw_el.class_signal(<&str>::from(alignment), enabled);
}
(raw_el, style_group)
}
}
pub mod completion;
pub mod goto;
pub mod hover;
mod utils;
use dominator::{Dom, html};
use std::rc::Rc;
use utils::prelude::*;
use super::state::*;
u... | Rust | 0 |
# Copyright 2015 Google 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 applicable law or ... | Python | 1 |
n_page.open() # Mở trang đăng nhập
login_page.enter_username("mngr123456789") # User ID dài
login_page.enter_password("uzunEzY") # Mật khẩu hợp lệ
login_page.click_login() # Nhấn nút đăng nhập
error_message = login_page.get_error_message() # Lấy thông báo lỗi
assert error_me... | Python | 1 |
he public
//! API provide a default, but otherwise the user must provide an `Engine` to use.
//!
//! See [engine::Engine] for more on what engine to choose, or use [engine::DEFAULT_ENGINE] if you
//! just want plain old standard base64 and don't have other requirements.
//!
//! ## Config
//!
//! In addition to an `Alph... | Rust | 0 |
::uwrite!(output, "{}", stuff).unwrap();
output
}
<reponame>leod/catchub<filename>serv/src/http.rs
use std::{future::Future, net::SocketAddr, path::PathBuf, sync::Arc};
use log::{debug, info, warn};
use futures::TryStreamExt;
use tokio::{fs::File, io::AsyncReadExt, stream::StreamExt, sync::oneshot};
use hyper::{... | Rust | 0 |
class Solution:
def wordBreak(self, s: str, wordDict: list) -> list:
def backtrack(start):
if start in memo: # Check if the result for this start index is already memoized
return memo[start] # Return the memoized result
result = [] # Initialize the res... | Python | 1 |
ent to stdout.
";
#[derive(Debug, Deserialize, Default, Clone)]
pub struct Args {
flag_verbose: usize,
flag_quiet: bool,
arg_url: String,
flag_user_agent: Option<String>,
flag_accept_lang: Option<String>,
flag_timeout: Option<u64>,
flag_redirect: Option<u8>,
flag_metadata: bool,
fla... | Rust | 0 |
section
.name()
.map(|name| {
section_name == name
|| (system_section
&& name.starts_with("__")
&& section_name[1..] == name[2..])
})
.unwrap_or(false)
... | Rust | 0 |
execute: op_invalid, skip: skip_none },
OpCode { name: "", display: disp_invalid, execute: op_invalid, skip: skip_none },
OpCode { name: "", display: disp_invalid, execute: op_invalid, skip: skip_none },
... | Rust | 0 |
x1f\x02I\
[p:\x9c=-hr\xb9\x5c\xbfP$\xa5j\xd7\
\x06\x0c\xb7\xd2D\xb0\xe1\x9a\x0dt\x9f\xa4\xb5\xe6!\x5c\
\x15\xcb\xb1\xcb\xc1P\x906\xc1\xaa\x88\xac\x9f6!k\
\xa6f\x05m~V\xb5\x00*C\xf6o\x8f\xd7s\x19\
\x84M\xa3\x85A\xe4A;x\xfe\xac\xd7\xe7}A.\
\x97;/\x10\x0c\xbe\x87\xce\x87\xa7\xb4\x15]n?\xf4\
K:>1\xd6\xd1~\xd3\x92\xcb\xa9\x... | Python | 1 |
oks(cfg.lr_config, optimizer_config,
cfg.checkpoint_config, cfg.log_config,
cfg.get('momentum_config', None))
if distributed:
if isinstance(runner, EpochBasedRunner):
runner.register_hook(DistSamplerSeedHook())
# register... | Python | 1 |
# %%
"""Test suite for logits.py"""
import pytest
import pandas as pd
import numpy as np
from transformer_lens import HookedTransformer
from activation_additions import utils, logits
utils.enable_ipython_reload()
@pytest.fixture(name="model")
def fixture_model() -> HookedTransformer:
"""Test fixture that retu... | Python | 1 |
ato: {:?},
etc: {:?},
etd: {:?},
is_bunkering: {:?},
bunkering_time: {:?},
logs: {},
",
self.name,
self.sender,
self.participant1,
self.participant2,
self.docking_type,
self.eta,
self.etb,
self.ata,
self.eto,
se... | Rust | 0 |
6from dolfin import *
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
import sys
import os
plt.rcParams.update({'font.size': 18})
import warnings
warnings.filterwarnings('ignore')
# Create mesh
mesh = Mesh("data/mesh.xml")
c = MeshFunction("double", mesh, 2)
kar = MeshFunction("double", me... | Python | 1 |
(n: usize, upper: usize) -> bool {
(1..upper).rev().all(|x| n % x == 0)
}<reponame>mina86/luv
/* This file is part of luv crate.
* Copyright (c) 2020 🐝🐝🐝
* Copyright (c) 2021 <NAME> <<EMAIL>>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated d... | Rust | 0 |
K_kana_tu: u32 = 1199;
pub const XK_prolongedsound: u32 = 1200;
pub const XK_kana_A: u32 = 1201;
pub const XK_kana_I: u32 = 1202;
pub const XK_kana_U: u32 = 1203;
pub const XK_kana_E: u32 = 1204;
pub const XK_kana_O: u32 = 1205;
pub const XK_kana_KA: u32 = 1206;
pub const XK_kana_KI: u32 = 1207;
pub const XK_kana_KU: u... | Rust | 0 |
sigma_dash_t] * batch_size, dtype = torch.float) # X4累积sigma参数
x4_alpha_dash_t_ = torch.tensor([x4_alpha_dash_t] * batch_size, dtype = torch.float) # X4累积alpha参数
# ==================== 构建模型输入字典 ====================
# 获取模型所在的设备(CPU或GPU),确保数据在正确设备上
device = mod... | Python | 1 |
# coding=utf-8
from core import HackingTool
from core import HackingToolsCollection
class Cupp(HackingTool):
TITLE = "Cupp - WlCreator is a C program that can create all possibilities of passwords"
DESCRIPTION = "WlCreator is a C program that can create all possibilities of passwords,\n " \
... | Python | 1 |
rams.txg_trim_r2s
);
process_txg(¶ms, &kmers);
}
if params.hic_r1s.len() > 0 {
eprintln!("hic");
process_hic(¶ms, &kmer_type);
}
if params.long_reads.len() > 0 {
eprintln!("longreads");
process_longreads(¶ms, &kmers);
}
if params.fasta ... | Rust | 0 |
fn max() {
assert_eq!(
runner().ok("a {b: desaturate(plum, 100%)}\n"),
"a {\
\n b: #bfbfbf;\
\n}\n"
);
}
#[test]
fn max_remaining() {
assert_eq!(
runner().ok("a {b: desaturate(plum, 48%)}\n"),
"a {\
\n b: #bfbfbf;\
\n}\n"
);
}
#[test]... | Rust | 0 |
/// Gets the underlying FFI pointer, returns a owned pointer.
#[inline]
#[must_use]
fn into_ptr(self) -> *mut ffi::PyObject {
self.into_non_null().as_ptr()
}
}
impl<T> std::convert::From<&'_ T> for PyObject
where
T: AsPyPointer + PyNativeType,
{
fn from(obj: &T) -> Self {
un... | Rust | 0 |
s_empty() && !d2.is_empty() {
(Player2, calc_winner_score(&d2))
} else if !d1.is_empty() && d2.is_empty() {
(Player1, calc_winner_score(&d1))
} else {
unreachable!("No empty deck, something is wrong");
}
}
fn push_cards_to_deck(d1: &mut Deck, d2: &mut Deck, card_p1: Card, card_p2: C... | Rust | 0 |
byte_idx(text, 10));
assert_eq!(3, from_byte_idx(text, 14));
assert_eq!(4, from_byte_idx(text, 15));
assert_eq!(4, from_byte_idx(text, 20));
assert_eq!(5, from_byte_idx(text, 21));
}
#[test]
fn from_byte_idx_03() {
let text = "Here\r\nare\r\nsome\r\nwords";
a... | Rust | 0 |
Ctl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0106,
(
'#0050311030V#054F#2P虽然已经出现裂痕了,\n',
'但是还不到破坏的地步!',
TxtCtl.Enter,
TxtCtl.Clear,
'#0050311031V既然如此,\n',
'只好再制造一次机会了!',
TxtCtl.Enter,
... | Python | 1 |
gs):
context = super().get_context_data(**kwargs)
context['object'].content = context['object'].content.replace('\n', '<br>')
created_at_obj = context['object'].created_at
created_at_hour = created_at_obj.hour if created_at_obj.hour > 9 else '0' + str(created_at_obj.hour)
create... | Python | 1 |
pub static CSS_FONT_FAMILY_CURSIVE: css_font_family_e = 0x3;
pub static CSS_FONT_FAMILY_FANTASY: css_font_family_e = 0x4;
pub static CSS_FONT_FAMILY_MONOSPACE: css_font_family_e = 0x5;
pub type css_quotes_e = c_enum;
pub static CSS_QUOTES_INHERIT: css_quotes_e = 0x0;
/* Consult pointer... | Rust | 0 |
_field(row)?,
});
}
Ok(comments)
}
/// Given a comment table row, return a comment selection.
fn get_selection_field(row: &rusqlite::Row<'_>) -> Result<Option<common::Selection>> {
let selection_fields = [
row.get::<_, Option<i64>>(4)?, // Start line.
row.get::<_, Option<i64>>(5)?, ... | Rust | 0 |
UsbTransaction,
Trb,
Stall,
Resource,
Bandwidth,
NoSlotsAvailable,
InvalidStreamType,
SlotNotEnabled,
EndpointNotEnabled,
ShortPacket,
RingUnderrun,
RingOverrun,
VfEventRingFull,
Parameter,
BandwidthOverrun,
ContextState,
NoPingResponse,
EventRingFull... | Rust | 0 |
#[derive(Clone, Debug)]
pub struct DisallowedMethod {
disallowed: FxHashSet<Vec<Symbol>>,
}
impl DisallowedMethod {
pub fn new(disallowed: &FxHashSet<String>) -> Self {
Self {
disallowed: disallowed
.iter()
.map(|s| s.split("::").map(|seg| Symbol::intern(se... | Rust | 0 |
.unwrap()
.checked_add(12)
.unwrap();
let end = curline.rfind('\"').unwrap();
pid_rslt = &curline[strt..end];
} else if curline.contains("USB_MANUFACTURER=\"") {
let strt = curline
.find("USB_MANUFACTURER=\"")
... | Rust | 0 |
0xfa, 0xd8, 0xa0, 0x50, 0xcc, 0x4c,
0x19, 0xaf, 0xa9, 0x7c, 0x59, 0x04, 0x5a, 0x99, 0xca, 0xc7, 0x82, 0x72, 0x71, 0xcb,
0x41, 0xc6, 0x5e, 0x59, 0x0e, 0x09, 0xda, 0x32, 0x75, 0x60, 0x0c, 0x2f, 0x09, 0xb8,
0x36, 0x77, 0x93, 0xa9, 0xac, 0xa3, 0xdb, 0x71, 0xcc, 0x30, 0xc5, 0x81, 0x79, 0x... | Rust | 0 |
command-line parameters
define(
'mode',
default=None,
help='work mode of Tornado: "debug" or "release"',
type=str
)
define(
'address',
default=None,
help='domain name for monitoring system',
type=str
)
define(
'port',
d... | Python | 1 |
def insert_db_row():
insert_query = """INSERT INTO Vault (URL, USRNAME, PASSWD) VALUES (%s, %s,%s)"""
return insert_query
def delete_db_row():
sql_delete_query = """Delete from Vault where URL = %s"""
return sql_delete_query
def update_db_url():
update_query_url = """UPDATE Vault SET url ... | Python | 1 |
material",
"HRLF" => "Worship, rites & ceremonies",
"HRLF9" => "Prayer",
"HRLK" => "Spirituality & religious experience",
"HRLK2" => "Mysticism",
"HRLM" => "Religious life & practice",
"HRLM3" => "Religious instruction",
"HRLM5" => "Religious counselling",
"HRLM7" => "Religious aspects o... | Rust | 0 |
# Copyright 2009-present MongoDB, 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 wri... | Python | 1 |
[tokio::test]
async fn dns_failed_to_get_client() -> Result<(), Box<dyn Error>> {
let mut message = Message::default();
let mut query = Query::default();
query.set_query_type(RecordType::TXT);
message.queries_mut().push(query);
let message_bytes = message.to_vec().unwrap();
... | Rust | 0 |
d[0].lower()
length = (len(word) + 1) / 2
frequency = 0
quanpinString = word.lower()
candidateType = 2
record = (candidate, shuangpinString, shengmuString, length, frequency, quanpinString, candidateType)
records.append(record)
count += 1
print(str(count) + " records have added into database")
file = io... | Python | 1 |
vice.send_for_signature(
document.content,
document.title,
signature_request.signers
)
# Update document status
document.status = DocumentStatus.PENDING_SIGNATURE
document.docusign_id = envelope_id
document.metadata.update({
"signers": signature_request.signers,
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.