text string | label_name string | labels int64 |
|---|---|---|
# -*- coding: utf-8 -*-
#https://developers.google.com/gmail/api/quickstart/python(参考)
from datetime import datetime
import os
from apiclient.discovery import build
from httplib2 import Http
import oauth2client
from oauth2client import client
from oauth2client import tools
try:
import argparse
flags = argpar... | Python | 1 |
to update host stats
host_ids = db.session.query(
VulnerabilityGeneric.host_id,
VulnerabilityGeneric.service_id
)
by_severity = kwargs.get('by', None) == 'severity'
if by_severity:
for severity in values:
if severity not in Vulnerabili... | Python | 1 |
import os
import math
import re
# clear terminal
def clear():
os.system('cls' if os.name == 'nt' else 'clear')
clear()
# point class
class Point:
def __init__(self, x, y):
self.id = str(x) + '_' + str(y)
self.x = x
self.y = y
def __str__(self):
return f'({self.x}, {sel... | Python | 1 |
import numpy as np
import scipy.optimize
from CoolProp.CoolProp import PropsSI as prop
from data import nodes, blocks
from modules import Node, comp, turb,heat_source,heat_exch,split,mix
from scipy.optimize import root_scalar,root,minimize
global data
data = open("res.txt", "a")
def Sensitivity(inp):
P1 = inp[0]... | Python | 1 |
RDY pin will be set high and it will be kept so until the
//! measurement is read or an appropriate SMBus alert response is sent by
//! the master.
//!
//! ```no_run
//! use linux_embedded_hal::I2cdev;
//! use ads1x1x::{
//! Ads1x1x, SlaveAddr, ComparatorQueue, ComparatorPolarity,
//! ComparatorMode, Comparator... | Rust | 0 |
4:-64, 64:-64]
# GTB[count,:] = M1['labels']
#
# df[count, 0] = count
# df[count, 1] = i
# df[count, 2] = j
#
# count = count + 1
#
#NE = NE/np.max(NE)
#
#img_size = (Npix, Npix)
##img_size = resize_size_Big
#
#N_pixels = img_size
##N_pixels_orgn = origin_size
#
#if K.image_da... | Python | 1 |
!apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1
!pip install pyvirtualdisplay > /dev/null 2>&1
!pip install piglet > /dev/null 2>&1
from tkinter import *
from pyvirtualdisplay import Display
!pip install tkinter
# ***** IMPORTS *****
import tkinter as tk
# ***** VARIABLES *****
# ... | Python | 1 |
ers.
Args:
tag_world_corners (np.ndarray): World coordinates of the tag corners.
tag_image_corners (np.ndarray): Image coordinates of the tag corners.
Returns:
tuple: Camera position and Euler angles.
"""
success, rvec, tvec = cv2.solvePnP(tag_world_... | Python | 1 |
# 3 tanks of oxygen and 3 tanks of hydrogen are good for 8 days, scaling with power output
def lb_to_kg(lb: float) -> float:
"""
Convert pounds to kilograms.
Args:
lb: mass in pounds
Returns:
value in kilograms
"""
return lb * 0.45359237
def power_plant_mass(average_p... | Python | 1 |
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def home():
return render_template("index.html")
@app.route("/login", methods=["POST"])
def receive_data():
name = request.form["username"]
password = request.form["password"]
return f"<h1>Name: {name}, Password:... | Python | 1 |
user_input=input("how many cookies do you have ?")
user_cookies=int(user_input)
cookies_eaten=0
while user_cookies > 0 :
user_cookies=user_cookies - 1
cookies_eaten=cookies_eaten+1
print ("Eating a cookie")
print(cookies_eaten)
print ("I ate all the cookies.")
| Python | 1 |
f.flush()
test_file_path = Path(f.name)
try:
# Should load only valid messages, skipping malformed ones
messages = load_transcript(test_file_path)
# Should have loaded 2 valid messages, skipped 2 malformed ones
assert len(messages) == 2
... | Python | 1 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@Description: 人脸裁剪处理器
@Author: Kermit
@Date: 2024-02-18 15:51:15
"""
import asyncio
import logging
import time
import numpy as np
from event_bus.event_bus_processor import BaseEventBusProcessor
from event_bus.message_body.asd_message_body import AsdMessageBody
from ev... | Python | 1 |
# SPDX-License-Identifier: CC-BY-NC-4.0
# SPDX-FileCopyrightText: © 2022- twinify Developers and their Assignees
import jax.numpy as np
import numpyro.distributions as dist
from numpyro.primitives import sample, plate
from twinify.dpvi.modelling import slice_feature, NAModel
def preprocess(df):
"""
Args:
... | Python | 1 |