text string | label_name string | labels int64 |
|---|---|---|
}
}
<filename>781_num_rabbits/num_rabbits.rs
/*
* @Date: 2021-04-04 19:46:46
* @Author: <NAME>
* @LastEditors: <NAME>
* @LastEditTime: 2021-04-04 19:51:09
*/
fn num_rabbits(answers: Vec<i32>) -> i32 {
let mut map: std::collections::HashMap<i32, i32> = std::collections::HashMap::new();
for i in answer... | Rust | 0 |
doc = "HOST_PIPE Pipe Interrupt Flag Set"]
pub mod pintenset;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm_std::Binary;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub owner: String,
pub admin_claim_period: u64,
}
#[derive(... | Rust | 0 |
"""
Count the number of LIS
-> Keep a count array to keep track of the counts.
cnt[i]: Stores the count that can be achieved at i
dp[i] : Stores the length of LIS that can be achieved at i.
If we are updating the dp table, then cnt remains same but if
we are satisfying the LIS condition but the dp table is not increas... | Python | 1 |
ovided URI are deleted.
unsafe fn delete_cookies(
&self,
/* in */ name: LPCWSTR,
/* in */ uri: LPCWSTR,
) -> HRESULT;
/// Deletes cookies with matching name and domain/path pair.
/// Cookie name is required.
/// If domain is specified, deletes only cookies with the exact dom... | Rust | 0 |
my_list = [42, 69, 322, 13, 0, 99, -5, 9, 8, 7, -6, 5]
index = 0
while index < len(my_list):
if my_list[index] < 0:
break
if my_list[index] > 0:
print(my_list[index])
index += 1
| Python | 1 |
assert constant_size % (n * k) == 0
storage_size = constant_size // (n * k)
return [storage, storage_size]
elif scope == "nvcuda::wmma::accumulator":
storage = "nvcuda::wmma::fragment<" + scope + ", " + storage_shape + ", " + dtype + ">"
assert constant_size % (m ... | Python | 1 |
1.00 = V - 0.81(V-R) + 0.13
# r for V-R > 1.00 = V - 0.84(V-R) + 0.13
# u-g = 1.33(U-B) + 1.12
# g-r = 0.98(B-V) - 0.19
# r-i for R-I < 1.15 = 1.00(R-I) - 0.21
# r-i for R-I > 1.15 = 1.42(R-I) - 0.69
# r-z for R-I < 1.65 = 1.65(R-I) - 0.38
# r-z for R-I > 1.65 = 2.64(R-I) - 2.16
####################
## ugriz -> U... | Python | 1 |
ss.run(tf_compat.v1.global_variables_initializer())
got_logits = sess.run(built_ensemble.logits)
if add_mean_last_layer_predictions:
got_predictions = sess.run(built_ensemble.predictions)
logits = sess.run([s.logits for s in subnetworks])
last_layer = sess.run([s.last_layer f... | Python | 1 |
\u{93c}\u{94d}ल\u{948}श वाला क\u{948}मरा",
"वीडियो",
],
},
#[cfg(feature = "hr")]
crate::Annotation {
lang: "hr",
tts: Some("fotoaparat s bljeskalicom"),
keywords: &[
"bljeskalica",
"fotoaparat",
... | Rust | 0 |
from numba.testing import load_testsuite
import os
def load_tests(loader, tests, pattern):
return load_testsuite(loader, os.path.dirname(__file__))
| Python | 1 |
2008)
X = [.2,.2,.2,.2,.2]
Y = [.322,.072,.511,.091,.004]
for i in X:
print(shannoninfo(i))
for i in Y:
print(shannoninfo(i))
print(shannonentropy(X))
print(shannonentropy(Y))
p = [1e-5,1e-4,.001,.01,.1,.15,.2,.25,.3,.35,.4,.45,.5]
plt.subplot(111)
plt.ylabel("Inf... | Python | 1 |
import numpy as np
from typing import Tuple, Union
from xrprimer.utils.log_utils import get_logger, logging
from .smpl_data import SMPLData
from .smplx_data import SMPLXData
from .smplxd_data import SMPLXDData
__all__ = ['SMPLData', 'SMPLXData', 'SMPLXDData']
_SMPL_DATA_CLASS_DICT = dict(
SMPLData=SMPLData, SMPL... | Python | 1 |
[I32, I32, I32, I32, I32], Some(I32));
pub const SUICIDE: StaticSignature = StaticSignature(&[I32], None);
pub const BLOCK_HASH: StaticSignature = StaticSignature(&[I64, I32], None);
pub const BLOCK_NUMBER: StaticSignature = StaticSignature(&[], Some(I64));
pub const BLOCK_AUTHOR: StaticSignature = StaticSignat... | Rust | 0 |
].level, sentry::Level::Info);
assert_eq!(event.breadcrumbs[0].message, Some("Hello World!".into()));
}
<gh_stars>1-10
use crate::ids::{canister_test_id, node_test_id, subnet_test_id, user_test_id};
use ic_types::crypto::{AlgorithmId, KeyId, KeyPurpose, UserPublicKey};
use ic_types::messages::{Payload, RejectContex... | Rust | 0 |
translatedresponse=translateenaz(response.text,lang)
bot.delete_message(message.chat.id, msg_id)
bot.reply_to(message,f'{flag.flag(lang)} - {translatedresponse}')
os.remove('output.jpg')
except:
try:
translatedresponse=translateenaz... | Python | 1 |
lhs = new_expr(
NodeType::DEREF,
Some(Box::new(t.clone())),
new_binop(
NodeType::ADD,
Some(Box::new(t.clone())),
lhs,
assign(tokens),
),
);
... | Rust | 0 |
lue."]
#[inline(always)]
pub fn thr_zero_en_u3(&mut self) -> THR_ZERO_EN_U3_W {
THR_ZERO_EN_U3_W { w: self }
}
#[doc = "Bit 12 - This is the enable bit for comparing unit3's count with thr_h_lim value."]
#[inline(always)]
pub fn thr_h_lim_en_u3(&mut self) -> THR_H_LIM_EN_U3_W {
T... | Rust | 0 |
include_bytes!("static/fonts/Roboto-Regular.ttf"),
"font/ttf",
);
static_files.add(
"fonts/Roboto-Medium.ttf",
include_bytes!("static/fonts/Roboto-Medium.ttf"),
"font/ttf",
);
static_files
}
fn add(&mut self, name: &'static st... | Rust | 0 |
:idastar(1, 1000);
match moves{
Some(vector) => println!("Moves: {:?}", vector),
None => (),
}
}
<reponame>kuoyehs/WhatSubs
use frame_support::{
decl_module, decl_storage, decl_event, decl_error, ensure, StorageValue, StorageMap,
Parameter, traits::{Randomness, Currency, ExistenceRequirement, ... | Rust | 0 |
/ @generated
// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allo... | Rust | 0 |
::set_metadata("EMBUILD_ESP_IDF_PATH", build_output.esp_idf.try_to_str()?);
build_output.cincl_args.propagate();
if let Some(link_args) = build_output.link_args {
link_args.propagate();
}
Ok(())
}
/// Calculate the mean/average value of a &[<Into<f64> + Copy>].
///
/// Returns a f64 value.
//... | Rust | 0 |
import time,unit_generate,base64
def generate_dict(dict, ramdom_float_num, ua,frist_time,sessionID,apipath,webpath ):
nowtime = int(time.time() * 1000)
dict['d'] = nowtime
dict['e'] = ua
dict['s'] = sessionID
dict['u'] = apipath
dict['c'] = webpath
dict['f']['i_e'] = frist_time
dict['f']... | Python | 1 |
{
type Item = ($($a::Item,)+);
unsafe fn next(&mut self) -> ($($a::Item,)+) {
#![allow(non_snake_case)]
let ($($a,)+) = self;
($($a.next(),)+)
}
}
impl<$($a),+> ArchetypeRefs for ($($a,)+)
where
... | Rust | 0 |
import time
import opcua.ua
from opcua import Client
client = Client("opc.tcp://192.168.0.101:4840") # Initiate
# Connect to Server
client.connect()
node_AuxInit = client.get_node("ns=4;i=9")
node_Marcha = client.get_node("ns=4;i=7")
# ------- Simular arranque de máquina
node_AuxInit.set_value(True)
time.sleep(1)
n... | Python | 1 |
fn reset_value() -> Self::Ux {
0
}
}
<filename>target/release/build/typenum-dad1e3c5e3f02b9b/out/consts.rs
/**
Type aliases for many constants.
This file is generated by typenum's build script.
For unsigned integers, the format is `U` followed by the number. We define aliases for
- Numbers 0 through 102... | Rust | 0 |
import os, pickle
import numpy as np
import matplotlib.pyplot as plt
def write_pkl(path: str, data: list):
# Open the file in binary mode and write the list using pickle
with open(path, 'wb') as f:
pickle.dump(data, f)
# Generate the source and receiver list
# Please note that in Seistorch,
# the coo... | Python | 1 |
self,
uri_path: String,
nonce: u64,
body: &str,
) -> Result<HeaderValue> {
if let Some(credentials) = &self.credentials {
type HmacSha512 = Hmac<Sha512>;
// API-Sign = Message signature using HMAC-SHA512 of (URI path +
// SHA256(nonce + POST data)... | Rust | 0 |
_id` - The ID of the mouse.
///
/// - `NSTDFloat64 x` - The number of pixels the cursor has moved on the x-axis.
///
/// - `NSTDFloat64 y` - The number of pixels the cursor has moved on the y-axis.
pub on_mouse_move: Option<unsafe extern "C" fn(&mut NSTDEventData, NSTDDeviceID, f64, f64)>,
/// C... | Rust | 0 |
# object_creator.py
import tensorflow as tf
import numpy as np
from tensorflow.keras.layers import Input, Dense, Reshape, Flatten
from tensorflow.keras.layers import BatchNormalization, LeakyReLU
from tensorflow.keras.models import Model
class ObjectCreator:
def __init__(self):
self.gan = self.build_gan()
... | Python | 1 |
olumn_stack((zeros, Y, zeros))
axis = [1]
elif nx == 1 and ny == 1:
points = np.column_stack((zeros, zeros, Z))
axis = [2]
elif nx == 1:
points = np.column_stack((zeros, Y, Z))
axis = [1, 2]
elif ny == 1:
points = np.column_stack((X, zeros, Z))
axis = ... | Python | 1 |
}
max_test!(u8, core::u8::MAX);
max_test!(u16, core::u16::MAX);
max_test!(u32, core::u32::MAX);
max_test!(u64, core::u64::MAX);
max_test!(u128, core::u128::MAX);
max_test!(usize, core::usize::MAX);
}
#[test]
fn big() {
new_wire_with_val!(256,... | Rust | 0 |
er: ::std::option::Option<ZypperSettings>,
/// Windows update settings. Use this override the default windows patch rules.
#[prost(message, optional, tag = "7")]
pub windows_update: ::std::option::Option<WindowsUpdateSettings>,
/// The ExecStep to run before the patch update.
#[prost(message, option... | Rust | 0 |
import docker
import json
def to_mounts_string(mounts):
l = []
for m in mounts:
l.append('Type = {}, Source = {}, Target = {}'
.format(m.get('Type'), m.get('Source'), m.get('Target')))
return json.dumps(l, sort_keys=True, indent=4, ensure_ascii=False)
def to_networks_string(nets):
l =... | Python | 1 |
long as the socket is unroutable, attempting to send packets will
/// fail on a per-packet basis. If the socket later becomes routable again,
/// these operations will succeed again.
#[allow(dead_code)]
StayOpen,
/// The socket should close.
///
/// When a call to [`Socket::apply_update`] r... | Rust | 0 |
clone());
paragraph.render(rect.clone(), &mut buffer);
assert_eq!(buffer.content[6].bg, tui::style::Color::Red);
}
#[test]
fn corrected_space_rendered_bg_green() {
let mut text = make_text_model();
text.type_character('I');
text.type_character('x');
... | Rust | 0 |
use dep group
let dep = CellDep::new_builder()
.out_point(tx2_out_point.clone())
.dep_type(DepType::DepGroup.into())
.build();
let tx3 = TransactionBuilder::default()
.cell_dep(dep)
.input(CellInput::new(OutPoint::new(h256!("0x3").pack(), 0), 0))
.output(
... | Rust | 0 |
#!/usr/bin/env python2
# search-gadgets.py
#
# Copyright 2010 Long Le Dinh <longld at vnsecurity.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation... | Python | 1 |
Handle,
) -> Dart_Handle;
}
extern "C" {
pub fn Dart_True() -> Dart_Handle;
}
extern "C" {
pub fn Dart_False() -> Dart_Handle;
}
extern "C" {
pub fn Dart_NewBoolean(value: bool) -> Dart_Handle;
}
extern "C" {
pub fn Dart_BooleanValue(boolean_obj: Dart_Handle, value: *mut bool) -> Dart_Handle;
}
exte... | Rust | 0 |
opt = Some(d.clone());
}
}
}
insert_for_graph(vec)?;
Ok(())
}
/// inserting rows one by one is super slow because of each transaction
/// bulk insert with one transaction is super fast
pub fn insert_for_graph(vec: Vec<DataForGraph>) -> Result<()> {
//println!("insert_for_graph start... | Rust | 0 |
return residues, d, h
def print_params(poles, residues, d, h):
cfmt = "{0.real:g} + {0.imag:g}j"
print("poles: " + ", ".join(cfmt.format(p) for p in poles))
print("residues: " + ", ".join(cfmt.format(r) for r in residues))
print("offset: {:g}".format(d))
print("slope: {:g}".format(h))
def vectfi... | Python | 1 |
println!("cargo:rustc-link-search={}", out_dir.display());
}
<filename>examples/014/main.rs
use noise::{NoiseFn, Perlin};
use std::f32::consts::PI;
use svg::node::element::path::Data;
use svg::node::element::*;
use svg::Document;
fn main() {
let mut paths = Vec::new();
let perlin = Perlin::new();
let... | Rust | 0 |
memory.get_ro_slice(self.memory.var_addr + self.vx, 1)[0];
Ok(10)
}
/// fx18
fn inst_set_sound(&mut self) -> Result<usize, io::Error> {
self.tone_timer = self.memory.get_ro_slice(self.memory.var_addr + self.vx, 1)[0];
Ok(10)
}
/// fx1e
fn inst_add_x_to_i(&mut self) -> R... | Rust | 0 |
Lookup>::Source, kitty_id: T::KittyIndex ) -> DispatchResult {
let who = ensure_signed(origin.clone())?;
let owner_id = <T::Lookup as StaticLookup>::lookup(dest.clone())?;
// 1. first check whether kitty is being sold, if not display an Error.
let mut sell_list = SellList::<T>::get(owner_id.clone()) ;
... | Rust | 0 |
ss=10)
if INVERSE:
rootNode.addObject('RequiredPlugin', name='SoftRobots.Inverse')
rootNode.addObject('QPInverseProblemSolver', epsilon=2e-0, maxIterations=2500, tolerance=1e-7,
responseFriction=0.8)
else:
rootNode.addObject('GenericConstraintSolver', maxItera... | Python | 1 |
# Copyright (c) 2010-2022 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Sequence,
String,
Float,
Integer,
Bool,
NoneSet,
)
class WebPublishObject(Serialisable):
tagname = "webPublishingObject"
id = Integer()
div... | Python | 1 |
class A:
"""
A class that does something
Args:
arg1 (int): Arg 1
arg2 (float): Arg 2
"""
def __init__(self, arg1: int, arg2: float) -> None:
"""Initialize the class"""
self.arg1 = arg1
self.arg2 = arg2
class B:
"""
A class that does something
... | Python | 1 |
import json
import tiktoken
from langchain_core.tools import tool
from ..configuracoes.config import API_KEY, DATASET_PATH, TOKENIZER_ENCODING
from openai import OpenAI
client = OpenAI(api_key=API_KEY)
tokenizador = tiktoken.get_encoding(TOKENIZER_ENCODING)
@tool
def salvar_dataset_finetuning(pergunta: str, resposta... | Python | 1 |
# (15) Implemente uma função que recebe o seu peso e altura e retorna seu índice de massa corporal, IMC. A função também deverá emitir a classificação, de acordo com a tabela abaixo:
# IMC|CLASSIFICAÇÃO
# ---|-------------
# MENOR QUE 18,5| MAGREZA
# ENTRE 18,5 E 25,0| NORMAL
# ENTRE 25,0 E 30,0| SOBREPESO
# ENTRE 30,... | Python | 1 |
m a flare tip at a
specified distance according to API 521. A graphical technique
is used to get the noise at 30 m from the tip, and it is then
adjusted for distance.
.. math::
L_{30 \text{m}} = L - 10 \log_{10}(0.5 m c^2)
.. math::
L_p = L_{30 \text{m}} - 20 \log_{10}(r/(30 \text{... | Python | 1 |
X"] * self.n_ctx)
self.ctx = nn.Parameter(ctx_vectors)
# meta_net2: (bert_dim → ctx_dim) 변환기
self.meta_net2 = nn.Sequential(OrderedDict([
("linear1", nn.Linear(bert_dim, ctx_dim // 16)),
("relu", nn.ReLU(inplace=True)),
("linear2", nn.Linear(ctx_dim // 16, c... | Python | 1 |
, 4.0], vec![4.0, 5.0, 6.0, 7.0], vec![7.0, 8.0, 9.0, 10.0], vec![10.0, 11.0, 12.0, 13.0]];
let mut r_m2 = &mut m2;
let rr_m2 = &mut r_m2;
assert_eq!(matrix::permanent(rr_m2), 29556.0);
}
#[test]
fn test_perm_c(){
let mut m3: Vec<Vec<f64>> = vec![vec![0.0, 1.0, 2.0, 3.0, 4.0],
... | Rust | 0 |
_checker;
pub mod state;
pub mod config;
<gh_stars>0
// Copyright © 2016-2017 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files ... | Rust | 0 |
available_memory: Option<u64>,
pub disk_caches: Option<u64>,
pub hugetlb_allocations: Option<u64>,
pub hugetlb_failures: Option<u64>,
pub shared_memory: Option<u64>,
pub unevictable_memory: Option<u64>,
}
// BalloonTubeResult are results to BalloonTubeCommand defined above.
#[derive(Serialize, Des... | Rust | 0 |
# Register models
esrgan = DeepEnhancer("esrgan")
model_manager.register_model("esrgan", esrgan)
print("✅ ML Models registered:")
for model in model_manager.list_models():
info = model_manager.get_model_info(model)
print(f" 📋 {model}: {info['type']}... | Python | 1 |
`.
/// A scope is a closure, in which access to a guard is granted.
/// A guard is used to schedule callbacks to run on a scope's success, failure, or exit.
///
/// For more information on how to use the guard, see [`Guard`].
///
/// The scope is required to return a type implementing [`Failure`],
/// to indicate wheth... | Rust | 0 |
uad::new(ex.clone(), ex.clone(), ex.clone(), None);
/// store.insert(&quad)?;
///
/// // quad filter
/// let results: Result<Vec<Quad>,_> = store.quads_for_pattern(None, None, None, None).collect();
/// assert_eq!(vec![quad], results?);
///
/// // SPARQL query
/// if let QueryResults::Solutions(mut solutions) = store.q... | Rust | 0 |
._BillMode = params.get("BillMode")
self._RequestId = params.get("RequestId")
class DescribeBalanceRequest(AbstractModel):
"""DescribeBalance请求参数结构体
"""
def __init__(self):
r"""
:param _AccountType: 账户类型:1-设备接入;2-云存。
:type AccountType: int
"""
self._Accoun... | Python | 1 |
# -*- coding: utf-8 -*-
from providerModules.a4kScrapers import core
show_list = None
Show = core.namedtuple('Show', 'title id')
class sources(core.DefaultSources):
def __init__(self, *args, **kwargs):
super(sources, self).__init__(__name__, *args, **kwargs)
self._feed_url = '/show/%s.rss'
... | Python | 1 |
r: req.identifier,
instance: None,
sub_problems: vec![],
}]
}),
}
}))
}
}
extern "C" {
fn X509v3_get_ext_by_OBJ(
x: *const openssl_sys::stack_st_X509_EXTENSION,
obj: *const openssl_sys::ASN1_... | Rust | 0 |
or_map = {
"MAT 111": "8", # Grey
"MAT 145": "6" # Orange
}
for deadline in deadlines:
course_name = deadline['course_name']
event_name = deadline['name']
event_deadline = deadline['deadline']
try:
start_time = datetime.strptime(event_deadline, '%... | Python | 1 |
redirect_uri={domain}%2Fauth&\
response_type=code&\
scope=identify%20bot%20guilds",
client_id = *secrets.discord().client_id(),
domain = pe::utf8_percent_encode(secrets.web().domain(), pe::NON_ALPHANUMERIC),
),
});
async fn error404(global: web::Data<ht... | Rust | 0 |
class Solution(object):
def reorderList(self, head):
if not head or not head.next:
return
middle = self.find_middle(head)
second_half = middle.next
middle.next = None
second_half = self.reverse_linked_list(second_half)
self.merge_alternatively(head, second... | Python | 1 |
),
250 => (
unsafe {
*(self.must_read(4, true)?.as_slice().as_ptr() as *const u32)
} as usize
),
value => return Err(Error::UnexpectedValue(Type::Variant,... | Rust | 0 |
"reference_answer": "基于用户组权限;自定义装饰器检查权限;基于权限Mixin的类视图控制。",
"analysis": "考察Django权限与安全机制设计能力。"
},
{
"id": "django-005",
"problemSetId": "python-django",
"category": "后端开发",
"title": "Django REST Framework设计API",
"description"... | Python | 1 |
S r SSKJr SSKJrJr SSKJrJrJr SSKJ r J
r
S r\" S5 rS r
S r\S
:X a SSKrSSKJr \R& |