text string | label_name string | labels int64 |
|---|---|---|
онструктивные дискуссии разрешены\n"
"_❗️ Решайте разногласия в личных сообщениях_\n\n"
"🔞 *5. Запрещён NSFW-контент*\n"
"• Контент 18+, порнография, эротика\n"
"• Жестокость, шок-контент, расчленёнка\n"
"• Обсуждение наркотиков, терроризма, катастроф\n\n"
... | Python | 1 |
import streamlit as st
import pandas as pd
st.set_page_config(page_title="My Portfolio", page_icon=":star:", layout="wide")
main_image = "logo.png"
with st.sidebar:
st.title("Streamfolio")
st.image("logo.png")
selection = st.radio("Navigate to:", ["Home", "Projects", "Skills & Experience", "Contact"], la... | Python | 1 |
"""
TencentBlueKing is pleased to support the open source community by making
蓝鲸智云PaaS平台社区版 (BlueKing PaaSCommunity Edition) available.
Copyright (C) 2017-2018 THL A29 Limited,
a Tencent company. All rights reserved.
Licensed under the MIT License (the "License");
you may not use this file except in compliance with the... | Python | 1 |
ta.is_empty() || data.len() != constants::SCHNORRSIG_PUBLIC_KEY_SIZE {
return Err(Error::InvalidPublicKey);
}
unsafe {
let mut pk = ffi::XOnlyPublicKey::new();
if ffi::secp256k1_xonly_pubkey_parse(
ffi::secp256k1_context_no_precomp,
&m... | Rust | 0 |
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
my_drawing_specs = mp_drawing.DrawingSpec(color=(0, 255, 0), thickness=1)
cap = cv2.VideoCapture(1)
mp_face_mesh = mp.solutions.face_mesh
with mp_face_mesh.FaceMesh(
max_num_faces=1,
... | Python | 1 |
"""Quand on charge l’application users, utilise la classe UsersConfig
(dans apps.py) comme configuration, et pas la configuration par défaut.
"""
default_app_config = 'apps.users.apps.UsersConfig'
| Python | 1 |
f, Client, Result};
use futures::{Stream, TryStreamExt};
use reqwest::Method;
use std::fmt::Debug;
use std::pin::Pin;
use tracing::Instrument;
use url::Url;
fn hmac_keys_url(base_url: Url, project_id: &str) -> Result<Url> {
Ok(base_url
.join("projects/")?
.join(project_id)?
.join("hmacKeys/... | Rust | 0 |
) = &input.dry_run {
scope_1712.boolean(*var_1713);
}
#[allow(unused_mut)]
let mut scope_1714 = writer.prefix("ForceDelete");
if let Some(var_1715) = &input.force_delete {
scope_1714.boolean(*var_1715);
}
#[allow(unused_mut)]
let mut scope_1716 = writer.prefix("InstanceEventW... | Rust | 0 |
self,
stmt_span: Span,
stmt_time: i32,
keyword: &Sp<ast::CondKeyword>,
a: &Sp<ast::Expr>,
binop: &Sp<ast::BinopKind>,
b: &Sp<ast::Expr>,
goto: &ast::StmtGoto,
) -> Result<(), ErrorReported>{
match (classify_expr(a, self.ctx)?, classify_expr(b, self.ct... | Rust | 0 |
rgs.rust:
import sbpg.targets.rust as rs
parsed = [yaml.parse_spec(spec) for spec in file_index.values()]
rs.render_all(output_dir, parsed, release)
elif args.test_c:
test_c.render_check_suites(output_dir, all_specs)
test_c.render_check_main(output_dir, all_specs)
eli... | Python | 1 |
ightly different from the TF version which uses truncated_normal for initialization
# cf https://github.com/pytorch/pytorch/pull/5617
module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
if module.bias is not None:
module.bias.data.zero_()
e... | Python | 1 |
from typing import List
from sqlalchemy import String, Text, SmallInteger, ForeignKey, UUID
from sqlalchemy.orm import relationship, mapped_column, Mapped
from app import settings
from app.models.base import (
BaseORM,
table_name_tenant,
table_name_tenant_default_model,
table_name_pivot_tenant_to_user... | Python | 1 |
"""
varlik ismi tanima: metin (cumle) -> metin icerisinde bulunan varlik isimlerini tanimla
"""
# import libraries
import pandas as pd
import spacy
# spacy modeli ile varlik ismi tanimla
nlp = spacy.load("en_core_web_sm") # spacy kutuphanesi ingilizce dil modeli
content = "Alice works at Amazon and lives in London.... | Python | 1 |
use crate::common::PixelSize;
use crate::style::Color;
mod mat4;
mod shader;
mod texture;
mod vert_array;
pub(crate) use mat4::Mat4;
pub(crate) use shader::{ActiveShaderProgram, ShaderProgram};
pub(crate) use texture::{GlTexture, /*TexFormat, TexRGB,*/ TexRed, TexUnit};
pub(crate) use vert_array::{ElemArr, Element};
... | Rust | 0 |
t_level
indent_level += indent_amount
def pop_indent(indent_amount=4):
global indent_level
indent_level -= indent_amount
def cgen(code, **kwds):
indent = genindent(indent_level)
lines = code.split('\n')
lines = [indent + x for x in lines]
return '\n'.join(lines) % kwds + '\n'
def mcgen(co... | Python | 1 |
aisesRegexp(errors_impl.InvalidArgumentError,
"warp should be at least a matrix"):
sess.run(outputs)
# The batch size of the data and warp tensors must be the same.
with self.cached_session() as sess:
data_shape = (batch_size, data_height, data_width, data_chann... | Python | 1 |
elif value in self.types:
token = Name.Class
#
elif value in self.procedures:
token = Name.Function
#
elif value in self.variables:
token = Name.Variable
#
elif va... | Python | 1 |
profile");
return;
};
let closure_def_id = closure_instance.def_id();
let typeck_results = tcx.typeck(closure_def_id.expect_local());
if typeck_results.closure_size_eval.contains_key(&closure_def_id) {
let param_env = ty::ParamEnv::reveal_all();
let ClosureSizeProfileData { b... | Rust | 0 |
K]);
let a_rsne =
make_rsne(Some(cipher::CCMP_128), vec![cipher::CCMP_128], vec![akm::EAP, akm::PSK]);
let result = is_valid_rsne_subset(&s_rsne, &a_rsne);
assert!(result.is_err());
assert!(format!("{:?}", result.unwrap_err()).contains("negotiated protection is invalid"));
... | Rust | 0 |
#Lesson about while using index
def main():
number_sum = 0
index = 1
while index <= 1000:
number_sum += index
index += 1
print("The sum is:", number_sum)
main () | Python | 1 |
# Copyright 2021 - TODAY, Marcel Savegnago <marcel.savegnago@escodoo.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class StockPicking(models.Model):
_inherit = "stock.picking"
tms_vehicle_ids = fields.One2many("fleet.vehicle", "stock_picking_id"... | Python | 1 |
(np.int32)
np_golden = np_A.copy()
mod(np_A)
np.testing.assert_allclose(np_A, np_golden, rtol=1e-4, atol=1e-4)
def test_meta_for():
N = 8
def top(A: int32[N]):
with allo.meta_for(0, N) as i:
A[i] = A[i] + 1
with allo.meta_for(N) as i:
A[i] = A[i] - 1
... | Python | 1 |
tegrationTest(unittest.TestCase):
@slow
def test_inference_image_segmentation_ade(self):
# only resize + normalize
feature_extractor = SegformerFeatureExtractor(
image_scale=(512, 512), keep_ratio=False, align=False, do_random_crop=False
)
model = SegformerForSemantic... | Python | 1 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# phylogeny.py
# compara
#
# Created by Haibao Tang on 05/21/20
# Copyright © 2020 Haibao Tang. All rights reserved.
#
import csv
import os.path as op
import sys
from ..apps.base import ActionDispatcher, OptionParser, logger, mkdir
from ..formats.fasta import Fasta, SeqI... | Python | 1 |
lse None,
run_name=wandb_run_name if use_wandb else None,
),
data_collator=transformers.DataCollatorForSeq2Seq(
tokenizer, pad_to_multiple_of=8, return_tensors="pt", padding=True
),
)
model.config.use_cache = False
old_state_dict = model.state_dict
model.... | Python | 1 |
# 3) 推送文档
if docs:
with status("[index] 推送文档到 Meili …", spinner="dots"):
idx.add_documents(docs)
idx.update_searchable_attributes(["title","title_zh","text","context_zh","key_points","key_points_zh","tags"])
idx.update_filterable_attributes(["projects"... | Python | 1 |
# The socket API is an application-level network protocol,
# via file transfer protocol (FTP) and hyper transfer protocol
import sys
import socket
# The import of time is useful in order to define how much time has passed
import time
#this function takes note of what time it is currently, this is useful later
startTi... | Python | 1 |
:
self.nodes[2].createwallet("wallet{}".format(i))
wrpc = self.nodes[2].get_wallet_rpc("wallet{}".format(i))
for key in signer['privkeys']:
wrpc.importprivkey(key)
signed_tx = wrpc.walletprocesspsbt(signer['psbt'])['psbt']
assert_equal(signed_t... | Python | 1 |
import uuid
from typing import TypedDict
from sqlalchemy import sql
import acoustid.tables as schema
from .db import FingerprintDB
class TrackInfo(TypedDict):
gid: uuid.UUID
disabled: bool
async def list_tracks_by_mbid(
db: FingerprintDB, mbid: uuid.UUID, include_disabled: bool = False
) -> list[Trac... | Python | 1 |
error(StyleParseErrorKind::UnexpectedToken(token.clone()))),
};
let url =
BrowserUrl::parse(&value).map_err(|_err| input.new_custom_error(StyleParseErrorKind::UnspecifiedError))?;
Ok(CssUrl {
original: std::format!(
"{}(\"{}\"{})",
name,
value,
if modifiers.len() > 0 {
std::format!(
... | Rust | 0 |
from queue import PriorityQueue
# Define the city map
city_map = [
['x', 'x', 'x', 3, 'x', 'x', 16, 'x', 2, 16, 3],
[8, 'x', 8, 5, 'x', 'x', 10, 'x', 19, 4, 'x'],
['x', 'x', 18, 1, 16, 'x', 9, 15, 'x', 'x', 11],
['x', 'x', 17, 16, 4, 19, 2, 'x', 1, 11, 'x'],
[9, 'x', 5, 16, 18, 'x', 'x', 7, 'x', 1... | Python | 1 |
burnthrough_range = countermeasures.burn_through_range_escort(**kwargs)
# Clear the axes for the updated plot
self.axes1.clear()
# Display the results
self.axes1.plot(jammer_erp_vector, burnthrough_range, '')
# Set the plot title and labels
self.axes1.set_title('... | Python | 1 |
expr),
Switch(Box<Node>, Box<Node>, Vec<Node>), // Switch(cond, body, case_conds),
Case(Box<Node>, Box<Node>), // Case(val, body),
ArrIni(Vec<(Node, Node)>), // ArrIni(arrini),
NULL, // NULL,
}
#[deri... | Rust | 0 |
import pygame
import pygame.gfxdraw
from physics import PhysicsObject
from ui_system import UI
# Width of the simulator window
WIDTH = 1280
# Height of the simulator window
HEIGHT = 720
# Pygame initalization and setup of the screen
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
clock = pygame.time.... | Python | 1 |
p>This is the <i>Lambda API Reference</i>. The Lambda Developer Guide provides additional
//! information. For the service overview, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">What is
//! Lambda</a>, and for information about how the service works, see <a href="https://docs.aws.amazon.com/l... | Rust | 0 |
:validator::{validator_cmd_parse, ValidatorCommand};
use crate::wallet::{wallet_cmd_parse, WalletCommand};
use crate::wasm::{wasm_cmd_parse, WasmCommand};
use terra_rust_api::core_types::Coin;
use terra_rust_api::{GasOptions, Terra};
use terra_rust_wallet::Wallet;
/// VERSION number of package
///
pub const VERSION: O... | Rust | 0 |
// select source parser based on arguments
let parser_type = config.value_of("PARSER").unwrap_or("XCOV");
let parser = parsers::Parser::new(parser_type, input);
// run
codacy::report( &parser.unwrap(),
config.value_of("PREFIX").unwrap_or(""),
config.value_of("OUTPUT... | Rust | 0 |
, ..
}) => panic!("Core::parse_field should not be called on unit"),
Data::Struct(Fields { ref mut fields, .. }) => {
fields.push(f);
Ok(())
}
Data::Enum(_) => panic!("Core::parse_field should never be called for an enum"),
}
}
... | Rust | 0 |
# Zilog motion detector UART control
# See http://www.zilog.com/docs/ps0305.pdf
import serial
ACK = 0x06
NACK = 0x15
def check_response(ser: serial.Serial):
rsp = ser.read(1)
if rsp[0] == NACK:
raise ValueError("Received NACK")
elif rsp[0] != ACK:
raise SystemError(f"Unexpected response: ... | Python | 1 |
3,
left: None,
right: None,
}))),
}))),
}))), true),
(Some(Rc::new(RefCell::new(TreeNode{
val: 1,
left: Some(Rc::new(RefCell::new(TreeNode{
val: 2,
... | Rust | 0 |
_connections(&self, filenames: Vec<&str>) -> Result<(bool, Vec<String>), dbus::Error> {
self.method_call(
"org.freedesktop.NetworkManager.Settings",
"LoadConnections",
(filenames,),
)
}
fn reload_connections(&self) -> Result<bool, dbus::Error> {
self.... | Rust | 0 |
],
identified_contracts: &BTreeMap<H160, (String, Abi)>,
) {
let report_for_all = self.report_for.is_empty() || self.report_for.iter().any(|s| s == "*");
traces.iter().for_each(|trace| {
self.analyze_trace(trace, identified_contracts, report_for_all);
});
}
fn an... | Rust | 0 |
recipient
recipients = [r.strip() for r in request.POST.getlist("recipients") if r.strip()]
sender_account_id = request.POST.get("sender_email")
# Basic validation / helpful errors
if not user_accounts.exists():
context["error"] = "You have no email accounts configured."
... | Python | 1 |
in there,
// so optimistically pretend that we have that extra pixel!
let rows = ((height as usize + 1) / dims.cell_height) as u16;
let cols = ((width as usize + 1) / dims.cell_width) as u16;
let tabs = self.get_tabs();
for tab in tabs.iter() {
... | Rust | 0 |
Keysym(XKB_KEY_Execute);
pub const Insert: Keysym = Keysym(XKB_KEY_Insert);
pub const Undo: Keysym = Keysym(XKB_KEY_Undo);
pub const Redo: Keysym = Keysym(XKB_KEY_Redo);
pub const Menu: Keysym = Keysym(XKB_KEY_Menu);
pub const Find: Keysym = Keysym(XKB_KEY_Find);
pub const Cancel: Keysym = Keysym(XKB_KEY_Cancel);
pub c... | Rust | 0 |
pty() || !metadatas.contains_key("ring_id") || !metadatas.contains_key("username") {
warn!("Remove task {} with id {} because no parameters were specified", module.name, task.id);
let _ = Database::rm_task(&task.id);
return;
}
let device = Database::get_device(&metad... | Rust | 0 |
#!/usr/bin/env python
import re
import argparse
pattern = r'^([\w\.]+) +(0x[0-9a-fA-F]+) +(0x[0-9a-fA-F]+)'
def parse_map_file(map_file_path):
components = []
mmap = False
flash_start = 0
with open(map_file_path, 'r') as map_file:
current_component = None
for line in map_file:
... | Python | 1 |
},
}
}
}
#[async_trait]
impl CommandTrait for IssueCommand {
fn setting(&self) -> &CommandSetting {
&self.setting
}
}
enum IssueLabelUpdateType {
Add,
Remove,
}
async fn create_issues_info_to_update(
repo_component: &(dyn IssueComponentTrait + Send + Sync),
query: &str,
... | Rust | 0 |
S **S
!a Sl 6:H FOOCO$D EB!b ! !J z!$$J BG GR g
( v~&&-4 3Qn QD *F[D [& |