text string | label_name string | labels int64 |
|---|---|---|
import pandas as pd
# full_df = pd.DataFrame(
# [],
# columns=['title', 'description', 'text_lemm', 'genre']
# )
# for film in get_fulls_films():
# full_df.loc[len(df)] = {
# 'title': film[0],
# 'description': film[1],
# 'text_lemm': film[2],
# 'genre': film[3]
# ... | Python | 1 |
Mul {
value_off: i32,
}
impl ModuleMiddleware for Add2MulGen {
fn generate_function_middleware(&self, _: LocalFunctionIndex) -> Box<dyn FunctionMiddleware> {
Box::new(Add2Mul {
value_off: self.value_off,
})
}
}
impl FunctionMiddleware for Add2Mul {
fn feed<'a>(
&mut... | Rust | 0 |
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils.deprecation import RemovedInDjango60Warning
try:
import oracledb
is_oracledb = True
except ImportError as e:
try:
import cx_Oracle as oracledb # NOQA
warnings.warn(
"cx_Oracle is deprec... | Python | 1 |
import datetime
from typing import List
from src.database.model import HouseInfo, get_session
def add_house_info(house_info: HouseInfo):
"""添加房产信息
:param house_info: 房产信息
"""
with get_session() as session:
session.add(house_info)
def query_house_info(**kwargs) -> List[HouseInfo]:
"""ho... | Python | 1 |
82631493,
-0.0036663906648755074,
0.13102592527866364,
-0.010544195771217346,
-0.08078552782535553,
0.03218182548880577,
0.01810539700090885,
0.05525807663798332,
-0.05030102655291557,
-0.0439252071082592,
-0.01785256154835224,
-0.19900473952293396,
0.048614487051963806,
... | Python | 1 |
_mut()
.iter_mut()
.try_for_each(|constraint| match constraint {
&mut Constraint::Eq { lh, rh: Match::Value(ref v) }
if lh.field() == Field::Attribute =>
{
let mut stmt = self.tx.prepare_cached(
r#"
... | Rust | 0 |
"loss": loss,
"mask_bce_loss": mask_bce_loss,
"mask_dice_loss": mask_dice_loss,
"mask_loss": mask_loss,
}
def inference(
self,
images,
images_evf,
input_ids,
resize_list,
original_size... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class SubAccountBaseInfo(object):
def __init__(self):
self._account_no = None
self._out_fin_inst_abbreviation = None
self._sub_account_no = None
@property
def account_n... | Python | 1 |
ect specifications.<br></li>
<li>Enhanced system efficiency by fine-tuning wiring configurations.<br></li>
<li>Ensured hardware outputs aligned seamlessly with software requirements.</li>
</div>
""",
unsafe_allow_html=True,
)
# Christopher Per... | Python | 1 |
if opt.CCD or opt.HF_CCD:
self.set_requires_grad([self.netD_21], False)
self.set_requires_grad([self.netD_12], False)
self.set_requires_grad([self.netG_A_1, self.netG_B_1], True)
self.set_requires_grad([self.netG_A_2, self.netG_B_2], True)
self.optimizer_G_1.zero_grad()
self.optimizer_G_2.zero_g... | Python | 1 |
__copyright__ = """MIT License
Copyright (c) 2024 - IBM Research
Permission is hereby granted, free of charge, to any person obtaining a copy
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,... | Python | 1 |
eshold, grid_step.opencv_as_extern(), interp_type, epic_k, epic_sigma, epic_lambda, ric_sp_size, ric_slic_type, use_post_proc, fgs_lambda, fgs_sigma, use_variational_refinement) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::optflow::DenseRLOFOpticalFlow>::opencv_from_extern(r) } )
}
}
/// "Dual TV L1" Opti... | Rust | 0 |
ttach_level(
&mut self,
level: NonNull<Level<CapabilityEndpointSet, CapabilityTableNode, 512>>,
_leaf: bool,
) {
self.next = Some(level);
}
fn clear_level(&mut self) {
self.next = None;
}
}
#[derive(Clone)]
pub struct CapabilityEndpointSet {
pub endpoints: [... | Rust | 0 |
d and then the `!` method on the result.
#[instrument(name="Basic::!", level="trace", skip(this, args), fields(self=?this, ?args))]
pub fn qs_not<'o>(this: &'o Object, args: Args<'_, 'o>) -> Result<Object> {
this.call_attr_lit(&Literal::AT_BOOL, args)?
.call_attr_lit(&Literal::NOT, &[])
}
/// Get a hash of `t... | Rust | 0 |
elif (
testobj.is_typeclass("world.exploration.loot.Trinket")
or testobj.is_typeclass("world.exploration.loot.AncientWeapon")
or testobj.is_typeclass("world.magic.materials.MagicMaterial")
or testobj.is_typeclass(
"world.dominion... | Python | 1 |
from config import load_config, save_config
from memory import Memory
from voice import init_tts, speak, Listener
from commands import CommandHandler
def greet(engine, config):
name = config.get('user_name', 'User')
speak(f"Hello {name}, how can I help you?", engine)
def main():
config = load_config()
... | Python | 1 |
_match(output, file),
CompareFileResult::FileDiffers { ref file, ref was_hash, ref new_hash } => {
write_file_result_diff(output, file, was_hash, new_hash);
differed_n += 1;
}
}
}
... | Rust | 0 |
&str) -> Span {
Span::new(0, s.len() as u32)
}
/// Combine two spans by taking the start of the earlier span
/// and the end of the later span.
///
/// Note: this will work even if the two spans are disjoint.
/// If this doesn't make sense in your application, you should handle it your... | Rust | 0 |
def forward_decoder(self, masks, is_stft):
# masks: [b, spk, f, t]
# phase: [b, f, t, 2]
if is_stft:
outputs = []
for i in range(masks.shape[1]):
outputs.append(
self.encoder.inverse(masks[:, i, :, :].unsqueeze(-1) * self.phase).un... | Python | 1 |
date
end_date = datetime.now(timezone.utc)
print("Warning: Could not find any recent papers. Using current date as end_date.")
else:
end_date = most_recent_date
print(f"Most recent paper date: {end_date.date()}")
# Calculate start date
start_date = end_date - timedelta(days=... | Python | 1 |
. Any other value: Boot loader backdoor is disabled. NOTE! Boot loader must be enabled (see BOOTLOADER_ENABLE) if boot loader backdoor is enabled."]
#[inline]
pub fn bl_enable(&self) -> BL_ENABLER {
let bits = {
const MASK: u8 = 255;
const OFFSET: u8 = 0;
((self.bits ... | Rust | 0 |
stination Buffer:
let mut vec_dst = vec![0.0f32; proque.dims().to_len()];
let buf_dst = Buffer::new(queue, Some(::MEM_READ_WRITE |
::MEM_COPY_HOST_PTR), proque.dims().clone(), Some(&vec_dst)).unwrap();
// Source origin doesn't matter for this:
let src_origin = [0, 0, 0];
// Lengths of the t... | Rust | 0 |
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
full_header_img = fields.Binary(
string="Full header image",
help="This image will replace all header."... | Python | 1 |
sponse.text}")
results[message_id] = False
except requests.exceptions.RequestException as e:
print(f"🚨 Exceção ao tentar deletar o e-mail {message_id}: {e}")
results[message_id] = False
return results
def format_body(html):
# Converte <a href="URL">texto</a... | Python | 1 |
tings,
console: Console,
) -> str:
reply_chunks: list[str] = []
try:
for chunk in engine.stream_chat(conversation.trimmed_messages(), generation):
clean = _sanitize_chunk(chunk)
if not clean:
continue
console.print(clean, end="", soft_wrap=True)
... | Python | 1 |
rate::theory::{key::Key, piano_key::PianoKey};
use rand::{rngs::SmallRng, seq::SliceRandom, SeedableRng};
pub struct RandomSeed(SmallRng);
impl Default for RandomSeed {
fn default() -> Self {
Self(SmallRng::from_entropy())
}
}
impl MusicSeed for RandomSeed {
fn get_note(&mut self, key: Key) -> Pi... | Rust | 0 |
ult=None, help='Path for the output run.')
parser.add_argument('--override', dest='override', action='store_true', default=False, help='Override \'complete\' H5 file if it already exists.')
args = parser.parse_args()
img_size = args.img_size
z_dim = ... | Python | 1 |
# Parser for C code
# Originally by Mark Shannon (mark@hotpy.org)
# https://gist.github.com/markshannon/db7ab649440b5af765451bb77c7dba34
import re
import sys
import collections
from dataclasses import dataclass
def choice(*opts):
return "|".join("(%s)" % opt for opt in opts)
# Regexes
# Longer operators must go... | Python | 1 |
COLLECT,
SCRIPTURE_RUBRIC,
FIRST_LESSON,
PSALM,
SECOND_LESSON,
GOSPEL,
HOMILY,
THE_MARRIAGE_HEADER,
THE_MARRIAGE,
THE_RINGS,
RINGS_ALREADY_GIVEN,
PRONOUNCEMENT_HEADER,
PRONOUNCEMENT,
THE_PRAYERS_HEADER,
LORDS_PRAYER,
THE_PRAYERS,
BLESSING_OF_THE_MARRIAG... | Rust | 0 |
query_args, doseq=True)
def prefix_slash_in_url_if_missing(url):
if not url.startswith("/"):
return f"/{url}"
else:
return f"/{url.lstrip('/')}"
async def create_poll_callback(ctx, blog, post_id):
async def poll_callable(poll_id, expiration_timestamp):
current_timestamp = round(d... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bizmeka 메일 스크래퍼 - 디버그 버전
- 페이지 구조 분석
- 선택자 찾기
- 스크린샷 저장
"""
import asyncio
import json
from pathlib import Path
from datetime import datetime
from playwright.async_api import async_playwright, Page
from cookie_manager import CookieManager
from utils import load_config,... | Python | 1 |
import pygame
import sys
# Initialize Pygame
pygame.init()
# Screen configuration
WIDTH, HEIGHT = 800, 400
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Ball bouncing simulation")
# Colors
WHITE = (255, 255, 255)
RED = (255, 0, 0)
# Ball Configuration
ball_radius = 10
ball_x = ball_r... | Python | 1 |
s_error(
SysErrorKind::NotOk,
Option::<&str>::None,
)),
_ => unreachable!(),
}
.and_then(TryInto::try_into)
}
}
impl<T: AsLeptonicaPtr> Binarize for T {}
use crate::{ErrorKind, JsonValue, MyResult};
use failure::Fail;
use serde_json;
use std::... | Rust | 0 |
y() should be called.
*/
pub fn start() -> Result<Confomat> {
let args: Vec<String> = std::env::args().collect();
let mut opts = getopts::Options::new();
opts.optopt("d", "", "confomat data directory", "DIRECTORY");
let p = match opts.parse(&args[1..]) {
Ok(p) => p,
Err(e) => {
... | Rust | 0 |
(actual_delay, now);
if self.average_delay_base == 0 {
self.average_delay_base = actual_delay;
}
self.sum_delay_diffs(actual_delay);
// recalculate delays every 5 seconds or so
if now > self.average_sample_time {
... | Rust | 0 |
with_header(content_type)
.with_body(file)
}
None => Response::new().with_status(StatusCode::NotFound),
}
}
// Fallthrough for POST/PUT/CONNECT/...
_ => Response::new().with_status(StatusCode::NotFoun... | Rust | 0 |
None => None,
Some(val) => Some(NativeType::String(val.to_string())),
}),
DateTime => Ok(match self.try_get::<Option<sqlx::types::chrono::NaiveDateTime>, usize>(index)? {
None => None,
Some(val) => Some(NativeType::String(val.to_string())),
... | Rust | 0 |
convert_grouper(axis: Index, grouper):
if isinstance(grouper, dict):
return grouper.get
elif isinstance(grouper, Series):
if grouper.index.equals(axis):
return grouper._values
else:
return grouper.reindex(axis)._values
elif isinstance(grouper, MultiIndex):
... | Python | 1 |
success = True
except subprocess.CalledProcessError as e:
print(f"Failed to send reply to Twitter. Error code: {e.returncode}")
print(f"Error output: {e.stderr}")
print(f"Standard output: {e.stdout}")
if success:
with open('data/processed_twee... | Python | 1 |
import tkinter as tk
from tkinter import filedialog, messagebox
from bs4 import BeautifulSoup
import pandas as pd
from urllib.parse import urljoin
from PIL import Image, ImageTk
def parse_html_file(file_path):
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
soup = BeautifulS... | Python | 1 |
sum()
}
}
#[test]
fn test_closest() {
let coords = Coords::from_str(
r"
1, 1
1, 6
8, 3
3, 4
5, 5
8, 9
",
)
.unwrap();
assert_eq!(coords.closest((0, 0)), Some(Coord::from((1, 1))));
assert_eq!(coords.closest((3, 2)), Some(Coord::from((3, 4))));
assert_eq!(coords.closest((5, 0)),... | Rust | 0 |
"{}.wav",
Utc::now().format(&self.settings.format).to_string()
));
std::fs::write(&filename, w)?;
Ok(Url::from_file_path(filename.canonicalize()?)
.map_err(|_| crate::Error::InternalError)?
.into_string())
}
}
/// 設定の読み込みとかをする奴。
/// リファクタリングしたい.
fn l... | Rust | 0 |
.padding(20)
.border_radius(5),
);
Column::new()
.height(Length::Fill)
.justify_content(Justify::Center)
.padding(20)
.push(content)
.into()
}
}
fn lorem_ipsum() -> Text {
Text::new("Lorem ipsum dolor sit amet,... | Rust | 0 |
mut(handle)))
}
/// Checks if a chunk exists at a coordinate position.
fn chunk_exists<I: ToIndex>(&self, v: I) -> bool {
let index = v.to_index(self.dimensions().x(), self.dimensions().y());
self.get_chunk_handle(index).is_some()
}
/// Sets a single tile at a coordinate position a... | Rust | 0 |
() }
impl Metadata {
pub fn version_template(&self, ver: &str) -> Result<String> {
use tera::{Tera, Context};
let mut ctx = Context::new();
ctx.insert("version", &ver.to_string());
let res = Tera::one_off(&self.gitTagTemplate, &ctx, false).map_err(|e| {
warn!("Failed to ... | Rust | 0 |
al_preds[:, :, :, 2] = ort_output[:, :, points_y.astype(np.int32), points_x.astype(np.int32)]
points_y = points_y * size[0] / (h - 1)
points_x = points_x * size[1] / (w - 1)
final_preds[:, :, :, 0] = points_x
final_preds[:, :, :, 1] = points_y
# draw point
# bchw->chw->hwc
img = img.squeez... | Python | 1 |
hp_deficit=[]
rewards=[]
# 打开文件,'r'表示以只读模式打开
with open('/home/zenu/code/rl_hw/mindspore_ddpg2/eval_log.txt', 'r') as file:
# 使用for循环逐行读取文件内容
is_line_next_reward = False
for line in file:
# 打印每一行
if "At the end," in line:
line_list = line.strip().split()
# print(line_l... | Python | 1 |
t consume_positionalsc s
i is too few argumentss argument %s is requireds# one of the arguments %s is requiredRy ( Rl R/ t _read_args_from_filesR3 R R R R t iterR t _parse_optionalR! R Rw R= R< |