repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
dongmengshi/easylearn | eslearn/utils/regression/lc_sCCA.py | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 19:41:55 2018
Please refer to and cite the follow paper:
{Pyrcca: regularized kernel canonical correlation analysis in
python and its applications to neuroimaging}
@author: lenovo
"""
# search path append
import sys
sys.path.append(r'D:\myCodes\LC_MVPA\Python\MVPA_Python\utils\regression\pyrcca-master\pyrcca-master')
# imports
import rcca,time,multiprocessing
#import pandas as pd
import numpy as np
#from sklearn.externals.joblib import Parallel, delayed
# Initialize number of samples
nSamples = 500
# Define two latent variables (number of samples x 1)
latvar1 = np.random.randn(nSamples,)
latvar2 = np.random.randn(nSamples,)
# Define independent components for each dataset (number of observations x dataset dimensions)
indep1 = np.random.randn(nSamples, 400)
indep2 = np.random.randn(nSamples, 500)
# Create two datasets, with each dimension composed as a sum of 75% one of the latent variables and 25% independent component
#data1 = 0.25*indep1 + 0.75*np.vstack((latvar1, latvar2, latvar1, latvar2)).T
#data2 = 0.25*indep2 + 0.75*np.vstack((latvar1, latvar2, latvar1, latvar2, latvar1)).T
data1 = 0.25*indep1
data2 = 0.25*indep2
# Split each dataset into two halves: training set and test set
train1 = data1[:int(nSamples/2)]
train2 = data2[:int(nSamples/2)]
test1 = data1[int(nSamples/2):]
test2 = data2[int(nSamples/2):]
##
def lc_rcca(datasets,kernelcca =True,reg=0.1,numCC=2,verbose=False):
# datasets contain 2 subsets: X and Y
cca = rcca.CCA(kernelcca =kernelcca, reg =reg, numCC =numCC )
cca.train(datasets)
# calc the correlation between the first cannonical variate
corr_firstVariate=cca.__dict__['cancorrs'][0]
return corr_firstVariate,cca
##
def lc_rcca_CV_1fold(datasets_cv,kernelcca,regs,numCCs):
# cross-validation
# run
# split datasets to train set and test set
# datasets_cv=split_datasets(datasets,prop=2/3)
corr=[]
for numCC in numCCs:
corr_inner=[]
for reg in regs:
corr_firstVariate,_=lc_rcca(datasets_cv,kernelcca, reg, numCC,verbose=False)
corr_inner.append(corr_firstVariate)
corr.append(corr_inner)
return corr
##
def lc_rcca_CV_all_fold(datasets,K,kernelcca,regs,numCCs,n_processes=5):
s=time.time()
#==========================================================
Corr=[]
if K>20:
pool = multiprocessing.Pool(processes=n_processes)
for k in range(K):
# split datasets to train set and test set
datasets_cv=split_datasets(datasets,prop=2/3)
Corr.append(pool.apply_async(lc_rcca_CV_1fold,\
(datasets,kernelcca,regs,numCCs)))
print ('Waiting...')
pool.close()
pool.join()
CORR=[co.__dict__['_value'] for co in Corr]
meanCorr=np.mean(CORR,0)
e=time.time()
print('parameter tuning time is {:.1f} s'.format(e-s))
return meanCorr
#==========================================================
if K<=20:
Corr=[]
for i in range(K):
print('fold {}/{}'.format(i+1,K))
# split datasets to train set and test set
datasets_cv=split_datasets(datasets,prop=2/3)
# run
corr=lc_rcca_CV_1fold(datasets_cv,kernelcca=kernelcca,\
regs=regs,numCCs=numCCs)
Corr.append(corr)
meanCorr=np.mean(Corr,0)
e=time.time()
print('parameter tuning time is {:.1f} s(1)'.format(e-s))
return meanCorr
#==========================================================
##
def split_datasets(datasets,prop=2/3):
# Only applicable to 2 datasets
# prop: proportion of datasets used for cv
# nData=len(datasets)
nSample=datasets[0].shape[0]
nCV=int(nSample*prop)
index=np.random.permutation(np.arange(0,nSample,1))
datasets_cv=[datasets[0][index[:nCV],:],datasets[1][index[:nCV],:]]
return datasets_cv
if __name__=='__main__':
datasets=[train1,train2]
mc=lc_rcca_CV_all_fold(datasets,K=22,\
kernelcca=True,\
regs=np.logspace(-4,2,10),\
numCCs=np.arange(1,6),\
n_processes=5) |
dongmengshi/easylearn | eslearn/machine_learning/regression/lc_regression_elasticNet.py | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 14 22:15:54 2018
1.以功能连接/动态功能连接矩阵为特征,来进行回归
2.本程序使用的算法为svc(交叉验证)
3.当特征是动态连接时,使用标准差或者均数等来作为特征。也可以自己定义
4.input:
所有人的.mat FC/dFC
5.output:
机器学习的相应结果,以字典形式保存再result中。
@author: <NAME>
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Machine_learning\utils')
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Machine_learning\classfication')
from lc_read_write_Mat import read_mat,write_mat
import lc_elasticNetCV as ENCV
import os
import numpy as np
import pandas as pd
from concurrent.futures import ThreadPoolExecutor
import multiprocessing
import time
from sklearn.model_selection import train_test_split
class classify_using_FC():
def __init__(sel):
sel.file_path=r'D:\WorkStation_2018\WorkStation_dynamicFC\Data\zDynamic\DynamicFC_length17_step1_screened'#mat文件所在路径
sel.dataset_name=None # mat文件打开后的名字
sel.scale=r'D:\WorkStation_2018\WorkStation_dynamicFC\Scales\8.30大表.xlsx'
sel.save_path=r'D:\WorkStation_2018\WorkStation_dynamicFC\Data\zDynamic'
sel.feature='mean' #用均数还是std等('mean'/'std'/'staticFC')
sel.mask=np.ones([114,114]) #特征矩阵的mask
sel.mask=np.triu(sel.mask,1)==1 # 只提取上三角(因为其他的为重复)
sel.n_processess=10
sel.if_save_post_mat=1 #保存后处理后的mat?
sel.random_state=2
def load_allmat(sel):
# 多线程
s=time.time()
print('loading all mat...\n')
# 判断是否有FC mat文件
if os.path.exists(os.path.join(sel.save_path,sel.feature+'.mat')):
sel.mat=pd.DataFrame(read_mat(os.path.join(sel.save_path,sel.feature+'.mat'),None))
print('Already have {}\nloaded all mat!\nrunning time={:.2f}'.format(sel.feature+'.mat',time.time()-s))
else:
sel.all_mat=os.listdir(sel.file_path)
all_mat_path=[os.path.join(sel.file_path,all_mat_) for all_mat_ in sel.all_mat]
cores = multiprocessing.cpu_count()
if sel.n_processess>cores:
sel.n_processess=cores-1
len_all=len(all_mat_path)
sel.mat=pd.DataFrame([])
# 特征用std还是mean
if sel.feature=='mean':
ith=1
elif sel.feature=='std':
ith=0
elif sel.feature=='staticFC':
ith=0
else:
print('###还未添加其他衡量dFC的指标,默认使用std###\n')
ith=0
# load mat...
with ThreadPoolExecutor(sel.n_processess) as executor:
for i, all_mat_ in enumerate(all_mat_path):
task=executor.submit(sel.load_onemat_and_processing, i,all_mat_,len_all,s)
sel.mat=pd.concat([sel.mat,pd.DataFrame(task.result()[ith]).T],axis=0)
# 保存后处理后的mat文件
if sel.if_save_post_mat:
write_mat(fileName=os.path.join(sel.save_path,sel.feature+'.mat'),
dataset_name=sel.feature,
dataset=np.mat(sel.mat.values))
print('saved all {} mat!\n'.format(sel.feature))
def load_onemat_and_processing(sel,i,all_mat_,len_all,s):
# load mat
mat=read_mat(all_mat_,sel.dataset_name)
# 计算方差,均数等。可扩展。(如果时静态FC,则不执行)
if sel.feature=='staticFC':
mat_std,mat_mean=mat,[]
else:
mat_std,mat_mean=sel.calc_std(mat)
# 后处理特征,可扩展
if sel.feature=='staticFC':
mat_std_1d,mat_mean_1d=sel.postprocessing_features(mat_std),[]
else:
mat_std_1d=sel.postprocessing_features(mat_std)
mat_mean_1d=sel.postprocessing_features(mat_mean)
# 打印load进度
if i%10==0 or i==0:
print('{}/{}\n'.format(i,len_all))
if i%50==0 and i!=0:
e=time.time()
remaining_running_time=(e-s)*(len_all-i)/i
print('\nremaining time={:.2f} seconds \n'.format(remaining_running_time))
return mat_std_1d,mat_mean_1d
def calc_std(sel,mat):
mat_std=np.std(mat,axis=2)
mat_mean=np.mean(mat,axis=2)
return mat_std,mat_mean
def postprocessing_features(sel,mat):
# 准备特征:比如取上三角,拉直等
return mat[sel.mask]
def gen_label(sel):
# 判断是否已经存在label
if os.path.exists(os.path.join(sel.save_path,'folder_label.xlsx')):
sel.label=pd.read_excel(os.path.join(sel.save_path,'folder_label.xlsx'))['诊断']
print('\nAlready have {}\n'.format('folder_label.xlsx'))
else:
# identify label for each subj
id_subj=pd.Series(sel.all_mat).str.extract('([1-9]\d*)')
scale=pd.read_excel(sel.scale)
id_subj=pd.DataFrame(id_subj,dtype=type(scale['folder'][0]))
sel.label=pd.merge(scale,id_subj,left_on='folder',right_on=0,how='inner')['诊断']
sel.folder=pd.merge(scale,id_subj,left_on='folder',right_on=0,how='inner')['folder']
# save folder and label
if sel.if_save_post_mat:
sel.label_folder=pd.concat([sel.folder,sel.label],axis=1)
sel.label_folder.to_excel(os.path.join(sel.save_path,'folder_label.xlsx'),index=False)
return sel
def machine_learning(sel,order=[3,4]):
# label
y=pd.concat([sel.label[sel.label.values==order[0]] , sel.label[sel.label.values==order[1]]])
y=y.values
# x/sel.mat
if os.path.exists(os.path.join(sel.save_path,sel.feature+'.mat')):
sel.mat=pd.DataFrame(read_mat(os.path.join(sel.save_path,sel.feature+'.mat'),None))
x=pd.concat([sel.mat.iloc[sel.label.values==order[0],:] , sel.mat.iloc[sel.label.values==order[1],:]])
# #平衡测试
# y=np.hstack([y,y[-1:-70:-1]])
# x=pd.concat([x,x.iloc[-1:-70:-1]],axis=0)
# y=y[60:]
# x=x.iloc[60:,:]
# print(sum(y==0),sum(y==1))
# 置换y
# rand_ind=np.random.permutation(len(y))
# y=y[rand_ind]
# cross-validation
# 1) split data to training and testing datasets
x_train, x_test, y_train, y_test = \
train_test_split(x, y, random_state=sel.random_state)
# elasticNet
print('elasticNetCV')
sel=ENCV.elasticNetCV()
sel.train(x_train,y_train)
sel.test(x_test)
results=sel.test(x_test).__dict__
# =============================================================================
#
# # rfe
# import lc_svc_rfe_cv_V2 as lsvc
# model=lsvc.svc_rfe_cv(k=5,pca_n_component=0.85)
#
# results=model.main_svc_rfe_cv(x.values,y)
# =============================================================================
results=results.__dict__
return results
if __name__=='__main__':
import lc_classify_FC as Clasf
sel=Clasf.classify_using_FC()
results=sel.load_allmat()
results=sel.gen_label()
result=sel.machine_learning(order=[1,3]) |
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_svc_rfe_fmri_V1.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
import lc_svc_rfe_cv_V2 as lsvc
import pandas as pd
import numpy as np
from lc_read_nii import read_sigleNii_LC
from lc_read_nii import main
import matplotlib.pyplot as plt
from sklearn.metrics import classification_report
from sklearn.metrics import roc_curve, roc_auc_score
from sklearn.metrics import accuracy_score
"""
Created on Wed Dec 5 20:04:02 2018
用神经影像数据作为特征来分类
1 单中心交叉验证
2 多中心之间交叉验证
@author: lenovo
"""
# import
import sys
sys.path.append(
r'D:\My_Codes\LC_Machine_Learning\Machine_learning (Python)\Machine_learning\utils')
sys.path.append(
r'D:\My_Codes\LC_Machine_Learning\Machine_learning (Python)\Machine_learning\classfication')
sys.path.append(
r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Machine_learning\utils')
sys.path.append(
r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Machine_learning\classfication')
# ==============================================================================
# input
# 外部数据
folder_p_2 = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_control\C_Weighted_selected'
folder_hc_2 = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_patient\P_Weighted_selected'
# 内部数据
folder_p_1 = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_control\C_Weighted_selected'
folder_hc_1 = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_patient\P_Weighted_selected'
# 灰质mask
mask = r'G:\Softer_DataProcessing\spm12\spm12\tpm\Reslice3_TPM_greaterThan0.2.nii'
mask = read_sigleNii_LC(mask) >= 0.2
mask = np.array(mask).reshape(-1,)
# 设置训练与否
if_training_inner_cv = 1
if_training_outer_cv = 0
if_show_data_distribution = 0 # 显示训练集和测试集数据分布
# ==============================================================================
def load_nii_and_gen_label(folder_p, folder_hc, mask):
# data
data_p = main(folder_p)
data_p = np.squeeze(
np.array([np.array(data_p).reshape(1, -1) for data_p in data_p]))
data_hc = main(folder_hc)
data_hc = np.squeeze(
np.array([np.array(data_hc).reshape(1, -1) for data_hc in data_hc]))
data = np.vstack([data_p, data_hc])
# data in mask
# mask=np.sum(data==0,0)<=0
data_in_mask = data[:, mask]
# label
label = np.hstack(
[np.ones([len(data_p), ]), np.ones([len(data_hc), ]) - 2])
return data, data_in_mask, label
data_1, zdata_in_mask_1, label_1 = load_nii_and_gen_label(
folder_p_1, folder_hc_1, mask)
data_2, zdata_in_mask_2, label_2 = load_nii_and_gen_label(
folder_p_2, folder_hc_2, mask)
# ===============================================================================
# 检查训练集和测试集的数据一致性
# mean_data_in_mask_1=np.mean(data_in_mask_1,axis=0)
# mean_data_in_mask_2=np.mean(data_in_mask_2,axis=0)
# 结果发现整体来说 数据集1>数据集2
# 尝试被试水平的z标准化
#zdata_in_mask_1=[(data_in_mask_1[i,:]-data_in_mask_1[i,:].mean())/data_in_mask_1[i,:].std() for i in range(data_in_mask_1.shape[0])]
#zdata_in_mask_2=[(data_in_mask_2[i,:]-data_in_mask_2[i,:].mean())/data_in_mask_2[i,:].std() for i in range(data_in_mask_2.shape[0])]
# 尝试被试水平去中心化
#zdata_in_mask_1=[(data_in_mask_1[i,:]-data_in_mask_1[i,:].mean()) for i in range(data_in_mask_1.shape[0])]
#zdata_in_mask_2=[(data_in_mask_2[i,:]-data_in_mask_2[i,:].mean()) for i in range(data_in_mask_2.shape[0])]
# 尝试被试水平除以均值
#zdata_in_mask_1=[(data_in_mask_1[i,:]/data_in_mask_1[i,:].mean()) for i in range(data_in_mask_1.shape[0])]
#zdata_in_mask_2=[(data_in_mask_2[i,:]/data_in_mask_2[i,:].mean()) for i in range(data_in_mask_2.shape[0])]
if if_show_data_distribution:
zdata_in_mask_1 = pd.DataFrame(data_in_mask_1).values
zdata_in_mask_2 = pd.DataFrame(data_in_mask_2).values
mean_1 = np.mean(zdata_in_mask_1, axis=0)
mean_2 = np.mean(zdata_in_mask_2, axis=0)
fig, ax = plt.subplots()
n, bins, patches = ax.hist(
x=mean_1, bins='auto', rwidth=0.7, alpha=0.5, color='b')
n, bins, patches = ax.hist(
x=mean_2, bins='auto', rwidth=0.7, alpha=0.5, color='r')
ax.legend({'our data distribution', 'beijing data distributio'})
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['bottom'].set_visible(True)
ax.spines['left'].set_visible(True)
plt.show()
plt.savefig(r'J:\dynamicALFF\Results\static_ALFF\test\数据分布_zscore.tif')
# ==============================================================================
# training and test
svc = lsvc.svc_rfe_cv(pca_n_component=0.95, show_results=1, show_roc=0, k=5)
# 单中心内部交叉验证
if if_training_inner_cv:
results2 = svc.main_svc_rfe_cv(zdata_in_mask_2, label_2)
results2 = results2.__dict__
results1 = svc.main_svc_rfe_cv(zdata_in_mask_1, label_1)
results1 = results1.__dict__
# 多中心之间交叉验证
def cv_multicent(data_in_mask_1, data_in_mask_2, label_1, label_2):
# 训练2,测试1
# scale
data_in_mask_2_standarded, data_in_mask_1_standarded = svc.scaler(
data_in_mask_2, data_in_mask_1, svc.scale_method)
# mean_data_in_mask_1_standarded=np.mean(data_in_mask_1_standarded,axis=0)
# mean_data_in_mask_2_standarded=np.mean(data_in_mask_2_standarded,axis=0)
# a=mean_data_in_mask_1_standarded-mean_data_in_mask_2_standarded
# pca
data_in_mask_2_low_dim, data_in_mask_1_low_dim, trained_pca = svc.dimReduction(
data_in_mask_2_standarded, data_in_mask_1_standarded, svc.pca_n_component)
# train
model, weight = svc.training(data_in_mask_2_low_dim, label_2,
step=svc.step, cv=svc.k, n_jobs=svc.num_jobs,
permutation=svc.permutation)
# test
prd, de = svc.testing(model, data_in_mask_1_low_dim)
# performances
accuracy = accuracy_score(label_1, prd)
report = classification_report(label_1, prd)
report = report.split('\n')
specificity = report[2].strip().split(' ')
sensitivity = report[3].strip().split(' ')
specificity = float([spe for spe in specificity if spe != ''][2])
sensitivity = float([sen for sen in sensitivity if sen != ''][2])
# roc and self.auc
fpr, tpr, thresh = roc_curve(label_1, de)
auc = roc_auc_score(label_1, de)
print('\naccuracy={:.2f}\n'.format(accuracy))
print('sensitivity={:.2f}\n'.format(sensitivity))
print('specificity={:.2f}\n'.format(specificity))
print('auc={:.2f}\n'.format(auc))
return prd, de
if if_training_outer_cv:
# 训练外部,测试内部
prd_2to1, de_2to1 = cv_multicent(
zdata_in_mask_1, zdata_in_mask_2, label_1, label_2)
# 训练外部,测试内部
prd_1to2, de_1to2 = cv_multicent(
zdata_in_mask_2, zdata_in_mask_1, label_2, label_1)
|
dongmengshi/easylearn | eslearn/utils/SelectRawData_Window.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'SelectRawData_Window.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_CopySelectedData(object):
def setupUi(self, CopySelectedData):
CopySelectedData.setObjectName("CopySelectedData")
CopySelectedData.resize(293, 331)
self.ScaleFolder = QtWidgets.QPushButton(CopySelectedData)
self.ScaleFolder.setGeometry(QtCore.QRect(30, 20, 221, 41))
self.ScaleFolder.setObjectName("ScaleFolder")
self.RawFolder = QtWidgets.QPushButton(CopySelectedData)
self.RawFolder.setGeometry(QtCore.QRect(30, 110, 221, 41))
self.RawFolder.setObjectName("RawFolder")
self.SaveFolder = QtWidgets.QPushButton(CopySelectedData)
self.SaveFolder.setGeometry(QtCore.QRect(30, 200, 221, 41))
self.SaveFolder.setObjectName("SaveFolder")
self.RunCopy = QtWidgets.QPushButton(CopySelectedData)
self.RunCopy.setGeometry(QtCore.QRect(152, 270, 101, 41))
self.RunCopy.setObjectName("RunCopy")
self.retranslateUi(CopySelectedData)
QtCore.QMetaObject.connectSlotsByName(CopySelectedData)
def retranslateUi(self, CopySelectedData):
_translate = QtCore.QCoreApplication.translate
CopySelectedData.setWindowTitle(
_translate("CopySelectedData", "Dialog"))
self.ScaleFolder.setText(_translate("CopySelectedData", "选择参考Folder"))
self.RawFolder.setText(_translate("CopySelectedData", "选择原始数据"))
self.SaveFolder.setText(_translate("CopySelectedData", "选择保存路径"))
self.RunCopy.setText(_translate("CopySelectedData", "Copy"))
|
dongmengshi/easylearn | eslearn/machine_learning/regression/lc_elasticNet_yange.py | # -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Machine_learning\utils')
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Machine_learning\classfication')
from lc_read_write_Mat import read_mat,write_mat
import lc_elasticNetCV as ENCV
import os
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
class classify_using_FC():
def __init__(sel):
sel.file_path=r'D:\WorkStation_2018\WorkStation_dynamicFC\Data\zDynamic\DynamicFC_length17_step1_screened'#mat文件所在路径
sel.dataset_name=None # mat文件打开后的名字
sel.scale=r'D:\WorkStation_2018\WorkStation_dynamicFC\Scales\8.30大表.xlsx'
sel.save_path=r'D:\WorkStation_2018\WorkStation_dynamicFC\Data\zDynamic'
sel.feature='mean' #用均数还是std等('mean'/'std'/'staticFC')
sel.mask=np.ones([114,114]) #特征矩阵的mask
sel.mask=np.triu(sel.mask,1)==1 # 只提取上三角(因为其他的为重复)
sel.n_processess=10
sel.if_save_post_mat=1 #保存后处理后的mat?
sel.random_state=2
def postprocessing_features(sel,mat):
# 准备特征:比如取上三角,拉直等
return mat[sel.mask]
def machine_learning(sel,order=[3,4]):
# elasticNet
print('elasticNetCV')
sel=ENCV.elasticNetCV()
sel.train(x_train,y_train)
sel.test(x_test)
results=sel.test(x_test).__dict__
# =============================================================================
#
# # rfe
# import lc_svc_rfe_cv_V2 as lsvc
# model=lsvc.svc_rfe_cv(k=5,pca_n_component=0.85)
#
# results=model.main_svc_rfe_cv(x.values,y)
# =============================================================================
results=results.__dict__
return results
if __name__=='__main__':
import lc_classify_FC as Clasf
sel=Clasf.classify_using_FC()
results=sel.load_allmat()
results=sel.gen_label()
result=sel.machine_learning(order=[1,3]) |
dongmengshi/easylearn | eslearn/visualization/hot_map.py | <filename>eslearn/visualization/hot_map.py
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 17 17:35:09 2018
画热图
@author: lenovo
"""
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
##=====================================================================
# input
corr=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\r_dti1.xlsx',header=None,index=None)
pValue=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\p_dti1.xlsx',header=None,index=None)
x=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\DTI(1).xlsx')
if_save_figure=0
#==================================================================
corr[pValue.isnull()]=None
pValue[pValue.isnull()]=None
mask=pValue>0.037
# =============================================================================
# #调整顺序
#columns=list(x.columns)
#col_index=[10,9,11,5,12,8,6,7,2,3,4,1,17,18,19,20,21,22]
#col=[columns[i] for i in col_index]
col=list(list(x.columns))[3:]
# =============================================================================
# colormap
cmap = sns.cubehelix_palette(start = 1.5, rot = 3, gamma=0.8, as_cmap = True)
#f, (ax1) = plt.subplots(figsize=(20,20),nrows=1)
f, (ax1) = plt.subplots(nrows=1)
#sns.heatmap(x, annot=True, ax=ax1,cmap='rainbow',center=0)#cmap='rainbow'
sns.heatmap(corr,ax=ax1,
annot=True,annot_kws={'size':6,'weight':'normal', 'color':"k"},fmt='.3f',
cmap='RdBu_r',
linewidths = 0.05, linecolor= 'k',
mask=mask)
ax1.set_title('')
ax1.set_xlabel('')
ax1.set_ylabel('')
ax1.set_xticklabels(col,size=9)
ax1.set_yticklabels(col,size=9)
## 设置选中,以及方位
label_x = ax1.get_xticklabels()
label_y = ax1.get_yticklabels()
plt.setp(label_x, rotation=15, horizontalalignment='right')
plt.setp(label_y, rotation=0, horizontalalignment='right')
plt.show()
# save
if if_save_figure:
plt.savefig(r'D:\workstation_b\彦鸽姐\20190927\aa.tiff', transparent=False,
facecolor='w',edgecolor='w',dpi=300)
|
dongmengshi/easylearn | eslearn/utils/concatExcel.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 17 19:32:42 2018
此代码用于合并多个excel表格
根据index或者某一列设置为index来合并
@author: lenovo
"""
#import xlrd
import pandas as pd
from pandas import DataFrame
import numpy as np
file = r'D:\myCodes\MVPA_LIChao\MVPA_Python\workstation\0.xlsx'
dataGen = pd.read_excel(file, sheet_name='Sheet1')
dataCell = pd.read_excel(file, sheet_name='Sheet2')
# 'outer':在多个df的index有不同的时候,求他们的并集,区别于left和right
A = dataGen.set_index('folder').join(
dataCell.set_index('folder'), sort=True, how='left')
A.to_excel('allaa.xlsx')
#All = A.join(dataGen.set_index('folder'),sort=True,how='outer')
# All.to_excel('All.xlsx')
#
data = np.random.randn(4, 3)
frame = DataFrame(data, columns=['year', 'state', 'pop'], index=[1, 2, 3, 4])
data1 = np.random.randn(5, 3)
frame1 = DataFrame(
data1, columns=[
'year1', 'state1', 'pop1'], index=[
2, 3, 4, 5, 1])
All = frame.join(frame1, on=None, how='left', lsuffix='', rsuffix='', sort=True, how='outer')
#
caller = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'], 'A': [
'A0', 'A1', 'A2', 'A3', 'A4', 'A5']})
other = pd.DataFrame(
{'key': ['K0', 'K1', 'K2', 'K99'], 'B': ['B0', 'B1', 'B2', 'B99']})
caller.join(other.set_index('key'), on='key', how='outer')
##
#wb = xlrd.open_workbook(file)
#
# 获取workbook中所有的表格
#sheets = wb.sheet_names()
#
age_hc = pd.read_excel('age_HC-491.xlsx')
age_hc.to_csv('age_hc.txt', header=False, index=False)
age_sz = pd.read_excel('age_SZ-400.xlsx')
age_sz.to_csv('age_sz.txt', header=False, index=False)
age_hr = pd.read_excel('age_HR-177.xlsx')
age_hr.to_csv('age_hr.txt', header=False, index=False)
#
sex_hc = pd.read_excel('sex_HC-491.xlsx')
sex_hc.to_csv('sex_hc.txt', header=False, index=False)
sex_sz = pd.read_excel('sex_SZ-400.xlsx')
sex_sz.to_csv('sex_sz.txt', header=False, index=False)
sex_hr = pd.read_excel('sex_HR-177.xlsx')
sex_hr.to_csv('sex_hr.txt', header=False, index=False)
#
hc = pd.concat([age_hc, sex_hc], axis=1)
sz = pd.concat([age_sz, sex_sz], axis=1)
hr = pd.concat([age_hr, sex_hr], axis=1)
# dropna
sz = sz.dropna()
refrence = pd.Series(sz.index)
hr = hr.dropna()
refrence = pd.Series(hr.index)
hc = hc.dropna()
refrence = pd.Series(hc.index)
#
hc.to_csv('hc.txt', header=False, index=False, sep=' ')
sz.to_csv('sz.txt', header=False, index=False, sep=' ')
hr.to_csv('hr.txt', header=False, index=False, sep=' ')
|
dongmengshi/easylearn | eslearn/SSD_classification/Stat/lc_get_fc_cov_cohend.py | # -*- coding: utf-8 -*-
"""
This script is used to do 3 things:
1. Getting the functional connectivity networks for medicated SSD and first episode unmedicated SSD, as well as their matched HC.
2. Extracting sorted covariance for medicated SSD and first episode unmedicated SSD, as well as their matched HC.
3. Getting the Cohen'd values.
"""
import sys
sys.path.append(r'D:\My_Codes\lc_rsfmri_tools_python\Workstation\SZ_classification\ML')
sys.path.append(r'D:\My_Codes\lc_rsfmri_tools_python\Statistics')
import numpy as np
import pandas as pd
from lc_pca_svc_pooling import PCASVCPooling
import scipy.io as sio
from lc_calc_cohen_d_effective_size import CohenEffectSize
#%% Inputs
is_save = 1
dataset_first_episode_unmedicated_path = r'D:\WorkStation_2018\SZ_classification\Data\ML_data_npy\dataset_unmedicated_and_firstepisode_550.npy'
scale = r'D:\WorkStation_2018\SZ_classification\Scale\10-24大表.xlsx'
cov_550 = r'D:\WorkStation_2018\SZ_classification\Scale\cov_550.txt'
cov_206 = r'D:\WorkStation_2018\SZ_classification\Scale\cov_206.txt'
cov_COBRE = r'D:\WorkStation_2018\SZ_classification\Scale\cov_COBRE.txt'
cov_UCLA = r'D:\WorkStation_2018\SZ_classification\Scale\cov_UCLA.txt'
cov_unmedicated_sz_and_matched_hc = r'D:\WorkStation_2018\SZ_classification\Scale\cov_unmedicated_sp_and_hc_550.txt'
#%% Load all dataset
scale = pd.read_excel(scale)
sel = PCASVCPooling()
dataset_our_center_550 = np.load(sel.dataset_our_center_550)
dataset_206 = np.load(sel.dataset_206)
dataset_COBRE = np.load(sel.dataset_COBRE)
dataset_UCAL = np.load(sel.dataset_UCAL)
dataset1_firstepisodeunmed = np.load(dataset_first_episode_unmedicated_path)
cov_550, cov_206, cov_COBRE, cov_UCLA = pd.read_csv(cov_550), pd.read_csv(cov_206), pd.read_csv(cov_COBRE), pd.read_csv(cov_UCLA)
cov_all = pd.concat([cov_550, cov_206, cov_COBRE, cov_UCLA])
cov_feu = pd.read_csv(cov_unmedicated_sz_and_matched_hc)
# Extract ID
uid_our_center_550 = dataset_our_center_550[:, 0]
uid_206 = dataset_206[:, 0]
uid_COBRE = dataset_COBRE[:, 0]
uid_UCAL = dataset_UCAL[:, 0]
uid_feu = dataset1_firstepisodeunmed[:, 0]
# Extract features and label
features_our_center_550 = dataset_our_center_550[:, 2:]
features_206 = dataset_206[:, 2:]
features_COBRE = dataset_COBRE[:, 2:]
features_UCAL = dataset_UCAL[:, 2:]
fc_ssd_firstepisodeunmed = dataset1_firstepisodeunmed[:, 2:]
label_our_center_550 = dataset_our_center_550[:, 1]
label_206 = dataset_206[:, 1]
label_COBRE = dataset_COBRE[:, 1]
label_UCAL = dataset_UCAL[:, 1]
label_firstepisodeunmed = dataset1_firstepisodeunmed[:, 1]
#%% Get data and cov
# Medicated
uid_medicated_sp_hc_550 = np.int32(list(set(uid_our_center_550) - set(scale['folder'][(scale['诊断'] == 3) & (scale['用药'] != 1)])))
cov_medicated_sp_hc_550 = cov_550[cov_550['folder'].isin(uid_medicated_sp_hc_550)]
header = cov_medicated_sp_hc_550.columns
data_medicated_sp_hc_484 = pd.merge(pd.DataFrame(dataset_our_center_550), cov_medicated_sp_hc_550, left_on=0, right_on='folder', how='inner')
cov_medicated_sp_hc_484 = data_medicated_sp_hc_484[header]
features_our_center_484 = data_medicated_sp_hc_484.drop(header, axis=1)
features_our_center_484 = features_our_center_484.iloc[:, 2:]
cov_ssd_medicated = pd.DataFrame(np.concatenate([cov_medicated_sp_hc_550, cov_206, cov_COBRE, cov_UCLA], axis=0), columns=header)
# Add site id as covariance
cov_all_sites_id = pd.DataFrame(np.concatenate([np.ones([cov_medicated_sp_hc_550.shape[0],1]),
np.ones([cov_206.shape[0],1]) + 1,
np.ones([cov_COBRE.shape[0],1]) + 2,
np.ones([cov_UCLA.shape[0],1]) + 3])
)
cov_ssd_medicated = pd.concat([cov_ssd_medicated['folder'], cov_all_sites_id, cov_ssd_medicated[['diagnosis', 'age', 'sex']]], axis=1)
fc_ssd_medicated = np.concatenate([features_our_center_484, features_206, features_UCAL, features_COBRE], axis=0)
label_medicated = cov_ssd_medicated['diagnosis']
# First episode unmedicated
cov_feu = pd.merge(pd.DataFrame(uid_feu), cov_feu, left_on=0, right_on='folder', how='inner').drop(0, axis=1)
#%% Get the difference
# Medicated
fc_ssd_medicated = fc_ssd_medicated[label_medicated == 1]
data_hc_medicated = fc_ssd_medicated[label_medicated == 0]
cohen_medicated = CohenEffectSize(fc_ssd_medicated, data_hc_medicated)
# First episode unmedicated in dataset1
data_ssd_firstepisodeunmed = fc_ssd_firstepisodeunmed[label_firstepisodeunmed == 1]
data_hc_firstepisodeunmed = fc_ssd_firstepisodeunmed[label_firstepisodeunmed == 0]
cohen_feu = CohenEffectSize(data_ssd_firstepisodeunmed, data_hc_firstepisodeunmed)
#%% Make the differences to 2D matrix and save to mat
# All
cohen_medicated_full = np.zeros([246,246])
cohen_medicated_full[np.triu(np.ones([246,246]), 1) == 1] = cohen_medicated
cohen_medicated_full = cohen_medicated_full + cohen_medicated_full.T
cohen_feu_full = np.zeros([246,246])
cohen_feu_full[np.triu(np.ones([246,246]), 1) == 1] = cohen_feu
cohen_feu_full = cohen_feu_full + cohen_feu_full.T
#%% Save to mat for MATLAB process (NBS)
if is_save:
sio.savemat(r'D:\WorkStation_2018\SZ_classification\Data\fc_medicated.mat', {'fc_medicated': fc_ssd_medicated})
sio.savemat(r'D:\WorkStation_2018\SZ_classification\Data\fc_unmedicatedl.mat', {'fc_unmedicated': fc_ssd_firstepisodeunmed})
sio.savemat(r'D:\WorkStation_2018\SZ_classification\Data\cov_ssd_medicated.mat', {'cov_ssd_medicated': cov_ssd_medicated.values})
sio.savemat(r'D:\WorkStation_2018\SZ_classification\Data\cov_unmedicatedl.mat', {'cov_unmedicated': cov_feu.values})
sio.savemat(r'D:\WorkStation_2018\SZ_classification\Data\Stat_results\cohen_medicated.mat', {'cohen_medicated': cohen_medicated_full})
sio.savemat(r'D:\WorkStation_2018\SZ_classification\Data\Stat_results\cohen_feu.mat', {'cohen_feu': cohen_feu_full}) |
dongmengshi/easylearn | eslearn/utils/lc_scatter.py | <reponame>dongmengshi/easylearn<filename>eslearn/utils/lc_scatter.py
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 3 11:25:00 2018
画散点图和拟合直线
@author: LiChao
"""
import numpy as np
import matplotlib.pyplot as plt
def plot_scatter_plus_fittingLine(x, y, title='polyfitting'):
# 绘制散点
# 直线拟合与绘制
x = np.reshape(x, [len(x)])
y = np.reshape(y, [len(y)])
z1 = np.polyfit(x, y, 1) # 用1次多项式拟合
yvals = np.polyval(z1, x)
# p1 = np.poly1d(z1)
# yvals=p1(x)#也可以使用
plt.plot(x, y, 'o', markersize=6, label='original values')
plt.plot(x, yvals, 'r', linestyle=':', label='polyfit values')
# plt.xlabel('x axis')
# plt.ylabel('y axis')
plt.legend(loc=0) # 指定legend的位置
plt.title(title)
plt.show()
# plt.savefig('p1.png')
|
dongmengshi/easylearn | eslearn/SSD_classification/Data_Inspection/lc_subjects_selection.py | # -*- coding: utf-8 -*-
"""
This script is used to select the subjects with good quality (mean FD, percentages of greater FD, rigid motion).
Then matching SZ and HC based on the age, sex and headmotion.
Note that: these 1322 subjects are already selected by rigid motion criteria: one voxel.
All selected subjects's ID will save to D:/WorkStation_2018/WorkStation_CNN_Schizo/Scale/selected_sub.xlsx
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python\Statistics')
import pandas as pd
import numpy as np
from lc_chisqure import lc_chisqure
import scipy.stats as stats
import matplotlib.pyplot as plt
# Inputs
scales_whole = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\10-24大表.xlsx'
headmotionfile = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\头动参数_1322.xlsx'
uidfile = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\ID_1322.txt'
scale_206 = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\SZ_NC_108_100.xlsx'
# Load
scales_whole = pd.read_excel(scales_whole)
headmotion = pd.read_excel(headmotionfile)
uid = pd.read_csv(uidfile, header=None)
# SZ filter
scales_1322 = pd.merge(scales_whole, uid, left_on='folder', right_on=0, how='inner')
scales_sz = scales_1322[scales_1322['诊断'].isin([3])]
scales_hc = scales_1322[scales_1322['诊断'].isin([1])]
scales_sz_firstepisode = scales_sz[(scales_sz['首发']==1)]
#scales_sz_firstepisode = scales_sz[(scales_sz['用药'].isin([0]))]
scales_all = pd.concat([scales_hc, scales_sz])
# Headmotion filter
scales_all_headmotionfilter = pd.merge(headmotion, scales_all, left_on='Subject ID', right_on='folder', how='inner')
colname = list(scales_all_headmotionfilter.columns)
motion = scales_all_headmotionfilter.iloc[:,[1,2,3,4,5,6]]
mFD = scales_all_headmotionfilter[['Subject ID','mean FD_Power']]
Percent_of_great_FD = scales_all_headmotionfilter[['Subject ID','Percent of FD_Power>0.2']]
# scales_all_headmotionfilter = scales_all_headmotionfilter[(scales_all_headmotionfilter['mean FD_Power'] <= 0.2) \
# & (scales_all_headmotionfilter['Percent of FD_Power>0.2'] <= 0.2)]
# Number matching (Let Number of HC = Number of SZ)
scales_all_headmotionfilter = scales_all_headmotionfilter.drop(scales_all_headmotionfilter[(scales_all_headmotionfilter['诊断'] == 1)].index[0:114])
print(scales_all_headmotionfilter[(scales_all_headmotionfilter['诊断'] == 1)].index)
# scales_all_headmotionfilter.to_excel(r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\scale_cnn.xlsx')
# Matching based on age, sex and headmotion
age_hc = scales_all_headmotionfilter['年龄'][scales_all_headmotionfilter['诊断']==1]
age_sz = scales_all_headmotionfilter['年龄'][scales_all_headmotionfilter['诊断']==3]
mage_hc = np.mean(age_hc)
age_hc = scales_all_headmotionfilter['年龄'][(scales_all_headmotionfilter['诊断']==1) \
& (scales_all_headmotionfilter['年龄'] < 42)]
t, p = stats.ttest_ind(age_hc, age_sz)
print(f'p_age = {p}\n')
scales_all_headmotionfilter = scales_all_headmotionfilter[((scales_all_headmotionfilter['诊断']==1) \
& (scales_all_headmotionfilter['年龄'] < 42)) | (scales_all_headmotionfilter['诊断']==3)]
sex_hc = scales_all_headmotionfilter['性别'][scales_all_headmotionfilter['诊断']==1]
sex_sz = scales_all_headmotionfilter['性别'][scales_all_headmotionfilter['诊断']==3]
numsex_hc = [np.sum(sex_hc==1), np.sum(sex_hc==2)]
numsex_sz = [np.sum(sex_sz==1), np.sum(sex_sz==2)]
obs = [np.sum(sex_hc==1), np.sum(sex_sz==1)]
tt = [len(sex_hc), len(sex_sz)]
chivalue, chip = lc_chisqure(obs, tt)
print(f'p_sex = {chip}\n')
mFD_hc = scales_all_headmotionfilter['mean FD_Power'][scales_all_headmotionfilter['诊断']==1]
mFD_sz = scales_all_headmotionfilter['mean FD_Power'][scales_all_headmotionfilter['诊断']==3]
t, p = stats.ttest_ind(mFD_hc, mFD_sz)
print(f'p_mFD = {p}\n')
# save
# scales_all_headmotionfilter['Subject ID'].to_csv('D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\selected_550.txt',index=False, header=False)
print(f'Totle selected participants is {np.shape(scales_all_headmotionfilter)[0]}')
print(f"number of HC = {np.sum(scales_all_headmotionfilter['诊断']==1)}")
print(f"number of SZ = {np.sum(scales_all_headmotionfilter['诊断']==3)}")
# -------------------------------206--------------------------------------------
scale_206 = pd.read_excel(scale_206)
age_g1 = scale_206['age'][scale_206['group']==1]
age_g2 = scale_206['age'][scale_206['group']==2]
t, p = stats.ttest_ind(age_g1, age_g2)
#plt.hist(age_g1, bins=50)
#plt.hist(age_g2, bins=50)
#plt.legend(['sz','hc'])
#plt.show()
num1_g1 = np.sum(scale_206['sex'][scale_206['group']==1])
num0_g1 = np.sum(scale_206['sex'][scale_206['group']==1] ==0)
num1_g2 = np.sum(scale_206['sex'][scale_206['group']==2])
num0_g2 = np.sum(scale_206['sex'][scale_206['group']==2] ==0)
obs = [num1_g1, num1_g2]
tt = [np.sum(scale_206['group']==1), np.sum(scale_206['group']==2)]
chivalue, chip = lc_chisqure(obs, tt)
#plt.subplot(121)
#plt.pie([num1_g1,num0_g1])
#plt.legend(['1','0'])
#plt.title('g1')
#
#plt.subplot(122)
#plt.pie([num1_g2,num0_g2])
#plt.legend(['1','0'])
#plt.title('g2')
#plt.show() |
dongmengshi/easylearn | eslearn/utils/lc_cacl_MAD.py | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 6 11:18:08 2018
MAD,median absolute deviation for dimension reduction
MAD=median(|Xi−median(X)|)
refer to {Linked dimensions of psychopathology
and connectivity in functional brain networks}
@author: <NAME>
"""
import numpy as np
def select_features_using_MAD(M, perc=0.1):
# perc: how many percentages of feature
# that have top MAD to be selected
MAD = cacl_MAD(M)
Ind_descendOrd = np.argsort(MAD)[::-1] # decend order
Ind_select = Ind_descendOrd[0:int(len(Ind_descendOrd) * perc)]
feature_selected = M[:, Ind_select]
return feature_selected
def cacl_MAD(M):
# caculate MAD
# row is sample, col is feature
my_median = np.median(M, 0)
my_abs = np.abs(M - my_median)
MAD = np.median(my_abs, 0)
return MAD
|
dongmengshi/easylearn | eslearn/SSD_classification/Data_Inspection/lc_table_statistics.py | """
This script is designed to perform table statistics
"""
import pandas as pd
import numpy as np
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python')
import os
from Utils.lc_read_write_mat import read_mat
#%% ----------------------------------Our center 550----------------------------------
uid_path_550 = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\selected_550.txt'
scale_path_550 = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\10-24大表.xlsx'
scale_data_550 = pd.read_excel(scale_path_550)
uid_550 = pd.read_csv(uid_path_550, header=None)
scale_selected_550 = pd.merge(uid_550, scale_data_550, left_on=0, right_on='folder', how='inner')
describe_bprs_550 = scale_selected_550.groupby('诊断')['BPRS_Total'].describe()
describe_age_550 = scale_selected_550.groupby('诊断')['年龄'].describe()
describe_duration_550 = scale_selected_550.groupby('诊断')['病程月'].describe()
describe_durgnaive_550 = scale_selected_550.groupby('诊断')['用药'].value_counts()
describe_sex_550 = scale_selected_550.groupby('诊断')['性别'].value_counts()
#%% ----------------------------------BeiJing 206----------------------------------
uid_path_206 = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\北大精分人口学及其它资料\SZ_NC_108_100.xlsx'
scale_path_206 = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\北大精分人口学及其它资料\SZ_NC_108_100-WF.csv'
uid_to_remove = ['SZ010109','SZ010009']
scale_data_206 = pd.read_csv(scale_path_206)
scale_data_206 = scale_data_206.drop(np.array(scale_data_206.index)[scale_data_206['ID'].isin(uid_to_remove)])
scale_data_206['PANSStotal1'] = np.array([np.float64(duration) if duration.strip() !='' else 0 for duration in scale_data_206['PANSStotal1'].values])
Pscore = pd.DataFrame(scale_data_206[['P1', 'P2', 'P3', 'P4', 'P4', 'P5', 'P6', 'P7']].iloc[:106,:], dtype = np.float64)
Pscore = np.sum(Pscore, axis=1).describe()
Nscore = pd.DataFrame(scale_data_206[['N1', 'N2', 'N3', 'N4', 'N4', 'N5', 'N6', 'N7']].iloc[:106,:], dtype=np.float64)
Nscore = np.sum(Nscore, axis=1).describe()
Gscore = pd.DataFrame(scale_data_206[['G1', 'G2', 'G3', 'G4', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10', 'G11', 'G12', 'G13', 'G14', 'G15', 'G16']].iloc[:106,:])
Gscore = np.array(Gscore)
for i, itemi in enumerate(Gscore):
for j, itemj in enumerate(itemi):
print(itemj)
if itemj.strip() != '':
Gscore[i,j] = np.float64(itemj)
else:
Gscore[i, j] = np.nan
Gscore = pd.DataFrame(Gscore)
Gscore = np.sum(Gscore, axis=1).describe()
describe_panasstotol_206 = scale_data_206.groupby('group')['PANSStotal1'].describe()
describe_age_206 = scale_data_206.groupby('group')['age'].describe()
scale_data_206['duration'] = np.array([np.float64(duration) if duration.strip() !='' else 0 for duration in scale_data_206['duration'].values])
describe_duration_206 = scale_data_206.groupby('group')['duration'].describe()
describe_sex_206 = scale_data_206.groupby('group')['sex'].value_counts()
#%% -------------------------COBRE----------------------------------
# Inputs
matroot = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Data\SelectedFC_COBRE' # all mat files directory
scale = r'H:\Data\精神分裂症\COBRE\COBRE_phenotypic_data.csv' # whole scale path
# Transform the .mat files to one .npy file
allmatname = os.listdir(matroot)
# Give labels to each subject, concatenate at the first column
allmatname = pd.DataFrame(allmatname)
allsubjname = allmatname.iloc[:,0].str.findall(r'[1-9]\d*')
allsubjname = pd.DataFrame([name[0] for name in allsubjname])
scale_data = pd.read_csv(scale,sep=',',dtype='str')
print(scale_data)
diagnosis = pd.merge(allsubjname,scale_data,left_on=0,right_on='ID')[['ID','Subject Type']]
scale_data = pd.merge(allsubjname,scale_data,left_on=0,right_on='ID')
diagnosis['Subject Type'][diagnosis['Subject Type'] == 'Control'] = 0
diagnosis['Subject Type'][diagnosis['Subject Type'] == 'Patient'] = 1
include_loc = diagnosis['Subject Type'] != 'Disenrolled'
diagnosis = diagnosis[include_loc.values]
allsubjname = allsubjname[include_loc.values]
scale_data_COBRE = pd.merge(allsubjname, scale_data, left_on=0, right_on=0, how='inner').iloc[:,[0,1,2,3,5]]
scale_data_COBRE['Gender'] = scale_data_COBRE['Gender'].str.replace('Female', '0')
scale_data_COBRE['Gender'] = scale_data_COBRE['Gender'].str.replace('Male', '1')
scale_data_COBRE['Subject Type'] = scale_data_COBRE['Subject Type'].str.replace('Patient', '1')
scale_data_COBRE['Subject Type'] = scale_data_COBRE['Subject Type'].str.replace('Control', '0')
scale_data_COBRE = pd.DataFrame(scale_data_COBRE, dtype=np.float64)
describe_age_COBRE = scale_data_COBRE.groupby('Subject Type')['Current Age'].describe()
describe_sex_COBRE = scale_data_COBRE.groupby('Subject Type')['Gender'].value_counts()
#%% -------------------------UCLA----------------------------------
matroot = r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Data\SelectedFC_UCLA'
scale = r'H:\Data\精神分裂症\ds000030\schizophrenia_UCLA_restfmri\participants.tsv'
allmatname = os.listdir(matroot)
allmatname = pd.DataFrame(allmatname)
allsubjname = allmatname.iloc[:,0].str.findall(r'[1-9]\d*')
allsubjname = pd.DataFrame(['sub-' + name[0] for name in allsubjname])
scale_data = pd.read_csv(scale,sep='\t')
scale_data_UCAL = pd.merge(allsubjname,scale_data,left_on=0,right_on='participant_id')
scale_data_UCAL['diagnosis'][scale_data_UCAL['diagnosis'] == 'CONTROL']=0
scale_data_UCAL['diagnosis'][scale_data_UCAL['diagnosis'] == 'SCHZ']=1
scale_data_UCAL['participant_id'] = scale_data_UCAL['participant_id'].str.replace('sub-', '')
scale_data_UCAL = pd.merge(allsubjname,scale_data_UCAL, left_on=0, right_on=0, how='inner')
scale_data_UCAL = scale_data_UCAL.iloc[:,[2,3,4]]
scale_data_UCAL['gender'] = scale_data_UCAL['gender'].str.replace('m', '1')
scale_data_UCAL['gender'] = scale_data_UCAL['gender'].str.replace('f', '0')
scale_data_UCAL = pd.DataFrame(scale_data_UCAL, dtype=np.float64)
describe_age_UCAL = scale_data_UCAL.groupby('diagnosis')['age'].describe()
describe_sex_UCAL = scale_data_UCAL.groupby('diagnosis')['gender'].value_counts()
#%%-------------------------------------------------------------------- |
dongmengshi/easylearn | eslearn/utils/clustering_for_alff.py | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 11 14:15:10 2018
@author: lenovo
"""
import lc_copy_selected_file_V6 as copy
import sys
import pandas as pd
# files
label_path = r'D:\WorkStation_2018\WorkStation_2018_11_machineLearning_Psychosi_ALFF\Data\new\label.xlsx'
scale_path = r'D:\WorkStation_2018\WorkStation_2018_11_machineLearning_Psychosi_ALFF\Data\new\大表.xlsx'
# load
scale = pd.read_excel(scale_path)
label = pd.read_excel(label_path)
# label folder
label_a = label['folder'][label['new'] == 'a']
label_c = label['folder'][label['new'] == 'c']
label_bde = pd.concat([
label['folder'][label['new'] == 'b'],
label['folder'][label['new'] == 'd'],
label['folder'][label['new'] == 'e']
], axis=0)
# cov of label folder
cov_a = pd.DataFrame(label_a).merge(scale, on='folder', how='inner')
cov_a = cov_a[['folder', '年龄', '性别']].dropna()
cov_c = pd.DataFrame(label_c).merge(scale, on='folder', how='inner')
cov_c = cov_c[['folder', '年龄', '性别']].dropna()
cov_bde = pd.DataFrame(label_bde).merge(scale, on='folder', how='inner')
cov_bde = cov_bde[['folder', '年龄', '性别']].dropna()
hc = scale[scale['诊断'] == 1]
hc = hc[['folder', '年龄', '性别']]
hc = hc.iloc[:, [0, 1, 2]]
hc = hc.dropna()
# save folder and cov
cov_a['folder'].to_excel('folder_a.xlsx', index=False, header=False)
cov_c['folder'].to_excel('folder_c.xlsx', index=False, header=False)
cov_bde['folder'].to_excel('folder_bde.xlsx', index=False, header=False)
cov_a[['年龄', '性别']].to_csv('cov_a.txt', index=False, header=False, sep=' ')
cov_c[['年龄', '性别']].to_csv('cov_c.txt', index=False, header=False, sep=' ')
cov_bde[['年龄', '性别']].to_csv('cov_bde.txt', index=False, header=False, sep=' ')
# copy
sys.path.append(
r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Utils')
path = r'D:\WorkStation_2018\WorkStation_2018_11_machineLearning_Psychosi_ALFF\Data\new'
folder = r'D:\WorkStation_2018\WorkStation_2018_11_machineLearning_Psychosi_ALFF\Data\new\folder_a.xlsx'
save_path = r'D:\WorkStation_2018\WorkStation_2018_11_machineLearning_Psychosi_ALFF\Data\new\ALFF_a'
sel = copy.copy_fmri(
referencePath=folder,
regularExpressionOfsubjName_forReference='([1-9]\d*)',
ith_reference=0,
folderNameContainingFile_forSelect='',
num_countBackwards=1,
regularExpressionOfSubjName_forNeuroimageDataFiles='([1-9]\d*)',
ith_subjName=0,
keywordThatFileContain='^mALFF',
neuroimageDataPath=path,
savePath=save_path,
n_processess=6,
ifSaveLog=1,
ifCopy=1,
ifMove=0,
saveInToOneOrMoreFolder='saveToOneFolder',
saveNameSuffix='',
ifRun=1)
result = sel.main_run()
results = result.__dict__
print(results.keys())
print('Done!')
|
dongmengshi/easylearn | eslearn/machine_learning/neural_network/gca_classfication.py | import os
import urllib
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
import torch.utils.data as data
import numpy as np
import scipy.sparse as sp
from zipfile import ZipFile
from sklearn.model_selection import train_test_split
import pickle
import pandas as pd
import torch_scatter
import torch.optim as optim
one
def normalization(adjacency):
"""计算 L=D^-0.5 * (A+I) * D^-0.5,
Args:
adjacency: sp.csr_matrix.
Returns:
归一化后的邻接矩阵,类型为 torch.sparse.FloatTensor
"""
adjacency += sp.eye(adjacency.shape[0]) # 增加自连接
degree = np.array(adjacency.sum(1))
d_hat = sp.diags(np.power(degree, -0.5).flatten())
L = d_hat.dot(adjacency).dot(d_hat).tocoo()
# 转换为 torch.sparse.FloatTensor
indices = torch.from_numpy(np.float32(np.asarray([L.row, L.col]))).long()
values = torch.from_numpy(L.data.astype(np.float32))
tensor_adjacency = torch.sparse.FloatTensor(indices, values, L.shape)
return tensor_adjacency
def tensor_from_numpy(nd, DEVICE):
td = torch.from_numpy(np.float32(np.asarray(nd))).long().to(DEVICE)
return td
def filter_adjacency(adjacency, mask):
"""根据掩码mask对图结构进行更新
Args:
adjacency: torch.sparse.FloatTensor, 池化之前的邻接矩阵
mask: torch.Tensor(dtype=torch.bool), 节点掩码向量
Returns:
torch.sparse.FloatTensor, 池化之后归一化邻接矩阵
"""
device = adjacency.device
mask = mask.cpu().numpy()
indices = adjacency.coalesce().indices().cpu().numpy()
num_nodes = adjacency.size(0)
row, col = indices
maskout_self_loop = row != col
row = row[maskout_self_loop]
col = col[maskout_self_loop]
sparse_adjacency = sp.csr_matrix((np.ones(len(row)), (row, col)),
shape=(num_nodes, num_nodes), dtype=np.float32)
filtered_adjacency = sparse_adjacency[mask, :][:, mask]
return normalization(filtered_adjacency).to(device)
def global_max_pool(x, graph_indicator):
num = graph_indicator.max().item() + 1
return torch_scatter.scatter_max(x, graph_indicator, dim=0, dim_size=num)[0]
def global_avg_pool(x, graph_indicator):
num = graph_indicator.max().item() + 1
return torch_scatter.scatter_mean(x, graph_indicator, dim=0, dim_size=num)
class GraphConvolution(nn.Module):
def __init__(self, input_dim, output_dim, use_bias=True):
"""图卷积:L*X*\theta
Args:
----------
input_dim: int
节点输入特征的维度
output_dim: int
输出特征维度
use_bias : bool, optional
是否使用偏置
"""
super(GraphConvolution, self).__init__()
self.input_dim = input_dim
self.output_dim = output_dim
self.use_bias = use_bias
self.weight = nn.Parameter(torch.Tensor(input_dim, output_dim))
if self.use_bias:
self.bias = nn.Parameter(torch.Tensor(output_dim))
else:
self.register_parameter('bias', None)
self.reset_parameters()
def reset_parameters(self):
init.kaiming_uniform_(self.weight)
if self.use_bias:
init.zeros_(self.bias)
def forward(self, adjacency, input_feature):
"""邻接矩阵是稀疏矩阵,因此在计算时使用稀疏矩阵乘法"""
support = torch.mm(input_feature, self.weight)
output = torch.sparse.mm(adjacency, support)
if self.use_bias:
output += self.bias
return output
def __repr__(self):
return self.__class__.__name__ + ' (' \
+ str(self.input_dim) + ' -> ' \
+ str(self.output_dim) + ')'
class SelfAttentionPooling(nn.Module):
def __init__(self, input_dim, keep_ratio, activation=torch.tanh):
super(SelfAttentionPooling, self).__init__()
self.input_dim = input_dim
self.keep_ratio = keep_ratio
self.activation = activation
self.attn_gcn = GraphConvolution(input_dim, 1)
def forward(self, adjacency, input_feature, graph_indicator):
attn_score = self.attn_gcn(adjacency, input_feature).squeeze()
attn_score = self.activation(attn_score)
mask = top_rank(attn_score, graph_indicator, self.keep_ratio)
hidden = input_feature[mask] * attn_score[mask].view(-1, 1)
mask_graph_indicator = graph_indicator[mask]
mask_adjacency = filter_adjacency(adjacency, mask)
return hidden, mask_graph_indicator, mask_adjacency
def top_rank(attention_score, graph_indicator, keep_ratio):
"""基于给定的attention_score, 对每个图进行pooling操作.
为了直观体现pooling过程,我们将每个图单独进行池化,最后再将它们级联起来进行下一步计算
Arguments:
----------
attention_score:torch.Tensor
使用GCN计算出的注意力分数,Z = GCN(A, X)
graph_indicator:torch.Tensor
指示每个节点属于哪个图
keep_ratio: float
要保留的节点比例,保留的节点数量为int(N * keep_ratio)
"""
# TODO: 确认是否是有序的, 必须是有序的
graph_id_list = list(set(graph_indicator.cpu().numpy()))
mask = attention_score.new_empty((0,), dtype=torch.bool)
for graph_id in graph_id_list:
graph_attn_score = attention_score[graph_indicator == graph_id]
graph_node_num = len(graph_attn_score)
graph_mask = attention_score.new_zeros((graph_node_num,),
dtype=torch.bool)
keep_graph_node_num = int(keep_ratio * graph_node_num)
_, sorted_index = graph_attn_score.sort(descending=True)
graph_mask[sorted_index[:keep_graph_node_num]] = True
mask = torch.cat((mask, graph_mask))
return mask
class ModelA(nn.Module):
def __init__(self, input_dim, hidden_dim, num_classes=2):
"""图分类模型结构A
Args:
----
input_dim: int, 输入特征的维度
hidden_dim: int, 隐藏层单元数
num_classes: 分类类别数 (default: 2)
"""
super(ModelA, self).__init__()
self.input_dim = input_dim
self.hidden_dim = hidden_dim
self.num_classes = num_classes
self.gcn1 = GraphConvolution(input_dim, hidden_dim)
self.gcn2 = GraphConvolution(hidden_dim, hidden_dim)
self.gcn3 = GraphConvolution(hidden_dim, hidden_dim)
self.pool = SelfAttentionPooling(hidden_dim * 3, 0.5)
self.fc1 = nn.Linear(hidden_dim * 3 * 2, hidden_dim)
self.fc2 = nn.Linear(hidden_dim, hidden_dim // 2)
self.fc3 = nn.Linear(hidden_dim // 2, num_classes)
def forward(self, adjacency, input_feature, graph_indicator):
gcn1 = F.relu(self.gcn1(adjacency, input_feature))
gcn2 = F.relu(self.gcn2(adjacency, gcn1))
gcn3 = F.relu(self.gcn3(adjacency, gcn2))
gcn_feature = torch.cat((gcn1, gcn2, gcn3), dim=1)
pool, pool_graph_indicator, pool_adjacency = self.pool(adjacency, gcn_feature,
graph_indicator)
readout = torch.cat((global_avg_pool(pool, pool_graph_indicator),
global_max_pool(pool, pool_graph_indicator)), dim=1)
fc1 = F.relu(self.fc1(readout))
fc2 = F.relu(self.fc2(fc1))
logits = self.fc3(fc2)
return logits
class ModelB(nn.Module):
def __init__(self, input_dim, hidden_dim, num_classes=2):
"""图分类模型结构
Arguments:
----------
input_dim {int} -- 输入特征的维度
hidden_dim {int} -- 隐藏层单元数
Keyword Arguments:
----------
num_classes {int} -- 分类类别数 (default: {2})
"""
super(ModelB, self).__init__()
self.input_dim = input_dim
self.hidden_dim = hidden_dim
self.num_classes = num_classes
self.gcn1 = GraphConvolution(input_dim, hidden_dim)
self.pool1 = SelfAttentionPooling(hidden_dim, 0.5)
self.gcn2 = GraphConvolution(hidden_dim, hidden_dim)
self.pool2 = SelfAttentionPooling(hidden_dim, 0.5)
self.gcn3 = GraphConvolution(hidden_dim, hidden_dim)
self.pool3 = SelfAttentionPooling(hidden_dim, 0.5)
self.mlp = nn.Sequential(
nn.Linear(hidden_dim * 2, hidden_dim),
nn.ReLU(),
nn.Linear(hidden_dim, hidden_dim // 2),
nn.ReLU(),
nn.Linear(hidden_dim // 2, num_classes))
def forward(self, adjacency, input_feature, graph_indicator):
gcn1 = F.relu(self.gcn1(adjacency, input_feature))
pool1, pool1_graph_indicator, pool1_adjacency = \
self.pool1(adjacency, gcn1, graph_indicator)
global_pool1 = torch.cat(
[global_avg_pool(pool1, pool1_graph_indicator),
global_max_pool(pool1, pool1_graph_indicator)],
dim=1)
gcn2 = F.relu(self.gcn2(pool1_adjacency, pool1))
pool2, pool2_graph_indicator, pool2_adjacency = \
self.pool2(pool1_adjacency, gcn2, pool1_graph_indicator)
global_pool2 = torch.cat(
[global_avg_pool(pool2, pool2_graph_indicator),
global_max_pool(pool2, pool2_graph_indicator)],
dim=1)
gcn3 = F.relu(self.gcn3(pool2_adjacency, pool2))
pool3, pool3_graph_indicator, pool3_adjacency = \
self.pool3(pool2_adjacency, gcn3, pool2_graph_indicator)
global_pool3 = torch.cat(
[global_avg_pool(pool3, pool3_graph_indicator),
global_max_pool(pool3, pool3_graph_indicator)],
dim=1)
readout = global_pool1 + global_pool2 + global_pool3
logits = self.mlp(readout)
return logits
if __name__ == "__main__":
# Load data
import DDDataset
dataset = DDDataset.DDDataset()
# 模型输入数据准备
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
#所有图对应的大邻接矩阵
adjacency = dataset.sparse_adjacency
#归一化、引入自连接的拉普拉斯矩阵
normalize_adjacency = normalization(adjacency).to(DEVICE)
# numpy to tensor
#所有节点的特征标签
node_labels = tensor_from_numpy(dataset.node_labels, DEVICE)
#每个节点对应哪个图
graph_indicator = tensor_from_numpy(dataset.graph_indicator, DEVICE)
#每个图的类别标签
graph_labels = tensor_from_numpy(dataset.graph_labels, DEVICE)
#训练集对应的图索引
train_index = tensor_from_numpy(dataset.train_index, DEVICE)
#测试集对应的图索引
test_index = tensor_from_numpy(dataset.test_index, DEVICE)
#训练集和测试集中的图对应的类别标签
train_label = tensor_from_numpy(dataset.train_label, DEVICE)
test_label = tensor_from_numpy(dataset.test_label, DEVICE)
#把特征标签转换为one-hot特征向量
node_features = F.one_hot(node_labels, node_labels.max().item() + 1).float()
# 超参数设置
INPUT_DIM = node_features.size(1) #特征向量维度
NUM_CLASSES = 2
EPOCHS = 5 # @param {type: "integer"}
HIDDEN_DIM = 32 # @param {type: "integer"}
LEARNING_RATE = 0.01 # @param
WEIGHT_DECAY = 0.0001 # @param
# 模型初始化
model_g = ModelA(INPUT_DIM, HIDDEN_DIM, NUM_CLASSES).to(DEVICE)
model_h = ModelB(INPUT_DIM, HIDDEN_DIM, NUM_CLASSES).to(DEVICE)
model = model_h #@param ['model_g', 'model_h'] {type: 'raw'}
# Training
criterion = nn.CrossEntropyLoss().to(DEVICE) #交叉熵损失函数
#Adam优化器
optimizer = optim.Adam(model.parameters(), LEARNING_RATE, weight_decay=WEIGHT_DECAY)
model.train() #训练模式
for epoch in range(EPOCHS):
logits = model(normalize_adjacency, node_features, graph_indicator) #对所有数据(图)前向传播 得到输出
loss = criterion(logits[train_index], train_label) # 只对训练的数据计算损失值
optimizer.zero_grad()
loss.backward() # 反向传播计算参数的梯度
optimizer.step() # 使用优化方法进行梯度更新
#训练集准确率
train_acc = torch.eq(
logits[train_index].max(1)[1], train_label).float().mean()
print("Epoch {:03d}: Loss {:.4f}, TrainAcc {:.4}".format(
epoch, loss.item(), train_acc.item()))
# Test
model.eval() #测试模式
with torch.no_grad(): #关闭求导
logits = model(normalize_adjacency, node_features, graph_indicator)#所有数据前向传播
test_logits = logits[test_index] #取出测试数据对应的输出
#计算测试数据准确率
test_acc = torch.eq(
test_logits.max(1)[1], test_label
).float().mean()
print(test_acc.item())
|
dongmengshi/easylearn | eslearn/machine_learning/classfication/decorator.py | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 22:45:12 2019
@author: lenovo
"""
def my_reshape(func):
def wrapper(*args, **kwargs):
args=[ar[1] for ar in args]
return func(*args, **kwargs)
return wrapper
@my_reshape
def say_hello(a,b):
print(a+b)
if __name__ == "__main__":
say_hello('aa','bb')
|
dongmengshi/easylearn | eslearn/machine_learning/classfication/classification_test.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 15 17:02:33 2020
@author: lenovo
"""
# AdaBoost
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
from sklearn.datasets import load_iris
from sklearn.ensemble import AdaBoostClassifier
X, y = load_iris(return_X_y=True)
base_clf = LogisticRegression(C=1.)
clf = AdaBoostClassifier(base_estimator=base_clf, n_estimators=100)
scores = cross_val_score(clf, X, y, cv=5)
scores.mean()
# # Ridge classification
# from sklearn.datasets import load_breast_cancer
# from sklearn.linear_model import RidgeClassifier
# X, y = load_breast_cancer(return_X_y=True)
# clf = RidgeClassifier().fit(X, y)
# clf.score(X, y)
# LogisticRegression
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
X, y = make_classification(n_classes=3, n_informative=5, n_redundant=0, random_state=42)
clf = LogisticRegression(random_state=0).fit(X, y)
clf.predict(X[:2, :])
clf.predict_proba(X[:2, :])
clf.score(X, y)
|
dongmengshi/easylearn | eslearn/visualization/lc_clusterhotmap.py | <gh_stars>10-100
# utf-8
"""
聚类热图
"""
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
data = pd.read_excel(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python\Plot\data.xlsx')
data.index = data.iloc[:,0]
data = data.iloc[:,2:]
clname = list(data.columns)
data = data[['q_A',
'q_A_unmedicated',
'q_A_medicated',
'q_B',
'q_B_unmedicated',
'q_B_medicated',
'q_C',
'q_C_unmedicated',
'q_C_medicated',]]
#data=data.iloc[0:20:,:]
data.to_csv('D:/data.txt')
# 绘制x-y-z的热力图,比如 年-月-销量 的聚类热图
g = sns.heatmap(data.values, linewidths=None)
g = sns.clustermap(data, figsize=(6,9), cmap='YlGnBu', col_cluster=False, standard_scale = 0)
ax = g.ax_heatmap
label_y = ax.get_yticklabels()
plt.setp(label_y, fontsize=10, rotation=360, horizontalalignment='left')
label_x = ax.get_xticklabels()
plt.setp(label_x, fontsize=15, rotation=90)
#设置图片名称,分辨率,并保存
# plt.savefig(r'D:\cluster1.tif', dpi = 600, bbox_inches = 'tight')
plt.show()
|
dongmengshi/easylearn | eslearn/utils/read_sav.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 10 09:26:39 2019
@author: lenovo
"""
import pandas as pd
s = pd.read_excel('02_18大表(REST).xlsx')
s1 = s[['folder', '诊断']]
s_hc = s1[s1['诊断'] == 1]
s_hc['folder'].to_excel('HC.xlsx', header=False, index=False)
s_hc = s1[s1['诊断'] == 2]
s_hc['folder'].to_excel('MDD.xlsx', header=False, index=False)
s_hc = s1[s1['诊断'] == 3]
s_hc['folder'].to_excel('SZ.xlsx', header=False, index=False)
s_hc = s1[s1['诊断'] == 4]
s_hc['folder'].to_excel('BD.xlsx', header=False, index=False)
|
dongmengshi/easylearn | eslearn/utils/fetch_kfoldidx.py | # -*- coding: utf-8 -*-
"""
Created on Wed May 15 22:48:39 2019
@author: lenovo
"""
import numpy as np
from sklearn.model_selection import KFold
def fetch_kFold_Index_for_allLabel(x, y, outer_k, seed):
"""分别从每个label对应的数据中,进行kFole选择,
然后把某个fold的数据组合成一个大的fold数据
"""
uni_y = np.unique(y)
loc_uni_y = [np.argwhere(y == uni) for uni in uni_y]
train_index, test_index = [], []
for y_ in loc_uni_y:
tr_index, te_index = fetch_kfold_idx_for_onelabel(y_, outer_k, seed)
train_index.append(tr_index)
test_index.append(te_index)
indexTr_fold = []
indexTe_fold = []
for k_ in range(outer_k):
indTr_fold = np.array([])
indTe_fold = np.array([])
for y_ in range(len(uni_y)):
indTr_fold = np.append(indTr_fold, train_index[y_][k_])
indTe_fold = np.append(indTe_fold, test_index[y_][k_])
indexTr_fold.append(indTr_fold)
indexTe_fold.append(indTe_fold)
index_train, index_test = [], []
for I in indexTr_fold:
index_train.append([int(i) for i in I])
for I in indexTe_fold:
index_test.append([int(i) for i in I])
return index_train, index_test
def fetch_kfold_idx_for_onelabel(originLable, outer_k, seed):
"""获得对某一个类的数据的kfold index"""
np.random.seed(seed)
kf = KFold(n_splits=outer_k)
train_index, test_index = [], []
for tr_index, te_index in kf.split(originLable):
train_index.append(originLable[tr_index]), \
test_index.append(originLable[te_index])
return train_index, test_index
def fetch_kfold_idx_for_alllabel_LOOCV(y):
"""generate index for leave one out cross validation"""
index_test = list(np.arange(0, len(y), 1))
index_train = [list(set(np.arange(0, len(y), 1)) - set([i]))
for i in np.arange(0, len(y), 1)]
return index_train, index_test |
dongmengshi/easylearn | eslearn/utils/copy_test.py | <filename>eslearn/utils/copy_test.py
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 30 13:05:28 2018:
在版本3的基础上,根据pandas的join方法来求交集
根据从量表中筛选的样本,来获得符合要求的原始数据的路径
数据结构neuroimageDataPath//subject00001//files
也可以是任何的数据结构,只要给定subjName在哪里就行
总之,最后把file复制到其他地方(可以限定某个file)
input:
#1 referencePath:需要复制的被试名字所在text文件(大表中的folder)
#2 regularExpressionOfsubjName_forReference:如提取量表中subjName的正则表达式
ith: 量表中的subjName有多个匹配项时,选择第几个
#3 folderNameContainingFile_forSelect:想把被试的哪个模态/或那个文件夹下的文件复制出来(如同时有'resting'和'dti'时,选择那个模态)
#4 num_countBackwards:subjName在倒数第几个block内(第一个计数为1)
# 如'D:\myCodes\workstation_20180829_dynamicFC\FunImgARW\1-500\00002_resting\dti\dic.txt'
# 的subjName在倒数第3个中
#5 regularExpressionOfSubjName_forNeuroimageDataFiles:用来筛选mri数据中subject name字符串的正则表达式
ith_subjName: 当subject name中有多个字符串匹配时,选择第几个(默认第一个)
#6 keywordThatFileContain:用来筛选file的正则表达式或keyword
#7 neuroimageDataPath:原始数据的根目录
#8 savePath: 将原始数据copy到哪个大路径
# n_processess=5几个线程
#9 ifSaveLog:是否保存复制log
#10 ifCopy:是否执行复制功能
#11 ifMove:是否移动(0)
#12 saveInToOneOrMoreFolder:保存到每个被试文件夹下,还是保存到一个文件夹下
#13 saveNameSuffix:文件保存的尾缀('.nii')
#14 ifRun:是否真正对文件执行移动或复制(0)
# 总体来说被复制的文件放在如下的路径:savePath/saveFolderName/subjName/files
@author: <NAME>
new featrue:真多核多线程处理,类的函数统一返回sel
匹配file name:正则表达式匹配
"""
# =========================================================================
# import
import multiprocessing
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import numpy as np
import pandas as pd
import time
import os
import shutil
import sys
sys.path.append(r'D:\myCodes\MVPA_LIChao\MVPA_Python\workstation')
# =========================================================================
# def
class copy_fmri():
def __init__(
sel,
referencePath=r'E:\wangfeidata\folder.txt',
regularExpressionOfsubjName_forReference='([1-9]\d*)',
ith_reference=0,
folderNameContainingFile_forSelect='',
num_countBackwards=2,
regularExpressionOfSubjName_forNeuroimageDataFiles='([1-9]\d*)',
ith_subjName=0,
keywordThatFileContain='nii',
neuroimageDataPath=r'E:\wangfeidata\FunImgARWD',
savePath=r'E:\wangfeidata',
n_processess=2,
ifSaveLog=1,
ifCopy=0,
ifMove=0,
saveInToOneOrMoreFolder='saveToEachSubjFolder',
saveNameSuffix='.nii',
ifRun=0):
# =========================================================================
sel.referencePath = referencePath
sel.regularExpressionOfsubjName_forReference = regularExpressionOfsubjName_forReference
sel.ith_reference = ith_reference
sel.folderNameContainingFile_forSelect = folderNameContainingFile_forSelect
sel.num_countBackwards = num_countBackwards
sel.regularExpressionOfSubjName_forNeuroimageDataFiles = regularExpressionOfSubjName_forNeuroimageDataFiles
sel.ith_subjName = ith_subjName
sel.keywordThatFileContain = keywordThatFileContain
sel.neuroimageDataPath = neuroimageDataPath
sel.savePath = savePath
sel.n_processess = n_processess
sel.ifSaveLog = ifSaveLog
sel.ifCopy = ifCopy
sel.ifMove = ifMove
sel.saveInToOneOrMoreFolder = saveInToOneOrMoreFolder
sel.saveNameSuffix = saveNameSuffix
sel.ifRun = ifRun
# 核对参数信息
if sel.ifCopy == 1 & sel.ifMove == 1:
print('### Cannot copy and move at the same time! ###\n')
print('### please press Ctrl+C to close the progress ###\n')
# 新建结果保存文件夹
if not os.path.exists(sel.savePath):
os.makedirs(sel.savePath)
# 读取referencePath(excel or text)
try:
sel.subjName_forSelect = pd.read_excel(
sel.referencePath, dtype='str', header=None, index=None)
except BaseException:
sel.subjName_forSelect = pd.read_csv(
sel.referencePath, dtype='str', header=None)
#
print('###提取subjName_forSelect中的匹配成分,默认为数字###\n###当有多个匹配时默认是第1个###\n')
# ith_reference=sel.ith_reference
# sel.ith_reference=0
if sel.regularExpressionOfsubjName_forReference:
sel.subjName_forSelect = sel.subjName_forSelect.iloc[:, 0]\
.str.findall('[1-9]\d*')
sel.subjName_forSelect = [sel.subjName_forSelect_[sel.ith_reference]
for sel.subjName_forSelect_ in
sel.subjName_forSelect
if len(sel.subjName_forSelect_)]
# ===================================================================
def walkAllPath(sel):
sel.allWalkPath = os.walk(sel.neuroimageDataPath)
# allWalkPath=[allWalkPath_ for allWalkPath_ in allWalkPath]
return sel
def fetch_allFilePath(sel):
sel.allFilePath = []
for onePath in sel.allWalkPath:
for oneFile in onePath[2]:
path = os.path.join(onePath[0], oneFile)
sel.allFilePath.append(path)
return sel
def fetch_allSubjName(sel):
'''
num_countBackwards:subjName在倒数第几个block内(第一个计数为1)
# 如'D:\myCodes\workstation_20180829_dynamicFC\FunImgARW\1-500\00002_resting\dti\dic.txt'
# 的subjName在倒数第3个中
'''
sel.allSubjName = sel.allFilePath
for i in range(sel.num_countBackwards - 1):
sel.allSubjName = [os.path.dirname(
allFilePath_) for allFilePath_ in sel.allSubjName]
sel.allSubjName = [os.path.basename(
allFilePath_) for allFilePath_ in sel.allSubjName]
sel.allSubjName = pd.DataFrame(sel.allSubjName)
sel.allSubjName_raw = sel.allSubjName
return sel
def fetch_folerNameContainingFile(sel):
'''
如果file上一级folder不是subject name,那么就涉及到选择那个文件夹下的file
此时先确定每一个file上面的folder name(可能是模态名),然后根据你的关键词来筛选
'''
sel.folerNameContainingFile = [os.path.dirname(
allFilePath_) for allFilePath_ in sel.allFilePath]
sel.folerNameContainingFile = [os.path.basename(
folderName) for folderName in sel.folerNameContainingFile]
return sel
def fetch_allFileName(sel):
'''
获取把所有file name,用于后续的筛选。
适用场景:假如跟file一起的有我们不需要的file,
比如混杂在dicom file中的有text文件,而这些text是我们不想要的。
'''
sel.allFileName = [os.path.basename(
allFilePath_) for allFilePath_ in sel.allFilePath]
return sel
# ===================================================================
def screen_pathLogicalLocation_accordingTo_yourSubjName(sel):
# 匹配subject name:注意此处用精确匹配,只有完成匹配时,才匹配成功
# maker sure subjName_forSelect is pd.Series and its content is string
if isinstance(sel.subjName_forSelect, type(pd.DataFrame([1]))):
sel.subjName_forSelect = sel.subjName_forSelect.iloc[:, 0]
if not isinstance(sel.subjName_forSelect[0], str):
sel.subjName_forSelect = pd.Series(
sel.subjName_forSelect, dtype='str')
# 一定要注意匹配对之间的数据类型要一致!!!
try:
# 提取所有被试的folder
# sel.logic_index_subjname=\
# np.sum(
# pd.DataFrame(
# [sel.allSubjName.iloc[:,0].str.contains\
# (name_for_sel) for name_for_sel in sel.subjName_forSelect]
# ).T,
# axis=1)
#
# sel.logic_index_subjname=sel.logic_index_subjname>=1
sel.allSubjName = sel.allSubjName.iloc[:, 0].str.findall(
sel.regularExpressionOfSubjName_forNeuroimageDataFiles)
# 正则表达提取后,可能有的不匹配而为空list,此时应该把空list当作不匹配而去除
allSubjName_temp = []
# sel.ith_subjName=1
for name in sel.allSubjName.values:
if name:
allSubjName_temp.append(name[sel.ith_subjName])
else:
allSubjName_temp.append(None)
sel.allSubjName = allSubjName_temp
sel.allSubjName = pd.DataFrame(sel.allSubjName)
sel.subjName_forSelect = pd.DataFrame(sel.subjName_forSelect)
sel.logic_index_subjname = pd.DataFrame(
np.zeros(len(sel.allSubjName)) == 1)
for i in range(len(sel.subjName_forSelect)):
sel.logic_index_subjname = sel.logic_index_subjname.mask(
sel.allSubjName == sel.subjName_forSelect.iloc[i, 0], True)
except BaseException:
print('subjName mismatch subjName_forSelected!\nplease check their type')
sys.exit(0)
return sel
def screen_pathLogicalLocation_accordingTo_folerNameContainingFile(sel):
# 匹配folerNameContainingFile:注意此处用的连续模糊匹配,只要含有这个关键词,则匹配
if sel.folderNameContainingFile_forSelect:
sel.logic_index_foler_name_containing_file = [
sel.folderNameContainingFile_forSelect in oneName_ for oneName_ in sel.folerNameContainingFile]
sel.logic_index_foler_name_containing_file = pd.DataFrame(
sel.logic_index_foler_name_containing_file)
else:
sel.logic_index_foler_name_containing_file = np.ones(
[len(sel.folerNameContainingFile), 1]) == 1
sel.logic_index_foler_name_containing_file = pd.DataFrame(
sel.logic_index_foler_name_containing_file)
return sel
def screen_pathLogicalLocation_accordingTo_fileName(sel):
# 匹配file name:正则表达式匹配
if sel.keywordThatFileContain:
sel.allFileName = pd.Series(sel.allFileName)
sel.logic_index_file_name = sel.allFileName.str.contains(
sel.keywordThatFileContain)
else:
sel.logic_index_file_name = np.ones([len(sel.allFileName), 1]) == 1
sel.logic_index_file_name = pd.DataFrame(sel.logic_index_file_name)
return sel
def fetch_totalLogicalLocation(sel):
sel.logic_index_all = pd.concat(
[
sel.logic_index_file_name,
sel.logic_index_foler_name_containing_file,
sel.logic_index_subjname],
axis=1)
sel.logic_index_all = np.sum(
sel.logic_index_all,
axis=1) == np.shape(
sel.logic_index_all)[1]
return sel
def fetch_selectedFilePath_accordingPathLogicalLocation(sel):
# path
sel.allFilePath = pd.DataFrame(sel.allFilePath)
sel.allSelectedFilePath = sel.allFilePath[sel.logic_index_all]
sel.allSelectedFilePath = sel.allSelectedFilePath.dropna()
# folder name
sel.allSubjName = pd.DataFrame(sel.allSubjName)
sel.allSelectedSubjName = sel.allSubjName[sel.logic_index_all]
sel.allSelectedSubjName = sel.allSelectedSubjName.dropna()
# raw name
sel.allSubjName_raw = pd.DataFrame(sel.allSubjName_raw)
sel.allSelectedSubjName_raw = sel.allSubjName_raw[sel.logic_index_all]
sel.allSelectedSubjName_raw = sel.allSelectedSubjName_raw.dropna()
return sel
# ===================================================================
def copy_allDicomsOfOneSubj(sel, i, subjName):
n_allSelectedSubj = len(np.unique(sel.allSelectedSubjName_raw))
# print('Copying the {}/{}th subject: {}...'.format(i+1,n_allSelectedSubj,subjName))
# 每个file保存到每个subjxxx文件夹下面
if sel.saveInToOneOrMoreFolder == 'saveToEachSubjFolder':
output_folder = os.path.join(sel.savePath, subjName)
# 新建subjxxx文件夹
if not os.path.exists(output_folder):
os.makedirs(output_folder)
# 所有file保存到一个folder下面(file的名字以subjxxx命名)
elif sel.saveInToOneOrMoreFolder == 'saveToOneFolder':
output_folder = os.path.join(
sel.savePath, subjName + sel.saveNameSuffix)
# copying OR moving OR do nothing
fileIndex = sel.allSelectedSubjName_raw[(
sel.allSelectedSubjName_raw.values == subjName)].index.tolist()
if sel.ifCopy == 1 and sel.ifMove == 0:
[shutil.copy(sel.allSelectedFilePath.loc[fileIndex_, :][0],
output_folder) for fileIndex_ in fileIndex]
elif sel.ifCopy == 0 and sel.ifMove == 1:
[shutil.move(sel.allSelectedFilePath.loc[fileIndex_, :][0],
output_folder) for fileIndex_ in fileIndex]
elif sel.ifCopy == 0 and sel.ifMove == 0:
print('### No copy and No move ###\n')
else:
print('### Cannot copy and move at the same time! ###\n')
print('Copy the {}/{}th subject: {} OK!\n'.format(i + \
1, n_allSelectedSubj, subjName))
#
def copy_allDicomsOfAllSubj_multiprocess(sel):
s = time.time()
# 每个file保存到每个subjxxx文件夹下面
if sel.saveInToOneOrMoreFolder == 'saveToEachSubjFolder':
pass
elif sel.saveInToOneOrMoreFolder == 'saveToOneFolder':
pass
else:
print(
"###没有指定复制到一个文件夹还是每个被试文件夹###\n###{}跟'saveToOneFolder' OR 'saveToEachSubjFolder'都不符合###".format(
sel.saveInToOneOrMoreFolder))
# 多线程
# unique的name
uniSubjName = sel.allSelectedSubjName_raw.iloc[:, 0].unique()
print('Copying...\n')
# 单线程
# for i,subjName in enumerate(uniSubjName):
# sel.copy_allDicomsOfOneSubj(i,subjName)
# 多线程
cores = multiprocessing.cpu_count()
if sel.n_processess > cores:
sel.n_processess = cores - 1
with ThreadPoolExecutor(sel.n_processess) as executor:
for i, subjName in enumerate(uniSubjName):
task = executor.submit(
sel.copy_allDicomsOfOneSubj, i, subjName)
# print(task.done())
print('=' * 30)
#
e = time.time()
print('Done!\nRunning time is {:.1f} second'.format(e - s))
# ===================================================================
def main_run(sel):
# all path and name
sel = sel.walkAllPath()
sel = sel.fetch_allFilePath()
sel = sel.fetch_allSubjName()
sel = sel.fetch_allFileName()
# select
sel = sel.fetch_folerNameContainingFile()
# logicLoc_subjName:根据被试名字匹配所得到的logicLoc。以此类推。
# fileName≠subjName,比如fileName可以是xxx.nii,但是subjName可能是subjxxx
sel = sel.screen_pathLogicalLocation_accordingTo_yourSubjName()
sel = sel.screen_pathLogicalLocation_accordingTo_folerNameContainingFile()
sel = sel.screen_pathLogicalLocation_accordingTo_fileName()
sel = sel.fetch_totalLogicalLocation()
sel = sel.fetch_selectedFilePath_accordingPathLogicalLocation()
sel.unmatched_ref = \
pd.DataFrame(list(
set.difference(set(list(sel.subjName_forSelect.astype(np.int32).iloc[:, 0])),
set(list(sel.allSelectedSubjName.astype(np.int32).iloc[:, 0])))
)
)
print('=' * 50 + '\n')
print(
'Files that not found are : {}\n\nThey may be saved in:\n[{}]\n'.format(
sel.unmatched_ref.values,
sel.savePath))
print('=' * 50 + '\n')
# save for checking
if sel.ifSaveLog:
now = time.localtime()
now = time.strftime("%Y-%m-%d %H:%M:%S", now)
#
uniSubjName = sel.allSelectedSubjName.iloc[:, 0].unique()
uniSubjName = [uniSubjName_ for uniSubjName_ in uniSubjName]
uniSubjName = pd.DataFrame(uniSubjName)
sel.allSelectedFilePath.to_csv(
os.path.join(
sel.savePath,
'log_allSelectedFilePath.txt'),
index=False,
header=False)
allSelectedSubjPath = [os.path.dirname(
allSelectedFilePath_) for allSelectedFilePath_ in sel.allSelectedFilePath.iloc[:, 0]]
allSelectedSubjPath = pd.DataFrame(
allSelectedSubjPath).drop_duplicates()
allSelectedSubjPath.to_csv(
os.path.join(
sel.savePath,
'log_allSelectedSubjPath.txt'),
index=False,
header=False)
uniSubjName.to_csv(
os.path.join(
sel.savePath,
'log_allSelectedSubjName.txt'),
index=False,
header=False)
sel.unmatched_ref.to_csv(
os.path.join(
sel.savePath,
'log_unmatched_reference.txt'),
index=False,
header=False)
pd.unique(
sel.allSubjName).to_csv(
os.path.join(
sel.savePath,
'log_allSubjName.txt'),
index=False,
header=False)
#
f = open(os.path.join(sel.savePath, "log_copy_inputs.txt"), 'a')
f.write("\n\n")
f.write('====================' + now + '====================')
f.write("\n\n")
f.write("referencePath is: " + sel.referencePath)
f.write("\n\n")
f.write(
"folderNameContainingFile_forSelect are: " +
sel.folderNameContainingFile_forSelect)
f.write("\n\n")
f.write("num_countBackwards is: " + str(sel.num_countBackwards))
f.write("\n\n")
f.write("regularExpressionOfSubjName_forNeuroimageDataFiles is: " +
str(sel.regularExpressionOfSubjName_forNeuroimageDataFiles))
f.write("\n\n")
f.write("keywordThatFileContain is: " +
str(sel.keywordThatFileContain))
f.write("\n\n")
f.write("neuroimageDataPath is: " + sel.neuroimageDataPath)
f.write("\n\n")
f.write("savePath is: " + sel.savePath)
f.write("\n\n")
f.write("n_processess is: " + str(sel.n_processess))
f.write("\n\n")
f.close()
# copy
if sel.ifRun:
sel.copy_allDicomsOfAllSubj_multiprocess()
return sel
if __name__ == '__main__':
import copy_test as copy
path = r'J:\Research_2017go\GAD\Data_Raw\Patients_WithSleepDisorder'
folder = r'D:\My_Codes\LC_Machine_Learning\LC_Machine_learning-(Python)\Utils\subj_id.xlsx'
save_path = r'J:\Research_2017go\GAD\Data_Raw\test'
sel = copy.copy_fmri(
referencePath=folder,
regularExpressionOfsubjName_forReference='([1-9]\d*)',
ith_reference=0,
folderNameContainingFile_forSelect='T1W',
num_countBackwards=3,
regularExpressionOfSubjName_forNeuroimageDataFiles='([1-9]\d*)',
ith_subjName=1,
keywordThatFileContain='',
neuroimageDataPath=path,
savePath=save_path,
n_processess=6,
ifSaveLog=1,
ifCopy=1,
ifMove=0,
saveInToOneOrMoreFolder='saveToEachSubjFolder',
saveNameSuffix='',
ifRun=1)
result = sel.main_run()
# results=result.__dict__
# print(results.keys())
# print('Done!')
|
dongmengshi/easylearn | eslearn/stylesheets/PyQt5_stylesheets/PyQt5_stylesheets/pyqt5_style_Dark_rc.py | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.11.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x11\xcd\
\x00\
\x00\x6a\x18\x78\x9c\xcd\x1c\x6b\x73\xdb\x36\xf2\x7b\x66\xf2\x1f\
\x50\xe7\x4b\xd2\x93\x12\x3d\x22\x3f\x98\xe6\x66\x64\x5b\x8e\x35\
\x67\x5b\x8e\xa4\x24\xd7\xe9\x74\x3c\x94\x04\x59\x6c\x68\x92\x21\
\xa9\xd8\x6e\x26\xff\xfd\x16\x20\x40\x02\x04\xc0\x87\x64\xbb\xd7\
\x74\x9c\x98\x04\xf6\x8d\xc5\xee\x62\xc1\x37\xbf\x3e\x7f\x86\x7e\
\x45\xd3\x15\x46\xe7\xc3\x29\x3a\x73\xe6\xd8\x8b\x30\x7a\x09\xbf\
\xbc\x22\x6f\xe8\xdb\x23\x3f\xb8\x0f\x9d\xeb\x55\x8c\x5e\xce\x5f\
\xa1\xdf\x3a\xad\x76\xb7\x09\x3f\xde\xfe\x1b\xfd\x76\xe4\xbb\x8e\
\x87\x8e\xd7\xdf\xd6\x38\xf2\xfc\xfb\x7f\xa7\x73\x2e\x71\x78\xe3\
\x44\x91\xe3\x7b\xc8\x89\xd0\x0a\x87\x78\x76\x8f\xae\x43\xdb\x8b\
\xf1\xa2\x81\x96\x21\xc6\xc8\x5f\xa2\xf9\xca\x0e\xaf\x71\x03\xc5\
\x3e\xb2\xbd\x7b\x14\xe0\x30\x82\x09\xfe\x2c\xb6\x1d\xcf\xf1\xae\
\x91\x8d\xe6\x80\x9b\x02\x84\xd1\xf1\x0a\x40\x45\xfe\x32\xbe\xb5\
\x43\x0c\x13\x16\xc8\x8e\x22\x7f\xee\xd8\x00\x13\x2d\xfc\xf9\xfa\
\x06\x7b\xb1\x1d\x13\x9c\x4b\xc7\xc5\x11\x7a\x19\x03\x5f\x3b\x13\
\x36\x63\xe7\x15\x45\xb4\xc0\xb6\x4b\x21\x02\xe1\xe4\x3d\x7f\x8d\
\x6e\x9d\x78\xe5\xaf\x63\x14\xe2\x28\x0e\x9d\x39\x81\xd3\x80\x41\
\x73\x77\xbd\x20\xb4\xf0\xd7\xae\x73\xe3\x30\x2c\x64\x3a\x15\x4c\
\x44\x01\x02\xf0\x75\x04\xdc\x10\x9a\x1b\xe8\xc6\x5f\x38\x4b\xf2\
\x37\xa6\x2c\x06\xeb\x99\xeb\x44\xab\x06\x5a\x38\x04\xfc\x6c\x1d\
\xc3\xc3\x88\x3c\xa4\x22\x6f\x10\x7e\xde\xf8\x21\x8a\xb0\x9b\x90\
\x07\x50\x1c\xe0\x81\xf2\x9d\x51\x49\xc7\x11\x4c\x01\x11\x70\xcc\
\x44\x16\x91\x27\xb7\x2b\xff\x46\xe6\xc8\x49\xe8\x5a\xae\x43\x0f\
\x50\x63\x3a\x6f\xe1\x83\x08\x29\xe6\xbf\xf0\x3c\x26\x4f\xc8\x94\
\xa5\xef\xba\xfe\x2d\x61\x73\xee\x7b\x0b\x87\x70\x17\x59\xcf\x9f\
\xa5\xc6\x61\xcf\xfc\xef\x98\x32\x96\x18\x82\xe7\xc7\x40\x77\x42\
\x0b\xd1\x4a\x90\xa9\x9b\xbd\x8a\x56\xb6\xeb\xa2\x19\x66\x12\x04\
\xe4\x8e\x47\xc1\x91\xc7\x9c\xb7\x90\xd0\x11\xc5\x60\x15\x8e\xed\
\xa2\xc0\x0f\x29\xe2\x3c\xcf\xaf\x39\x21\xa7\x03\x34\x19\x9d\x4c\
\xbf\xf4\xc7\x03\x34\x9c\xa0\xcb\xf1\xe8\xf3\xf0\x78\x70\x8c\x76\
\xfa\x13\xf8\x7d\xa7\x81\xbe\x0c\xa7\xa7\xa3\x4f\x53\x04\x23\xc6\
\xfd\x8b\xe9\xef\x68\x74\x82\xfa\x17\xbf\xa3\xff\x0c\x2f\x8e\x1b\
\x68\xf0\xdf\xcb\xf1\x60\x32\x41\xa3\x31\x05\x37\x3c\xbf\x3c\x1b\
\x0e\xe0\xf9\xf0\xe2\xe8\xec\xd3\xf1\xf0\xe2\x03\x3a\x84\xb9\x17\
\x23\x58\x07\x43\x58\x00\x00\x78\x3a\xa2\x48\x19\xb8\xe1\x60\x42\
\x00\x9e\x0f\xc6\x47\xa7\xf0\x6b\xff\x70\x78\x36\x9c\xfe\xde\xa0\
\xc0\x4e\x86\xd3\x0b\x02\xfb\x64\x34\x46\x7d\x74\xd9\x1f\x4f\x87\
\x47\x9f\xce\xfa\x63\x74\xf9\x69\x7c\x39\x9a\x0c\x80\x8c\x63\x00\
\x7d\x31\xbc\x38\x19\x03\xa6\xc1\xf9\xe0\x62\xfa\x1a\x30\xc3\x33\
\x34\xf8\x0c\xbf\xa0\xc9\x69\xff\xec\x8c\xa0\xa3\xf0\xfa\x9f\x80\
\x93\x31\xa1\x15\x1d\x8d\x2e\x7f\x1f\x0f\x3f\x9c\x4e\xd1\xe9\xe8\
\xec\x78\x00\x0f\x0f\x07\x40\x61\xff\xf0\x6c\x90\xa0\x03\x06\x8f\
\xce\xfa\xc3\xf3\x06\x3a\xee\x9f\xf7\x3f\x0c\xe8\xac\x11\x40\x4a\
\xf8\x24\x43\x13\x4a\xd1\x97\xd3\x01\x79\x4c\xf0\xf6\xe1\xff\xa3\
\xe9\x70\x74\x41\x58\x3a\x1a\x5d\x4c\xc7\xf0\x6b\x03\x38\x1e\x4f\
\xd3\xe9\x5f\x86\x93\x41\x03\xf5\xc7\xc3\x09\x11\xce\xc9\x78\x74\
\x9e\x30\x4b\x44\x0c\xb3\x46\x14\x10\xcc\xbd\x18\x24\x90\x88\xf8\
\x65\x2d\xc1\x10\xf2\xfb\xa7\xc9\x20\x05\x8a\x8e\x07\xfd\x33\x80\
\x07\x2a\xbb\x50\xd4\xfa\x9a\x3c\x79\xf3\xfc\xd9\xc7\xa9\xef\xbb\
\x53\x27\x78\xfe\xec\x07\x3c\x81\xff\x66\x7e\xb8\xc0\xa1\x85\xda\
\xc1\x1d\xd8\xaf\xeb\x2c\xd0\x8b\xbd\xdd\xbd\x83\xbd\xa3\x77\xec\
\xbd\x3d\xff\x7a\x1d\xfa\x6b\x6f\xd1\x9c\xfb\xae\x0f\x23\xc3\xeb\
\xd9\xcb\x83\x56\x03\xb5\x5b\x1d\xf8\xd1\xde\x7b\xf5\x8e\x0d\x65\
\xef\x6f\x57\x4e\x8c\xd9\xa3\xc0\x5e\x90\x35\x6e\xa1\x5e\x70\xc7\
\x1e\xf9\x81\x3d\x77\xe2\x7b\x0b\x75\x5a\x2d\x78\xf4\x93\xd8\xe0\
\xc7\x2f\xce\xe2\x1a\xc7\x29\x51\x0c\xd2\x0b\xbc\x5c\xb6\x96\x6d\
\x23\x25\x2f\xba\xed\xee\x6e\x77\xc6\xde\xc3\x02\xc7\xd4\xb9\x34\
\x95\x91\x2f\xba\x0b\x1b\xe3\x03\x65\x60\x29\x1e\xd7\x09\x2c\x26\
\xa2\x77\xa2\xbc\x9a\xce\x8d\x7d\x8d\x2d\x58\x93\x1e\x7e\x27\x0b\
\xb2\x05\x82\x8c\xc1\x1f\x47\x01\xac\x30\x2f\x46\x33\x17\xe0\x71\
\xde\xd7\x31\xb8\x75\x98\x97\xe7\xdc\x02\x91\xdd\x58\x2b\xf0\x05\
\x61\xa6\x19\x0d\xbf\x22\x1b\x0a\xf1\x2a\xc0\x84\x53\xbc\xa8\x04\
\x33\x99\x7e\xb4\xc2\xf3\xaf\x87\xfe\x5d\x3a\x25\x22\xfa\xca\xa9\
\x90\xb3\x21\xb0\xaf\x15\xe5\x0d\xec\x42\x0e\xe8\xc3\x8f\x63\xff\
\x06\x34\x4e\x21\xc8\x78\x2c\x70\xdb\xf6\xcc\x15\x68\xe4\x90\x52\
\x33\xcc\x4d\xb0\x1c\x70\xa4\x73\x3b\xf6\x43\x58\x34\x1f\x3f\x00\
\x37\x81\xfc\x38\x85\x74\xeb\x2c\xe2\x15\x98\xf6\x7e\x4a\xf9\x0a\
\x13\x2f\x9b\x3e\xfa\x59\x02\x80\xd1\xef\xe2\x65\x6c\xa0\x3e\x9b\
\x64\xad\xbd\x39\x79\x2a\x70\xc2\x8c\x64\x1d\xba\x2f\xad\x37\xdf\
\xa2\xe8\xca\x81\x4d\x20\x7a\x73\x6c\x87\x5f\xaf\xc2\xf9\x1b\x3a\
\x7c\xe6\xdf\x5d\xa5\x33\x5f\x07\xde\xf5\xab\x6a\x48\x12\x63\x69\
\x94\x0e\x5b\xc2\xf6\x1d\x95\x0f\x0b\x60\x73\x8e\x20\x82\xd0\x0b\
\x44\x87\xb6\x78\x58\x8a\xb6\x78\x18\x43\xcb\x24\xc6\x97\x90\x60\
\x56\xb5\x45\x78\x45\x31\x97\x0b\x72\x53\x5d\x55\xd6\x54\x25\x3d\
\x55\xd2\x52\x45\x1d\x55\xd2\x50\x25\xfd\x3c\xb8\x76\xcc\xba\x31\
\xb0\x0c\xff\xc2\x31\x09\x7d\x3c\x88\x41\x6b\xeb\x48\x9a\x5d\xae\
\x29\x69\x78\xb1\x2a\xe4\xa1\x85\xaa\x95\x87\xca\xa2\xdc\x90\x95\
\x9a\xb6\x9d\xba\xd6\x32\x3d\x2b\x2e\xb8\xae\x5e\x39\x80\x3a\xfe\
\xab\x8c\x38\x75\xe4\xe6\x7e\xd5\x40\xe0\xd8\x5e\x38\xfe\xe1\x1a\
\x36\x27\xef\xb1\xb7\x3b\x01\x55\xb5\x1d\x4f\x9a\x61\xde\xdb\x3a\
\x6d\x65\x6f\x63\x8f\x54\xbc\xdb\xec\x55\x21\x81\x63\xd8\xa8\x2a\
\xa0\xc9\x96\x4a\xe9\xc8\x74\xfd\x95\x8e\xcc\xaf\x29\x8d\x83\xd2\
\xa9\xae\x1e\xa7\xba\x35\x67\xa0\x2c\x2f\xd2\x87\xa4\x47\xbb\xed\
\x14\xd3\x51\x2a\xf3\xaa\x12\x7f\x0a\x79\x6f\x2c\x6d\x75\x35\x6d\
\x4d\x43\xa9\xb3\x78\x18\x37\x95\x37\x34\x2d\x5a\x40\x7c\x8e\xbd\
\xf5\xa1\x5d\x9c\x17\x88\x79\x90\x21\x2f\x60\x60\x2c\x9a\x19\x68\
\x80\x59\x62\xd6\xa2\x9f\x55\x94\x4f\xe4\xa7\x97\xe5\x96\x3a\xf0\
\x26\x03\xab\x9e\x9b\x96\x64\x48\xaa\x93\x6e\x66\xfe\x93\xe5\xaa\
\xfc\x8d\xe8\x45\x09\x99\x95\xa9\x2a\xc0\x2a\xef\x09\x04\x2a\x70\
\x3e\x17\x76\x1f\x3e\xac\xa7\x0e\x13\xb5\x26\xa6\xd5\xa8\x4b\x32\
\x4e\xfe\x0f\x99\xc9\x24\x71\xc9\x76\x32\x95\x74\x51\x69\xe8\xcd\
\xaf\xa4\x46\x87\xc3\xef\x98\x6e\x83\xa4\x7a\x15\x66\xd9\x32\x9b\
\x4d\xcb\x08\x79\xca\x54\xcb\x28\xb0\x42\x0b\x46\x03\x4a\xb2\x7c\
\xd0\x8f\xdc\xde\x95\x91\x2a\x58\x96\x4b\x5e\xce\xdc\x35\xd6\x71\
\xd7\x56\xb8\x0e\x13\x58\x1a\x19\xf2\x55\xcb\xd1\x56\x49\x10\x9f\
\x3f\x03\xb1\x80\x2b\x69\xe2\xbb\xb9\xbb\x8e\x9c\xef\xa4\xf2\xc6\
\xe1\xbc\x47\x74\xf5\x82\x68\x40\xa0\xf1\xbd\x2b\xbc\xa3\xf0\x5e\
\x46\x18\xa3\x8f\x7d\x2a\x3f\x1a\xe4\x10\xde\xe3\x01\x87\xf4\x2a\
\xa9\xc9\xe4\xa8\xb3\x24\x6c\x99\x87\xe1\x54\x6f\x99\x56\x56\xc4\
\x96\xaa\x74\x63\xb4\x06\x47\x5a\x8c\x7f\x43\x5e\x37\xe0\x74\x5b\
\x3e\x0b\xb9\x04\x9b\xd1\xdb\x0b\xf5\xfa\x68\x46\xf7\x91\xbc\xc9\
\x6c\x68\x2e\x9b\x9b\x4a\x51\x54\x57\x05\x4d\x5d\xd9\x55\xda\xf2\
\x0a\x10\x6f\xc2\x5d\x4d\xde\xb6\xe2\xac\x0a\x5f\xd4\x3b\x35\xed\
\x30\xf4\x6f\x91\xd6\xeb\x57\xc1\x46\x60\x5c\x51\x18\x14\x45\x16\
\x2c\xb0\xea\x9f\x31\xc5\x78\xdb\x23\x7f\x2a\x54\x54\x13\x92\xfb\
\xb3\x08\x76\x88\x79\x3c\x04\x1f\xff\xd9\xc1\xb7\x29\x3c\xdb\x85\
\xac\x94\xe4\xa4\x6a\xb1\xb5\x2c\x1c\xd1\x6f\x44\xdd\x7e\xf7\xa0\
\x7b\x20\xbd\x6e\x12\xa1\xae\x23\x79\xd3\x64\x0c\x26\x31\x2b\x4a\
\x03\x08\xfa\x7b\xd1\x16\x9d\x2b\x73\x4e\xed\x59\x0e\x52\x9a\xad\
\xf2\x07\x62\xc0\xc7\x9f\x4d\x00\x16\x36\x61\x63\xf1\x66\x82\xe0\
\x0c\x42\xd0\xc1\xc2\x89\x8b\xc2\xb6\x4e\xb7\xb3\xdb\xe1\x3c\x6b\
\x4a\xe5\x4c\x0c\xd4\x4b\x58\x09\x23\x15\x22\x2b\xa3\x00\x0b\xb6\
\x65\x9e\x80\x23\x99\xa5\xda\xe0\xd9\x0e\x1c\xfb\x01\xa9\xef\x0b\
\x6a\xcb\x32\xfc\xd8\x89\xc1\xe7\xf1\x6c\x7b\x3d\x03\xc3\x8e\x43\
\xdf\x6d\xfa\x60\xd4\x64\x11\x24\x20\xde\x29\xef\x03\x3f\xa2\xc7\
\x67\x10\x68\xfa\x01\x9a\x43\xc0\x92\xd6\xe4\x79\xe4\xa6\x04\x04\
\xfc\x05\x8b\x08\x34\x6f\x28\xa5\x6d\x91\x52\x6e\xf2\x93\x39\x60\
\x75\xfb\x21\xb6\x73\x8a\xd6\xb0\x5d\x3f\x50\xd5\xc5\xda\x09\x46\
\x62\xcd\x2b\x10\xc6\xdf\xc0\x37\x39\x50\xcd\x45\x48\xed\x5e\x4e\
\xd8\x16\xea\x02\xd6\x36\x0d\x00\xd9\x3f\x34\x54\x89\x27\x12\x2f\
\x3a\xfd\xce\x41\xc7\xb0\xd6\xde\x6a\x22\xb0\xcc\x60\xf9\xc4\x3c\
\xc1\xd6\xca\xf6\x16\x2e\xd6\x11\xae\x01\xb3\xdb\xea\x9d\xf4\x4e\
\x38\x17\x60\x2f\x2c\x0e\x53\x2c\x5f\x26\x4a\x41\x0a\x3a\x6c\xd2\
\x54\x4f\x83\x96\x0b\xa7\xc5\xe4\xc2\xfe\x96\xe1\x57\x77\xb3\x8a\
\x4b\x17\xc3\xc7\x96\x1a\x3e\x66\x8f\xb4\x26\x4c\x21\xab\x03\x94\
\x35\xa0\xb0\x0c\x83\x1f\x95\x65\xb2\x84\x0a\x38\xd6\xf0\xa7\x0a\
\x41\xcb\x31\x01\xbc\x09\xc3\x1a\x1d\xb3\xc2\x46\xd9\x28\x21\xad\
\xaa\xad\xee\x87\xe1\xb9\x96\x96\x4b\xf5\xcc\xd8\x46\x65\xc3\x6a\
\xf3\x9d\xe9\xfc\x9f\x55\xf5\x3a\x48\xc2\x22\x81\x19\x99\xdb\x85\
\x7f\xeb\x29\x43\xb4\xb5\x08\x71\x2b\x56\xed\x29\x20\xe2\x30\x21\
\x21\x22\xcd\x0d\x28\x45\x21\xcc\x07\x15\xc5\x10\x54\x16\xfa\x3f\
\xc9\xff\x72\xa1\xaa\x7e\x5d\xf2\xe9\xca\x4a\xde\xc8\xaf\x9b\xfc\
\x76\x15\xaa\x15\xaf\xcd\x2d\xa4\xae\xdb\x4e\x8d\x56\xc1\x2a\xee\
\x68\x82\x17\xab\xe5\xc1\xd6\xc1\xa3\xf8\x2f\x08\x14\xb6\x72\x5f\
\x8f\xc2\x2b\x59\x10\x8f\xc2\x6d\x52\x03\xdb\x6a\x83\xe2\x0c\x6b\
\xbc\xb5\x3a\x86\xf9\xac\x4d\xf4\xfc\xe4\xea\x2d\x51\xb0\xce\x4d\
\xab\x83\x6a\x3b\xe9\x4c\xd5\xff\xb4\x86\x53\x37\xcd\x99\x31\x3a\
\xe9\x02\xaf\x52\xc9\x45\xeb\x11\xa4\x0e\xba\x32\xf8\x8f\x53\x7c\
\x17\xd7\x4a\xc6\x2a\x26\xad\xf9\x72\xf6\xa5\x6b\x3b\x5e\x0d\x64\
\xe5\xd8\x6a\x26\x1b\x09\x19\xa7\xd8\x86\x11\x24\x5f\x27\xf5\x23\
\x5a\x4d\x2a\x22\xa6\xbc\x7a\x6d\xcc\x4d\x8b\xa8\x98\x38\x7f\xe3\
\x0f\xa1\x13\x54\xac\xa0\x44\x30\xfc\x1a\x86\xeb\x02\xec\x8e\x1a\
\x60\x0b\x35\x01\x52\x5a\x01\xb9\x7f\x71\x3c\xb0\x3d\xa1\xb8\x5c\
\xf7\xc4\x44\xd3\xb8\xc6\x52\xca\x2c\x29\x4a\x8f\x87\xf5\xfa\x58\
\xd8\xb4\x1d\x54\x39\xe6\xd0\x91\x27\xb4\x7b\x99\x55\xb3\x0f\x7f\
\x76\xeb\x93\x59\x96\x90\xe6\xd8\x10\x8f\x9a\x74\x02\x4c\xa5\x5e\
\x94\x1c\xea\xcc\xa8\x0a\xad\xb5\xab\xf9\x40\xe8\x49\x68\xdf\xe0\
\xed\xf2\xf2\x9f\x19\xa0\x3f\x96\xe4\xe7\x64\x65\x07\xf8\xfd\x4e\
\x6b\xe7\xcf\x7a\x80\xa5\x10\x2c\xbf\x06\x62\x9b\x14\x04\x73\xed\
\x8d\xa6\xd9\xbc\x55\x90\x39\x2d\xdf\x27\x0e\x0f\x95\x4c\x7a\xd1\
\x3d\xe8\xee\x77\xf7\x15\xbd\xc8\xd5\x2f\xd1\xdc\x97\xe0\xea\x9b\
\xb7\x4c\xa5\x33\xdf\x5d\xe4\x51\x6a\xd2\xf9\x8a\x8b\xf8\xf4\x06\
\x6c\x3a\x06\x28\x33\x3b\x14\x8a\x9f\x0a\x60\xee\xba\x2b\x82\xfd\
\x5c\x06\x56\x5c\x54\x75\x49\xa6\x73\xab\x01\xaf\x4b\x76\x21\x68\
\x5a\x59\x7c\xf1\x2d\xbe\x62\x03\xae\x60\xdf\xb8\x62\x07\x03\x9a\
\x0d\xed\x45\x6f\xbf\x77\xd0\xb3\xd3\xad\x66\x1d\xad\x72\xad\x2b\
\x1b\x75\xcd\x32\x13\xe7\x9e\x36\x1f\x80\x6a\x17\xb7\xb9\x2e\x69\
\x2e\x62\xaa\x6b\x28\x7f\x4e\x9f\xe7\xab\x66\x3b\xac\x54\xd1\x6b\
\x0a\xe9\x54\xee\x5c\x17\xde\xed\xa5\xef\x74\x4b\x21\x7d\x4e\x76\
\x24\x4b\xaa\x62\x0a\xc4\x29\x15\xf6\x07\x12\xb4\x5c\xa0\x2f\x13\
\x74\xc2\xad\x99\x57\xf5\x4d\x8d\x1a\x69\x69\x11\x39\xa5\x55\x91\
\x0e\x2d\x90\xab\x56\x5c\x78\x4c\xcf\xf7\x0a\x05\x98\xd2\x16\xf0\
\xd0\x96\xc0\xda\xd5\xfc\x9b\x99\x2f\x75\x3e\x9b\x1b\xca\x73\x18\
\x1f\xa1\x50\xaf\x59\x49\x42\xa5\x74\xaf\xa7\xb7\x4a\x76\x00\x55\
\x31\xd6\xcb\x99\xde\x6e\x7f\xf7\x60\xf7\x40\x91\x07\x4f\xe0\xf2\
\x2b\xb3\x91\x95\xca\x03\xc7\x13\x06\xf2\xa3\x0f\xfe\x3b\x0f\x88\
\x53\x40\x62\x94\x9c\x87\x45\xa3\x56\x3e\x31\xc4\x38\xfb\xbd\xd2\
\xe9\x8e\xd6\x0f\xe6\xf8\x11\x5c\xa6\x64\x2a\x5d\xc3\x62\x11\xa2\
\xbf\x22\x8b\x78\x6b\x93\x3f\x0a\x3a\x64\x3e\x44\x2b\xcb\x42\x36\
\x3e\x6f\xa8\x66\xb9\x39\xb1\x58\x8b\xd0\x0f\x9a\x24\x7d\xcb\x56\
\x80\x9a\x17\x32\xd1\x94\xe4\xd2\x52\xe9\x53\xae\x70\x49\xac\x11\
\x01\x73\x9b\x56\x1c\x0f\x7d\xc9\xa8\x5e\xc0\x96\x7a\x1d\xda\xf7\
\x9a\x11\xc6\x55\x47\xb4\x9a\xb8\xb5\x54\x84\x4a\x39\x3c\x71\x05\
\xda\x51\x8a\x78\xd2\xc4\xb6\x6a\x87\x57\x41\x79\xc6\x0c\xdc\x22\
\xb7\xe3\xf4\x6f\xb2\x7e\x63\xdd\x5b\xf9\x50\xb2\x76\x39\x21\x77\
\xfa\x95\x2c\x69\xf4\xc3\xe8\x8d\x36\x68\xce\xaa\x9a\x62\xeb\x0e\
\x16\x0d\xbe\x2f\xef\x82\xd6\x41\x73\x26\x47\x45\x65\x67\x6f\x06\
\x3b\x97\x2e\xfd\x68\xcd\x3c\x39\x82\x4c\x2d\x5d\x4f\x0f\xd5\xcf\
\x13\x53\xc4\xea\xef\x7a\x82\xd2\xf2\x8d\xea\xbe\xb3\xca\x4e\xda\
\x9b\x5d\x30\xc6\x5f\x2e\x2b\x86\xc1\x85\x15\xd9\xd2\x33\xb4\x9f\
\x45\x4c\xe4\x76\x86\x9a\x25\x43\x9e\x4d\x2a\xe0\xb3\x55\xa5\x91\
\x80\xb0\xe4\x0a\xe4\x24\x2e\xe8\xe5\xf2\x01\x3c\xc6\xe6\xc2\xca\
\x7b\x90\x2d\x7d\x04\x69\x6e\xb0\x67\xd8\x55\xf6\xe3\x56\xea\x09\
\x72\x89\x2c\xef\xb5\xd0\x8c\x2f\x48\x7f\xd3\x0e\x0d\x2b\xb0\x3d\
\xac\x4b\x83\x75\x6e\x47\x17\x37\x65\xe7\xa2\x22\x74\xb1\xa7\xf6\
\x5b\x00\x7b\x1f\x24\x77\xf7\xcd\x45\x68\xdf\x1e\xda\x11\xbb\xa3\
\x47\xde\x65\x4d\x94\xa4\x41\x92\x64\xa2\xfc\x72\x6f\x72\x65\x77\
\x76\x4f\xbb\x2f\x49\x6b\x96\xc6\x85\x75\x15\xa4\x86\xee\x91\x52\
\x69\xd0\x5c\x74\xee\xfa\x11\x66\x0e\x05\x55\xed\x58\x23\x73\x44\
\x33\x2a\x6b\xfa\xd5\x21\xab\x67\x3a\xc9\x4c\x3a\x65\x6b\xc4\x2c\
\xfc\xaf\xc3\x6c\x93\xcd\xa9\x81\x1b\x54\x3b\x1d\x5d\xa2\x69\xff\
\x70\xc2\x2e\xca\x32\x5a\x62\x7b\x66\x91\x88\xa6\x30\xc9\xae\x16\
\xe5\xf3\xbc\xc3\x54\xf7\x31\x6c\x9b\x52\x1a\x59\x9c\x17\xf4\x94\
\x20\x8a\xc4\x40\x34\x4c\x32\x45\x91\x9a\x28\xa9\xa3\xda\x2c\x17\
\x83\xf5\x4b\x79\xa7\xaf\x81\x0d\x48\x15\xf7\x7a\x87\x8f\x20\xb1\
\xed\x18\x25\x03\x4a\x99\x4d\xac\xbf\x4a\x42\xcb\x8d\xe9\x70\x34\
\x9d\x8e\xce\x0d\xf6\x94\xb0\xf5\x10\x26\x95\xf4\x2f\x3d\xac\x3d\
\xc9\xa1\x71\xb1\x4c\xb5\xf1\xb3\x36\x6c\xeb\xa9\xee\x57\x14\xc6\
\x13\x1b\x56\xb9\xdc\x1e\x46\x08\xe5\xec\xd6\x37\xad\xb3\xc1\xc9\
\xd4\x60\x58\x84\xce\x87\x30\x2b\x56\x25\x7a\x14\xbb\x32\xf9\x9b\
\x7a\x56\x95\x36\x1f\x98\xcc\x8a\xb2\xf0\xb4\x46\x55\x41\x6a\x0f\
\x21\x82\x32\x5e\x6b\x5a\x14\xb5\xa9\xe4\x3b\x18\x7a\xa3\x4a\xc2\
\x9c\x07\xb0\xaa\x30\x3d\x45\x7a\x24\xb3\xaa\xb4\x4c\x0d\x83\x2a\
\x19\x55\xc2\xc1\xd3\x5a\x55\x15\xa9\x6d\x2f\x82\x52\x5e\x6b\x5a\
\x15\x03\x85\x84\xb3\x0e\xa9\xf7\xdd\xc2\x1e\x4d\x6f\x38\xc0\xba\
\x2d\xef\x84\x2f\x8a\x08\x69\x31\x51\x0e\x37\x42\xa4\xe9\x86\xab\
\xc6\x10\x4f\xd8\x36\xe0\x48\x4d\xf6\xaa\xb1\x56\x17\x65\x51\x77\
\x27\xcf\xed\x8e\xfd\xf9\xd7\x24\xf1\xd2\x9e\x42\x69\xce\x34\x24\
\x0b\x7e\xdb\xea\x9e\x74\x79\x97\x18\xed\xf5\x9e\xd9\x61\x33\x89\
\xca\x09\x31\x35\xd2\x94\x74\xb6\xe7\x87\x37\xb6\x5b\x32\x1d\xc8\
\x03\xca\xe5\x6a\x56\xc6\x8b\x9c\x53\x34\x90\xf4\x6a\xe9\xfa\x76\
\xdc\xcc\x1d\xbd\x15\x5e\x95\x2b\xab\xcf\x96\xe4\x39\x26\xba\xd2\
\xde\x21\x13\x75\xa6\x45\x48\xbf\xca\x63\xbf\xec\xf4\x7a\x0d\x94\
\xfd\x68\xb7\xca\x45\x91\x7e\x55\xa2\x00\x69\x2e\x03\x4b\x7d\x30\
\x91\x4d\x33\xfd\xa1\x6b\x0e\x28\xa7\x8b\xd7\xf8\x01\xff\x99\x13\
\xc5\x72\x7d\x7c\x8b\x12\xa3\x0c\xdd\x9a\x81\x16\xe6\xab\xf4\x56\
\x0f\x60\xcb\xbf\x32\x9d\x36\x9a\x2d\x4e\xd0\xac\x6c\x76\x29\xe8\
\x14\xb6\x1d\x35\x23\x67\xe6\x82\xd4\x22\xeb\x17\x7b\xf1\x97\xef\
\x78\x51\x93\x5c\x9c\x94\xcd\xad\xac\x09\x6c\x43\x8c\x4f\x81\xf0\
\x17\x82\x71\xbe\x72\xdc\x05\x0c\x4e\x7e\x7b\x52\xfc\x05\xe8\xa9\
\xb9\xd3\xef\x4c\x28\xb3\x92\x57\xf2\x64\x71\x6e\xc5\xa2\x43\x02\
\xed\x2a\x81\x56\x42\xa8\x1f\x30\x1c\x7a\x6a\xb5\x64\xaa\x73\x24\
\x22\xeb\x51\x49\x80\x6d\x2b\xcc\xec\x28\xa2\xb6\x48\x65\x17\x56\
\x47\xb0\x4d\xdf\x13\xb7\x87\xcd\xe4\x5b\x40\x79\xb1\x94\x19\xdd\
\xf5\x65\xad\x25\x9b\xfb\x3a\x76\x7d\x3a\x17\x65\x89\xee\x49\x3b\
\x00\x19\xb7\x80\xf6\xee\x5e\xa3\xd3\xde\x6f\x74\xde\x82\xa3\x6d\
\xbd\xee\x72\xb4\xd2\xa7\xc7\xd4\x90\x35\xbb\xb6\x26\xd1\x55\x46\
\x56\x05\xaa\x2a\x9d\xcd\xb2\x7b\x75\x16\x4c\x02\x40\x9a\x26\x1e\
\xcd\x56\xd0\xdb\xed\xd9\x3d\xde\x5c\xc6\x23\x77\xdd\xf5\x25\x2b\
\x37\x56\xae\x07\x1b\x37\x72\x99\x32\x63\x47\x94\x84\x47\x73\x7c\
\x6b\xa6\x99\x57\xf3\x77\xd5\x6a\x7e\xf6\x88\x13\xdb\xdc\x27\xfd\
\xe1\x7a\x7a\x0f\x34\xf4\x32\x49\xe6\x3b\x96\x2a\xd2\xf4\x20\x62\
\xec\x9a\xc5\xa8\x90\xf5\x34\x42\x6c\x51\x31\x96\x0b\x31\x0b\xb7\
\xcd\xf9\x4e\xf1\xe7\x2e\xf4\x4d\x81\x85\x41\xa3\x70\x21\x40\x9f\
\xec\xe6\x69\xfb\x23\xf0\x83\x75\x70\xee\x2f\xf0\xfb\x9d\xf6\xce\
\x9f\xe8\x07\x39\x9f\xf0\x3d\xf7\x9e\x7e\xb7\x81\xde\x8c\xa5\xe3\
\x2e\xc9\xb0\xe4\x7c\x22\xd7\xec\x43\x9b\x9b\xe8\xa9\x86\xfd\x15\
\xa3\x5b\x3b\x99\x49\x8e\x36\x28\x68\x7e\x4d\x9d\x4e\x15\xb9\x13\
\x38\xca\xb1\x53\x4e\x69\x47\xa1\x74\xe8\xd1\x2f\x95\x9a\xc9\x6c\
\x6f\x4d\x26\x4f\x6e\x84\x3c\x2a\xf5\x68\x42\x6a\x75\x03\x32\x2b\
\x89\xb4\xab\xa9\x5f\xd7\x96\x52\xa2\x4d\xde\xbb\x23\x93\x94\x7d\
\xf3\x0d\xb1\xff\x8c\x04\xe7\xa2\xf4\x6a\x3d\x4b\xf5\xc8\x05\x15\
\x10\xa9\x67\x87\xcf\x68\x86\x5d\xff\x96\x7c\x89\x78\x4d\x50\x53\
\x95\xb2\xcf\xff\x4a\x5a\x05\x75\x1d\x63\xd7\xbe\xc7\x8b\xe4\xf7\
\x1b\x30\x85\xec\x7b\xa4\x12\x37\xca\x47\x3a\x36\xba\x18\x91\xf4\
\x7e\x91\xf6\x2e\x76\x7e\xd7\xec\x30\x1b\x8a\x56\xce\x32\x46\x4e\
\x8c\x6c\x34\x83\x9f\xe9\xd7\x4c\x14\xde\x22\xc6\x1c\xf9\xe0\xaf\
\xc2\x5d\x7e\x75\x15\x30\x64\xce\x2b\x4b\x9d\x84\x5a\x27\xdc\x35\
\x54\x74\x4c\xa3\x80\x2b\xe2\x07\x13\x37\x89\xfe\x45\x1c\x3b\x5d\
\x3c\xec\x5b\x2e\xef\xa9\x0b\x20\x9f\x0e\xf6\xe7\xf4\x6b\xcf\xc9\
\xf7\x88\xf9\x59\xa6\xea\x5c\xf5\x4d\x9b\x0a\xcf\xd2\xe7\x0d\x36\
\x6c\x45\xd1\x03\xa5\x51\x5a\x95\xc3\x60\xa5\x37\x2e\x6f\x5e\x05\
\x77\xd0\x2b\x34\x39\xb1\x23\x1c\xb1\xcf\x29\x31\xb4\x7d\xb9\x9c\
\xe6\xe2\x5a\x29\xed\x75\xe8\x2c\x88\x80\x0d\x3d\xa4\x65\x09\xaf\
\x88\x13\x1c\x49\x76\x11\xc4\xd4\xd2\xde\xd2\x51\x2b\x7f\x8e\x49\
\xc8\xcc\x95\x17\xb9\x70\x90\xbb\xa0\x8d\xe3\xc0\x3c\x09\x69\x7c\
\x69\xcf\x63\xe7\x3b\x2e\x08\x40\xd3\x01\xa6\x08\x36\x19\xb0\x31\
\x69\xd2\xb5\x9a\x9a\x4d\xbf\xca\x6a\xd7\x87\x02\xf9\xab\x0f\xe2\
\x93\xd4\x1b\xb7\x58\x13\x9d\xf1\xa6\x8f\x86\xc3\x1a\x1f\xe6\xd8\
\xa4\xd1\xcb\xc4\x45\x8c\xef\xe2\xa6\xed\x3a\xd7\x69\x6b\xd2\xbb\
\x02\xba\xad\xec\x72\x9c\xb5\x74\xc2\x28\x96\xec\x57\x3b\x8c\x38\
\x64\xc8\xae\x94\x8b\x20\xe9\xe1\x5e\xe5\xeb\x51\x96\xe6\x32\x99\
\x00\x4b\x57\xc3\xd3\x42\x11\xae\x61\x17\x33\x21\x0e\x34\xb1\x91\
\x1d\x27\xd5\xe0\x43\x77\x6b\x59\x04\xa7\x61\xc5\x00\x2a\xfd\x9c\
\x61\xee\xe8\x47\xbc\xd3\xa3\xb3\xb1\xee\x5b\x9c\x44\xe7\x49\x0d\
\x9b\x6c\xb9\xf4\x33\x47\x74\x77\xf5\xc3\x58\xf8\xde\x11\xdd\x30\
\x45\xdc\x59\xab\xd2\x96\x9b\x87\x08\x94\x37\x8b\xd5\x6c\x57\xcb\
\x37\x3d\x51\xdf\x74\xe4\x87\x1e\x0e\xf9\x8e\xc2\x97\xdc\x76\xde\
\xa0\xca\x7a\x12\xb6\x44\xff\x2e\x5d\xe2\x25\xab\xb5\xe4\x6e\x11\
\xfd\x1a\x8b\x3d\x2b\x3e\xd9\xab\xc1\xd2\x06\x7d\x1c\xda\x2b\x12\
\xca\x31\x56\x85\x23\x64\x25\xa6\x66\xcc\x09\xdf\x71\x22\x96\xe8\
\xc0\xba\x70\xe6\xce\xdf\x18\xa5\xcf\x61\x50\x94\x06\x3c\xe4\xde\
\x87\xc5\x46\xd5\x92\x80\x26\xc6\x4e\x6f\x80\xc5\xeb\x28\xfd\xc6\
\x61\x3e\x72\xc9\x77\x7d\x91\x3e\xe7\x74\x72\x7a\x3f\x2d\x49\x69\
\xdf\xef\x74\x77\xfe\x04\x87\x92\x3c\xa3\xb1\x19\x7d\x54\x60\x7e\
\x4a\x02\x34\x09\x5c\x27\x8e\xb3\x4c\x5c\x17\x49\x19\x2e\x31\xe6\
\xa7\x96\x1e\x08\x4a\x97\x17\x2b\xdc\x17\x55\xe1\xe7\x6b\x2d\xd2\
\xe5\x19\xc3\xac\x7c\x69\x41\xbe\xbb\xc8\xa2\xc2\xd0\xbf\x26\xa1\
\x8a\xe1\x7a\x5d\x85\x5d\xae\x57\x65\x97\x13\xd0\x58\xe0\x4e\xd7\
\xde\xd7\x02\x69\xb5\x7a\x87\xfb\x47\x99\x34\x8e\x21\x1c\x97\x6e\
\x11\x3f\xd2\x6d\x94\x6e\x77\xaf\xd7\xef\x96\xd5\x26\xc4\x23\x1f\
\x1e\xa3\x18\x3a\xb2\x39\xe1\x4f\x74\xcd\x82\xa3\x7b\xa2\x6b\x16\
\x92\xb8\xea\x5c\xb3\x48\xc5\xf2\x44\xd7\x2c\x72\x1b\xff\xff\xf7\
\x25\x0b\x41\x38\x0f\x7f\xc9\x42\x07\x3c\xb9\x64\xa1\x7d\x93\x9e\
\x0f\x68\xdf\x6e\x7b\xc9\xe2\x7f\xab\xfa\x0f\x98\
\x00\x00\x02\x00\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x7d\x49\x44\
\x41\x54\x58\x85\xed\x97\x3b\x4e\x02\x51\x14\x86\xbf\x83\x28\x3e\
\x17\xa0\x6e\x41\x4d\x48\x78\x44\x9d\x71\x15\x5a\xfa\x8a\xb1\xd0\
\x0e\x48\x74\x0d\x36\x60\xa3\x56\x3e\x63\xa9\x7b\x30\x19\x34\x82\
\x24\x84\xb8\x07\xb5\xf7\x81\x82\x70\x2c\x74\x08\x04\xc3\x14\xce\
\x58\xe8\x7c\xdd\xbd\xe7\xe6\xfe\x5f\x6e\x73\xcf\x81\xff\x8e\xb4\
\xac\x54\xc5\xc8\xe4\x96\x44\x65\x0d\x61\x1c\xe8\x75\x29\xe7\x15\
\xe5\x16\x64\xd7\x4a\x46\x8f\x11\xd1\x76\x01\x55\x99\xd9\xce\x1f\
\xa9\xb2\x00\xbc\x09\x14\x15\x7d\x72\x23\x5d\x90\x41\x85\x30\x10\
\x02\x39\xb4\x12\xd1\x15\x5b\xa2\x21\x60\xa4\xaf\x97\x05\x39\x00\
\xbd\x44\x82\x73\x56\x22\x72\xef\x46\xb8\x8d\x99\x29\x0c\xa3\xb5\
\x33\x60\x4a\x95\xc5\x6c\x2a\x7e\x02\x10\x68\x58\xaa\xac\x01\x6f\
\x5d\xef\x81\x59\xb7\xc3\x01\xac\x44\xe4\xbe\x5e\xad\xce\x01\x15\
\x11\xd6\xed\xfd\x86\x00\xc2\x98\x40\xf1\x62\x23\xf6\xe0\x76\xb8\
\xcd\xe5\xa6\x71\x07\x14\x81\xf1\x76\x01\xe8\x53\x78\xf1\x2a\xbc\
\x89\x67\xa0\xdf\x5e\x04\x9d\x4e\x9b\xe9\x9c\x3a\x9d\xe9\x84\x95\
\x8c\x4b\xa7\x7a\xa0\x53\xf1\x37\xf0\x05\x7c\x01\x5f\xc0\x17\xf0\
\x05\x7c\x01\x5f\xc0\xb1\x1f\x70\xfa\xcf\x7f\x4a\xf3\x0b\x94\xa5\
\xa9\x53\xf1\x90\x01\xa0\xfc\x8d\x80\xde\x2a\x84\xcd\x4c\x61\xd8\
\xab\xe4\xc9\xf4\xd5\x28\x10\x16\x28\xb5\x0b\x68\x60\x0f\x08\xa1\
\xb5\xf3\xe9\xad\xec\x88\x17\xe1\xdd\x74\x9d\x01\x3d\x75\xd1\x5d\
\x7b\xbf\x65\x30\x31\x33\x37\xfb\xa0\xcb\x40\x05\x28\x82\x3e\xba\
\x13\x2f\x43\x7c\x0e\x26\x3d\x0a\xfb\xd9\x44\x6c\xb5\x6d\x30\xb1\
\x25\x8c\x74\x7e\xfe\xab\x6f\x9f\x00\xfa\xdc\x11\xa0\x2c\x50\x52\
\x95\x1d\x2b\x15\x3b\x75\xe9\xce\x3f\xc2\x07\xd1\xbc\x75\x94\xcf\
\xbc\x8d\xf9\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xe0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x51\x00\x00\x00\x3a\x08\x06\x00\x00\x00\xc8\xbc\xb5\xaf\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\
\x0b\x29\x1c\x08\x84\x7e\x56\x00\x00\x00\x60\x49\x44\x41\x54\x78\
\xda\xed\xd9\xb1\x0d\x00\x20\x08\x00\x41\x71\x50\x86\x63\x51\xed\
\x8d\x85\x25\x89\x77\xa5\x15\xf9\x48\x45\x8c\xa6\xaa\x6a\x9d\x6f\
\x99\x19\x1d\x67\x9d\x03\x11\x45\x14\x11\x11\x45\x14\x51\x44\x44\
\x14\x51\x44\x11\x11\x51\x44\x11\x45\x44\x44\x11\x45\x14\x11\x11\
\x45\x14\xf1\x5b\xd1\x75\xb0\xdb\xdd\xd9\x4f\xb4\xce\x88\x28\x22\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcf\x36\xce\x69\x07\x1e\xe9\
\x39\x55\x40\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xac\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x07\x00\x00\x00\x3f\x08\x06\x00\x00\x00\x2c\x7b\xd2\x13\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xb3\x00\x79\x00\x79\xdc\xdd\
\x53\xfc\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdf\x04\x19\x10\x2e\x14\xfa\xd6\xc4\xae\x00\x00\x00\x39\x49\x44\
\x41\x54\x38\xcb\x63\x60\x20\x06\xc4\xc7\xc7\x33\xc4\xc7\xc7\xa3\
\x88\x31\x61\x53\x84\x53\x12\xaf\xce\x91\x28\xc9\x82\xc4\xfe\x8f\
\xc4\x66\x1c\x0d\xa1\x51\xc9\x51\xc9\x51\x49\x7c\x05\x06\xe3\x68\
\x08\x91\x2a\x49\x3e\x00\x00\x88\x4b\x04\xd3\x39\x2e\x90\x3f\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xc3\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdc\x0b\x07\x09\x2e\x37\xff\x44\xe8\xf0\x00\x00\x00\x1d\x69\x54\
\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x00\x00\x00\x00\x43\x72\
\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x64\
\x2e\x65\x07\x00\x00\x00\x27\x49\x44\x41\x54\x78\xda\xed\xc1\x01\
\x0d\x00\x00\x00\xc2\xa0\xf7\x4f\x6d\x0e\x37\xa0\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x77\x03\x40\x40\
\x00\x01\xaf\x7a\x0e\xe8\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\
\x60\x82\
\x00\x00\x00\xef\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x51\x00\x00\x00\x3a\x08\x06\x00\x00\x00\xc8\xbc\xb5\xaf\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\
\x0b\x2a\x32\xff\x7f\x20\x5a\x00\x00\x00\x6f\x49\x44\x41\x54\x78\
\xda\xed\xd0\xb1\x0d\x00\x30\x08\x03\x41\xc8\xa0\x0c\xc7\xa2\x49\
\xcf\x04\x28\xba\x2f\x5d\x59\x97\xb1\xb4\xee\xbe\x73\xab\xaa\xdc\
\xf8\xf5\x84\x20\x42\x84\x28\x88\x10\x21\x42\x14\x44\x88\x10\x21\
\x0a\x22\x44\x88\x10\x05\x11\x22\x44\x88\x82\x08\x11\x22\x44\x41\
\x84\x08\x51\x10\x21\x42\x84\x28\x88\x10\x21\x42\x14\x44\x88\x10\
\x21\x0a\x22\x44\x88\x10\x05\x11\x22\x44\x88\x82\x08\x11\x22\x44\
\x41\x84\x08\x51\x10\x21\x42\xfc\xaa\x07\x12\x55\x04\x74\x56\x9e\
\x9e\x54\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xeb\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x68\x49\x44\
\x41\x54\x58\x85\xed\x97\x4d\x4e\xc2\x40\x18\x86\x9f\xaf\x10\x14\
\xd4\x03\xa0\x57\x10\x13\xb6\x9e\x43\x76\xc8\x58\x8c\x26\x70\x1f\
\x31\x31\xa1\x74\x48\x97\x78\x0c\xd7\xc4\x78\x07\x71\xef\x0f\x02\
\x91\xcf\x85\x94\x20\xa0\x2c\x1c\x5c\x68\xdf\xdd\x4c\xdf\xf4\x79\
\xa6\x4d\xd3\x19\xf8\xef\x91\xf9\xb1\x6f\xcc\x09\x50\x03\x0a\xc0\
\xa6\x23\xce\x2b\x70\x27\x22\x8d\x20\x0c\x2d\xa0\xcb\x04\xc4\x37\
\x26\x04\x2a\xc0\x00\xe8\x02\x4f\x8e\x04\xb6\x81\x22\xb0\x01\xb4\
\x5a\xd6\x9e\xc6\x12\x53\x01\xdf\x18\x1f\x08\x04\x6e\xd2\x6f\x6f\
\xa5\xab\x28\xea\x39\x82\x03\x70\x5e\x2e\xe7\x47\x9e\xd7\x41\xe4\
\x50\xc0\x04\xd6\xb6\x01\xbc\x99\x4e\x0d\x18\x8c\x45\x8e\x5c\xc3\
\x01\xae\xa2\xa8\x27\xe9\x74\x09\x18\xaa\x48\x3d\x9e\x9f\x15\xd8\
\x07\xba\x61\x18\x3e\xb8\x86\xc7\x09\x82\xe0\x1e\x91\x2e\xaa\x85\
\x65\x02\x59\x54\x5f\xd6\x05\x9f\x66\x3c\x7e\x06\x72\xf1\x30\xbd\
\xaa\xef\x1b\xa3\xab\x3a\xdf\xa5\x65\xed\xfc\x97\xf6\x29\xde\x77\
\x17\x7f\x23\x89\x40\x22\x90\x08\x24\x02\x89\x40\x22\x90\x08\xac\
\xdc\x0f\xac\xfa\x9f\xff\x34\xb3\x4f\xa0\x8f\x48\xee\xcb\xa6\x33\
\xa2\xb7\x05\xf4\x17\x04\x14\xee\x80\xe2\x79\xb9\x9c\x5f\x17\xbb\
\x52\xa9\xec\xa1\x5a\x04\x6e\x17\x04\x3c\x91\x4b\x60\x63\x94\x4a\
\x5d\x57\xab\xd5\xdd\x75\xc0\x53\x22\x1d\x20\xa3\x22\x8d\x78\x7e\
\xfe\x60\xd2\x04\x7c\x60\x38\xd9\xbd\x3e\x3a\xa1\x8b\xec\x4c\x56\
\x9e\x51\x68\x86\xd6\x9e\x31\x7f\x30\x89\xab\x55\x63\x8e\x55\xa4\
\x8e\xea\x01\x90\x75\x22\xf0\xf1\xce\x6f\x51\xbd\x68\xb5\xdb\x91\
\xa3\x7b\xfe\x91\xbc\x03\x16\x71\x6a\x27\x44\x74\xfe\x4f\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x02\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x7f\x49\x44\
\x41\x54\x58\x85\xed\x97\xcb\x4a\x42\x51\x14\x86\xbf\x65\xa5\xd9\
\xe5\x01\xac\x57\xc8\x40\x28\xa3\xd2\x9e\x22\x87\xdd\x88\x06\x36\
\x33\xa1\x9e\xa1\x89\x36\xa9\x46\x5d\x69\x58\xef\x10\x1c\x8d\xb4\
\x40\xa2\x77\xc8\xe6\x5d\xac\x2c\x57\x83\x3a\xa2\x1c\xcf\x24\xb6\
\x18\x75\xfe\xd9\x5e\x1b\xf6\xf7\xb1\x60\x6f\xf6\x82\xff\x1e\x69\
\x5a\xa9\x4a\x2c\x5b\x58\x14\x95\x24\x42\x18\xe8\x35\xc4\x79\x41\
\xb9\x05\xd9\xb1\xd6\xc6\x8f\x10\x51\xa7\x80\xaa\xcc\x6c\x15\x0f\
\x55\x99\x07\x5e\x05\x4a\x8a\x3e\x9a\xa0\x0b\x32\xa0\x10\x01\x02\
\x20\x07\x56\x6a\x7c\xd9\x96\xa8\x0b\xc4\x32\x97\x4b\x82\xec\x83\
\xe6\x91\xee\x84\x95\x1a\x2b\x9b\x80\xdb\x89\x67\xaf\x43\xe8\xc7\
\x29\x30\xa5\xca\x42\x2e\x3d\x71\x0c\xe0\xab\x5b\xaa\x24\x81\xd7\
\xae\x77\xdf\xac\x69\x38\x80\x95\x1a\x2b\xd7\xaa\xd5\x04\xf0\x26\
\xc2\xaa\x5d\xaf\x0b\x20\x8c\x08\x94\xce\xd7\xa3\xf7\xa6\xe1\x76\
\xf2\x1b\xb1\x3b\xa0\x04\x84\x9d\x02\x10\x54\x78\x6e\x17\xbc\x21\
\x4f\x40\x5f\x2b\x81\x8e\xc4\x13\xe8\xb8\x40\xb7\xdb\x46\x3c\x53\
\x50\xb7\xbd\x9f\xc4\x5a\x9b\x90\x56\xf5\x8e\x77\xc0\x13\xf0\x04\
\x3c\x01\xd7\x77\xc0\xed\xde\x9a\x4e\xc7\x3b\xe0\x09\xfc\x2a\x81\
\x8a\x34\xfc\x54\xda\x98\x7e\xa0\xd2\x42\x40\x6f\x15\x22\xf1\xec\
\x75\xa8\x5d\xe4\xc9\xcc\xc5\x30\x10\x11\xb8\x71\x0a\xa8\x6f\x17\
\x08\xa0\x1f\x67\xd3\x9b\xb9\xa1\x76\xc0\x7b\xe8\x3a\x05\xfc\x35\
\xd1\x1d\xbb\xde\x34\x98\xc4\xb3\x57\x7b\xa0\x4b\xc0\x1b\x50\x02\
\x7d\x30\x83\x97\x41\xbe\x06\x13\xbf\xc2\x5e\x2e\x15\x5d\x71\x0c\
\x26\xb6\x44\x2c\x53\x9c\xfb\xfe\xb7\x8f\x02\x41\x33\x02\x54\x04\
\x6e\x54\x65\xdb\x4a\x47\x4f\x0c\x9d\xf9\x47\xf2\x09\xb5\xbd\x75\
\x94\xee\x91\xe8\xbe\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
\x82\
\x00\x00\x02\xf8\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x02\x75\x49\x44\
\x41\x54\x58\x85\xed\x96\xcd\x4e\x13\x51\x18\x86\x9f\xaf\x15\xd2\
\x32\x78\x03\x56\x4d\x69\x58\x89\xa6\x3f\xf1\x06\x20\x26\x1a\x37\
\x94\x84\xd9\xb6\x33\xc4\x0b\x30\x46\x10\x34\x51\x16\x2e\x48\xd1\
\xb8\x72\x43\xb4\x74\xd8\x92\x98\xe2\xca\xb8\x11\x37\x2c\x8c\xda\
\x36\x12\xc0\x10\x40\x03\x86\x0b\xc0\x54\xa3\x71\x3e\x17\xb4\xd1\
\x44\xa6\x65\x0a\x3b\xfb\x6c\xbf\xf7\x9c\xf7\x49\xe6\xcc\x99\x81\
\x36\x6d\xfe\x77\xc4\x4f\xd8\x34\xcd\xce\xee\x70\x78\x48\x44\xd2\
\x40\x4a\x21\x02\x80\xea\x0e\x22\xef\x05\x8a\x7b\xd5\x6a\x71\x7e\
\x7e\xfe\xc7\xb1\x0b\xd8\x99\xcc\xb0\x8a\xe4\x04\x7a\x80\x0f\xa2\
\xba\xa8\x22\x3b\xb5\x71\x04\xe8\x07\x2e\x00\x1b\x2a\x32\x56\x28\
\x14\x9e\x1d\x8b\x80\x69\x9a\xc1\x93\x86\x91\x53\xd5\x1b\x02\x2f\
\x08\x06\xc7\xf3\xf9\x7c\xe5\xa0\xac\x65\x59\x09\x81\x29\x54\x2f\
\xab\xea\x74\x34\x16\x1b\x9f\x9c\x9c\x74\x1b\xed\x7f\xa2\x99\x40\
\xad\xfc\x3a\x30\x9a\x77\x9c\x07\x8d\xb2\x85\x42\xa1\x0c\x5c\x19\
\xb1\xac\x51\x60\xea\xd3\xe6\x26\xc0\x58\xa3\x35\xc1\x46\x43\x3b\
\x93\x19\x06\x1e\x09\x8c\xce\x3a\xce\xc3\x66\xb2\x75\x4a\xe5\xf2\
\x52\x32\x91\xf8\x2e\x22\xf7\x12\xc9\x64\xa5\x5c\x2e\xaf\x79\x65\
\x3d\x1f\x81\x69\x9a\x9d\xdd\x5d\x5d\xab\xc0\xc7\x59\xc7\xb9\x7a\
\xd8\xf2\xbf\xb1\xb3\xd9\x97\x40\xcf\xd7\x6a\xb5\xcf\xeb\x60\x06\
\xbc\x16\x77\x87\xc3\x43\x40\x4c\x82\xc1\x89\x56\xca\x01\x02\xaa\
\xb7\x80\x5e\xc3\x30\x06\x3d\x33\x5e\x03\x11\x49\xa3\x5a\xf1\x3a\
\x70\x87\xe1\xe9\xdc\x5c\x09\x58\x46\xd5\xbf\x00\x90\x42\xe4\x75\
\xab\xe5\x75\x44\xf5\x95\xa8\x5e\xf4\x2d\xa0\x70\x4a\xfe\xbc\xe7\
\x2d\xe3\xc2\x17\x44\x22\xbe\x05\x00\x54\xd5\xd7\x4d\x79\x60\x41\
\x20\x20\xfb\x1e\xfe\x05\x76\x45\xf5\xf4\x51\x05\x54\x35\x82\xea\
\x6e\x2b\x02\x6f\x55\xa4\xff\xa8\x02\xc0\x80\xc0\x1b\xdf\x02\x02\
\x45\xe0\xbc\x65\x59\x89\x56\x9b\x6d\xdb\x4e\x01\xe7\x14\x9e\xfb\
\x16\xd8\xab\x56\x8b\xc0\x86\xc0\x54\x8b\xfd\x22\xae\x9b\x03\xd6\
\x3b\x42\xa1\x05\xaf\x90\xe7\x55\xbc\xb2\xb2\xf2\x2b\x15\x8f\x6f\
\x03\x77\x52\xc9\x64\xb5\x54\x2e\x2f\xf9\x69\xb7\xb3\xd9\x09\xe0\
\x9a\xc0\xc8\x93\x7c\x7e\xd5\xb7\x00\x40\xa9\x52\x59\x4b\xc4\xe3\
\x06\x70\x37\x95\x4c\x7e\x3b\xa4\x84\xd4\xca\xef\x8b\xc8\x74\xde\
\x71\x1e\x37\x0a\x37\xfd\x1a\x46\x63\xb1\xf1\xcf\x5b\x5b\xaa\xaa\
\x39\x2b\x9b\xbd\x14\x54\x1d\xaf\xdd\x70\xff\x60\xdb\x76\x4a\x5c\
\x37\xa7\x30\x20\x22\xb9\xb3\xd1\xe8\xed\xa6\xb6\xcd\x02\x75\x2c\
\xcb\x4a\x8b\xea\x34\xd0\x0b\x2c\x03\x8b\xc0\x76\x6d\x7c\x86\xfd\
\x1f\x92\x3e\x60\x5d\xe0\x66\xde\x71\x3c\x0f\x5e\x4b\x02\xb0\xff\
\x85\x34\x0c\x63\x50\x5c\x37\x8d\x48\x0a\xa8\xdf\x13\x3b\x0a\xef\
\x44\xb5\xd8\x11\x0a\x2d\xcc\xcc\xcc\xfc\xf4\xb3\x6f\x9b\x36\xff\
\x37\xbf\x01\x4a\x37\xdd\xdd\x8c\xf1\x82\x6a\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xa0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x06\x00\x00\x00\x09\x08\x04\x00\x00\x00\xbb\x93\x95\x16\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x14\x1f\x0d\xfc\
\x52\x2b\x9c\x00\x00\x00\x24\x49\x44\x41\x54\x08\xd7\x63\x60\x40\
\x05\x73\x3e\xc0\x58\x4c\xc8\x5c\x26\x64\x59\x26\x64\xc5\x70\x4e\
\x8a\x00\x9c\x93\x22\x80\x61\x1a\x0a\x00\x00\x29\x95\x08\xaf\x88\
\xac\xba\x34\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xa6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x08\x15\x3b\xdc\
\x3b\x0c\x9b\x00\x00\x00\x2a\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x00\x8c\x0c\x0c\x73\x3e\x20\x0b\xa4\x08\x30\x32\x30\x20\x0b\xa6\
\x08\x30\x30\x30\x42\x98\x10\xc1\x14\x01\x14\x13\x50\xb5\xa3\x01\
\x00\xc6\xb9\x07\x90\x5d\x66\x1f\x83\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\xa6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x06\x00\x00\x00\x09\x08\x04\x00\x00\x00\xbb\x93\x95\x16\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x14\x1f\x20\xb9\
\x8d\x77\xe9\x00\x00\x00\x2a\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x06\xe6\x7c\x60\x60\x60\x42\x30\xa1\x1c\x08\x93\x81\x81\x09\xc1\
\x64\x60\x60\x62\x60\x48\x11\x40\xe2\x20\x73\x19\x90\x8d\x40\x02\
\x00\x23\xed\x08\xaf\x64\x9f\x0f\x15\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\xb6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x18\x00\x00\x00\x11\x08\x06\x00\x00\x00\xc7\x78\x6c\x30\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\
\x0b\x2c\x0d\x1f\x43\xaa\xe1\x00\x00\x00\x36\x49\x44\x41\x54\x38\
\xcb\x63\x60\x20\x01\x2c\x5a\xb4\xe8\xff\xa2\x45\x8b\xfe\x93\xa2\
\x87\x89\x81\xc6\x60\xd4\x82\x11\x60\x01\x23\xa9\xc9\x74\xd0\xf9\
\x80\x85\x1c\x4d\x71\x71\x71\x8c\xa3\xa9\x68\xd4\x82\x61\x64\x01\
\x00\x31\xb5\x09\xec\x1f\x4b\xb4\x15\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\x81\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x10\x00\x00\x00\x10\x01\x03\x00\x00\x00\x25\x3d\x6d\x22\
\x00\x00\x00\x06\x50\x4c\x54\x45\x00\x00\x00\xae\xae\xae\x77\x6b\
\xd6\x2d\x00\x00\x00\x01\x74\x52\x4e\x53\x00\x40\xe6\xd8\x66\x00\
\x00\x00\x29\x49\x44\x41\x54\x78\x5e\x05\xc0\xb1\x0d\x00\x20\x08\
\x04\xc0\xc3\x58\xd8\xfe\x0a\xcc\xc2\x70\x8c\x6d\x28\x0e\x97\x47\
\x68\x86\x55\x71\xda\x1d\x6f\x25\xba\xcd\xd8\xfd\x35\x0a\x04\x1b\
\xd6\xd9\x1a\x92\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
\x00\x00\x00\xe4\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x36\x00\x00\x00\x0a\x08\x06\x00\x00\x00\xff\xfd\xad\x0b\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x7f\x00\x87\x00\x95\xe6\xde\xa6\xaf\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\
\x09\x2a\x2b\x98\x90\x5c\xf4\x00\x00\x00\x64\x49\x44\x41\x54\x48\
\xc7\x63\xfc\xcf\x30\x3c\x01\x0b\xa5\x06\x34\xb4\x4f\x85\x87\xcd\
\xaa\xa5\x73\x18\xae\x5d\x39\xcf\x48\x2b\x35\x14\x79\xcc\xd8\xc8\
\x88\x24\x03\x7c\x89\xd0\x4f\x2d\x35\x84\xc0\xd9\x73\xe7\xe0\x6c\
\x26\x86\x91\x92\x14\x91\x7d\x4d\x54\x52\x0c\x4d\x26\xa8\x9f\x5a\
\x6a\x46\x93\xe2\x68\x52\x1c\x82\x49\x91\x91\xd2\x7a\x4c\x4b\xc7\
\x10\xc5\x08\x6c\xc5\x34\xb5\xd4\xd0\xd5\x63\x83\x15\x00\x00\x7a\
\x30\x4a\x09\x71\xea\x2d\x6e\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x00\x9f\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x08\x14\x1f\xf9\
\x23\xd9\x0b\x00\x00\x00\x23\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x0d\xe6\x7c\x80\xb1\x18\x91\x05\x52\x04\xe0\x42\x08\x15\x29\x02\
\x0c\x0c\x8c\xc8\x02\x08\x95\x68\x00\x00\xac\xac\x07\x90\x4e\x65\
\x34\xac\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x4a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdf\x04\x19\x10\x14\x1a\x38\xc7\x37\xd0\x00\x00\x00\x1d\x69\x54\
\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x00\x00\x00\x00\x43\x72\
\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x64\
\x2e\x65\x07\x00\x00\x01\xae\x49\x44\x41\x54\x78\xda\xed\x9b\x49\
\x92\xc3\x20\x0c\x45\x23\x5d\xdc\xf6\xc9\xd3\xbb\xae\x54\x06\x26\
\xe9\x7f\x09\x8c\xd6\x5d\x32\xef\x21\x68\x20\xf0\x78\xec\xd8\xb1\
\xe3\xce\x21\xcc\x8f\x9d\xe7\xf9\x6c\xfc\x3b\x59\x42\x40\x2b\x70\
\xa4\x10\xc9\x0a\xcd\x92\x21\xb3\x80\xa3\x44\xc8\x8c\xf0\x9e\x12\
\x64\x46\x70\x4f\x11\x32\x3b\xbc\x55\x82\xcc\x0e\x6e\x15\x21\x2b\
\xc1\x8f\x48\x90\xd5\xe0\x7b\x25\xe8\x5e\x0a\x2f\xd8\xfb\x3d\x55\
\x20\x56\xf8\xe3\x38\xfe\x73\x5c\xd7\x45\x11\xf5\xfa\xcd\xda\x77\
\x6b\x12\xd4\xbb\x61\xef\x8d\x43\xc3\x5b\x43\x11\xa5\x8f\x92\x30\
\x92\xb7\xc6\xa0\xa8\x71\xef\x2d\xc1\x92\xaf\xc4\x62\x1e\x02\xa5\
\xf1\xe7\x25\xa1\x94\xc7\x3a\xef\x88\x57\xef\xa3\x1a\xe9\x99\xf7\
\xdb\x84\xe8\x36\x09\x22\x2a\x01\xd9\xf3\x90\xff\x02\x9e\x12\x18\
\xf0\x5f\x87\x80\xc7\xa2\xc7\xda\x78\x24\xfc\xfb\x30\x80\x2c\x85\
\x2d\x95\xc0\xea\x79\xf8\x5e\x60\x44\x02\x1b\x1e\xbe\x19\xea\x91\
\x10\x01\xff\x31\x07\xa0\x36\x3d\x35\x38\x36\xfc\xeb\x3c\x40\xd9\
\x0e\x8f\xce\x09\x8c\xcd\x15\xed\x3c\xa0\x17\x86\xb5\xb3\xa4\x1e\
\x88\xb4\x42\xb1\xe0\xe9\x02\x5a\xe0\x98\xf0\x21\x02\x2c\xeb\x80\
\xe9\x05\xb4\xc2\x31\x25\x68\x36\x78\xb6\x04\x8d\x86\x67\x9c\x27\
\x84\x0a\x68\x81\x8f\x94\x00\xd9\x0d\x8e\xf6\x3c\x63\x51\x44\xd9\
\x0d\x8e\xc2\x44\x54\x82\x66\x1a\xf3\x11\x12\x34\x13\x7c\x84\x04\
\xb7\x43\x51\xc4\x18\xf6\xce\x07\x3d\x14\x45\x4c\x60\x8c\x4a\xd0\
\xac\xf0\x2c\x09\x52\x28\x97\x67\x34\xbc\xe7\x77\x7e\xfd\x48\x1a\
\x72\x26\x98\x21\x5f\x55\x80\xe5\xe6\x15\xaa\xb1\xa3\x79\x4b\x2c\
\x9a\xbd\xe7\xd1\xf9\xcd\x17\x24\xb2\x47\xad\x92\xf7\x15\x99\x8e\
\x64\xfb\x96\xd8\x8a\xb1\x2f\x4a\x0e\x24\xbf\xef\x55\xd9\xcc\x22\
\x68\x97\xa5\x33\x4a\x08\xb9\x2e\x9f\x45\x82\xf5\xd1\xc4\x7e\x32\
\x03\x68\xd8\x3d\x1f\x4d\x21\x65\x4c\xf5\x6c\xce\x43\x08\xf3\xe1\
\xe4\x8e\xbb\xc7\x1f\xfe\x88\x5a\xe2\xcd\xef\x1c\x49\x00\x00\x00\
\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x03\xcc\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x03\x49\x49\x44\
\x41\x54\x58\x85\xed\x96\xcd\x6b\x5c\x55\x18\xc6\x7f\xcf\x9d\x99\
\x98\xe9\x64\x16\xd2\x9d\xa9\x92\x0e\xa1\x0b\xd3\xd8\x76\xf0\x1f\
\x68\x11\x14\x2b\x34\x81\xde\x55\xca\xcc\xbd\xa5\x54\x5c\x04\x44\
\x6d\x3a\xd5\x4d\x16\x2e\xe2\x44\x57\xb3\x1b\xea\x78\xa7\x18\xb2\
\x08\xc8\x54\xb0\x88\x1b\xeb\xc6\x85\x68\xf3\x55\x53\xa4\xb4\x55\
\x9a\x52\x70\x25\x99\x30\xa5\x36\xb9\xaf\x8b\xf9\x68\xc1\xcc\x0c\
\x53\xba\x6b\x9e\xdd\x39\xe7\x39\xef\xfb\xbb\xef\x7d\xef\x39\x17\
\x76\xb5\xab\xe7\x5d\xea\xc5\xec\xba\x6e\xdf\x40\x3c\x3e\x2e\x69\
\x0c\x48\x1b\x0c\x02\x60\xb6\x8e\x74\x4d\x50\xa9\xd6\x6a\x95\x85\
\x85\x85\x7f\x9f\x39\x80\x9f\xc9\x9c\x34\x29\x2f\xd8\x0f\xac\xca\
\xec\xaa\x49\xeb\x8d\xe5\x41\xe0\x28\x30\x0a\xdc\x32\x69\x2a\x08\
\x82\x6f\x9e\x09\x80\xeb\xba\x91\x64\x22\x91\x37\xb3\x0f\x04\xdf\
\x13\x89\xe4\x4a\xa5\xd2\xf2\x4e\x5e\xcf\xf3\x0e\x0b\x66\x30\x7b\
\xd3\xcc\x66\x87\x52\xa9\xdc\xf4\xf4\x74\xd8\x29\x7e\xb4\x1b\x40\
\x23\xf9\xfb\xc0\xb9\x52\xb9\xfc\x79\x27\x6f\x10\x04\x4b\xc0\x5b\
\xa7\x3d\xef\x1c\x30\xf3\xe7\xed\xdb\x00\x53\x9d\xf6\x74\xac\x80\
\x9f\xc9\x9c\x44\x5a\x10\x7c\x54\x2a\x97\xbf\x00\x98\x9c\x9c\x7c\
\x61\x73\x63\xe3\x5d\x83\x09\xd5\x4b\x0e\x66\x2b\xe6\x38\x73\xc9\
\x64\xb2\x58\x28\x14\x1e\x02\xf8\xd9\xec\x14\xf0\x99\x49\xe3\x41\
\x10\x54\x7a\x06\x70\x5d\xb7\x6f\x60\xcf\x9e\x1b\xc0\x1f\x5f\x95\
\xcb\x6f\x03\x9c\x99\x98\xd8\xb7\x1d\x8b\x5d\xc1\x6c\x14\x08\x01\
\xa7\x61\x0f\x01\x47\xb0\xe2\x6c\x6d\x1d\xbf\x38\x37\xb7\xde\x80\
\xf8\x01\xd8\xbf\x59\xab\x8d\xb4\x6b\x4c\x67\xa7\x49\x80\x81\x78\
\x7c\x1c\x48\x29\x12\xb9\xd0\x7c\xf2\xed\x58\xec\x8a\x99\x1d\xdc\
\x61\xaf\xd3\xa0\x18\x0d\xa3\xd1\xef\x5c\xd7\xed\x03\x70\xcc\xce\
\x03\xc3\x89\x44\xe2\x44\xbb\x3c\x6d\x01\x24\x8d\x61\xb6\xdc\x6c\
\xb8\x6a\xb5\x7a\x16\xb3\x51\x75\xa8\x9a\x40\x06\xaf\x0d\xc4\xe3\
\x67\x01\xbe\xbc\x74\x69\x11\xb8\x8e\x59\xef\x00\x40\x1a\xe9\xa7\
\xd6\xc8\xec\x14\xf5\x52\x77\x96\x14\x02\xa7\x5a\x43\xb3\x1f\x65\
\xf6\x7a\xcf\x00\x06\x2f\xe9\xf1\x77\x8e\x60\xa4\x0b\x70\x13\xd4\
\x91\x34\xd2\x1c\x86\x70\x0f\x69\xb0\x67\x80\x7a\x2c\xeb\xe9\xa4\
\xdc\x31\x81\xe3\x88\x0e\x95\xeb\x04\x70\x5f\x66\xfb\x5a\x30\xf0\
\x7b\xa7\x40\x2d\x49\x61\x08\xd7\x5b\xfb\xcc\x06\x31\xbb\xff\x34\
\x00\xbf\x9a\x74\xf4\x89\xc0\x5f\x77\xf1\x37\x33\x3a\x32\x9b\x7b\
\x62\xe6\x98\xe0\x97\x9e\x01\x04\x15\xe0\xa0\xe7\x79\x87\x01\x92\
\xc9\x64\x51\xb0\x62\x60\x6d\x73\x83\x21\x2d\x6d\x3e\x78\x50\x04\
\xf0\x7d\x3f\x0d\xbc\x6a\xf0\x6d\xcf\x00\xd5\x5a\xad\x02\xdc\x12\
\xcc\x00\x14\x0a\x85\x87\xce\xd6\xd6\x71\x07\x56\x1b\x96\xc7\xaf\
\xa3\xde\xf9\x48\x5a\xde\x0e\xc3\x77\x1a\x87\x8e\x14\x86\x79\xe0\
\x66\xac\xbf\xff\x72\xbb\x3c\x91\x76\x0b\x6b\x6b\x6b\xdb\xe9\x43\
\x87\xee\x02\x9f\xa4\x8f\x1c\xa9\x2d\x2e\x2d\xfd\x7c\x6d\x75\x75\
\x63\xf8\xc0\x81\x52\x5f\x34\xfa\xb7\x49\x7b\x05\x2f\x02\x8f\x0c\
\x16\x1d\x98\xd9\xac\xd5\xde\x9b\x9f\x9f\xff\x07\xc0\xcf\x66\x2f\
\x00\x67\x04\xa7\x2f\x96\x4a\x37\xda\xe5\xe9\xda\xe5\x5e\x26\x93\
\x97\xf4\xa1\xa4\x5c\x29\x08\x66\xbb\xf9\x01\xf9\xd9\x6c\x0e\xf8\
\x54\xd2\x6c\x29\x08\x72\x9d\xcc\x5d\x6f\xc3\xa1\x54\x2a\xf7\xd7\
\x9d\x3b\x66\x66\x79\x2f\x9b\x7d\x23\x62\x96\x6b\x9c\x70\xff\x93\
\xef\xfb\x69\x85\x61\xde\xe0\x98\xa4\xfc\x2b\x43\x43\x1f\x77\xa5\
\xed\x66\x68\xca\xf3\xbc\x31\x99\xcd\x02\xc3\xd4\x3f\xb3\xab\xc0\
\xdd\xc6\xf2\xcb\xd4\x7f\x48\x46\x80\x9b\x8d\xdb\xb3\x6d\xe3\x3d\
\x15\x00\xd4\x6f\xc8\x44\x22\x71\x42\x61\x38\x86\x94\x06\x9a\xe7\
\xc4\xba\xc1\x6f\x32\xab\xc4\xfa\xfb\x2f\x17\x8b\xc5\x47\xbd\xc4\
\xdd\xd5\xae\x9e\x6f\xfd\x07\xb0\xd0\x3c\xea\x1c\xa0\xa5\x5f\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xa6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x06\x00\x00\x00\x09\x08\x04\x00\x00\x00\xbb\x93\x95\x16\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x14\x1d\x00\xb0\
\xd5\x35\xa3\x00\x00\x00\x2a\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x06\xfe\x9f\x67\x60\x60\x42\x30\xa1\x1c\x08\x93\x81\x81\x09\xc1\
\x64\x60\x60\x62\x60\x60\x34\x44\xe2\x20\x73\x19\x90\x8d\x40\x02\
\x00\x64\x40\x09\x75\x86\xb3\xad\x9c\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\x96\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
\x00\x00\x00\x02\x62\x4b\x47\x44\x00\xd3\xb5\x57\xa0\x5c\x00\x00\
\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\
\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x0b\x07\x0c\
\x0d\x1b\x75\xfe\x31\x99\x00\x00\x00\x27\x49\x44\x41\x54\x08\xd7\
\x65\x8c\xb1\x0d\x00\x00\x08\x83\xe0\xff\xa3\x75\x70\xb1\xca\xd4\
\x90\x50\x78\x08\x55\x21\x14\xb6\x54\x70\xe6\x48\x8d\x87\xcc\x0f\
\x0d\xe0\xf0\x08\x02\x34\xe2\x2b\xa7\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\xa0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x06\x00\x00\x00\x09\x08\x04\x00\x00\x00\xbb\x93\x95\x16\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x14\x1c\x1f\x24\
\xc6\x09\x17\x00\x00\x00\x24\x49\x44\x41\x54\x08\xd7\x63\x60\x40\
\x05\xff\xcf\xc3\x58\x4c\xc8\x5c\x26\x64\x59\x26\x64\xc5\x70\x0e\
\xa3\x21\x9c\xc3\x68\x88\x61\x1a\x0a\x00\x00\x6d\x84\x09\x75\x37\
\x9e\xd9\x23\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x42\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xb3\x00\x79\x00\x79\xdc\xdd\
\x53\xfc\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdf\x04\x19\x10\x17\x3b\x5f\x83\x74\x4d\x00\x00\x00\x1d\x69\x54\
\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x00\x00\x00\x00\x43\x72\
\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x64\
\x2e\x65\x07\x00\x00\x01\xa6\x49\x44\x41\x54\x78\xda\xed\x9b\xdb\
\x0e\xc3\x20\x0c\x43\x9b\x68\xff\xdd\xf6\xcb\xb7\xb7\x69\x9a\x76\
\x49\x4b\xec\x98\x42\x5e\x37\x51\x7c\x70\x28\x85\xb0\x2c\x33\x66\
\xcc\x18\x39\x8c\xf9\xb0\x6d\xdb\xee\xc1\xff\xd9\x25\x00\x44\x05\
\x57\x02\x31\x55\xd1\x2c\x18\xd6\x8b\x70\x14\x08\xeb\x51\x7c\x26\
\x04\xeb\x51\x78\x26\x08\xeb\x5d\x7c\x2b\x04\xeb\x5d\x78\x2b\x08\
\xbb\x92\xf8\x33\x10\xec\x6a\xe2\x8f\x42\xb8\x55\x76\x72\x5d\xd7\
\x67\x27\xf7\x7d\x2f\x01\x6c\x55\xa3\xff\x2a\x1e\x05\x21\xe2\x02\
\x53\x11\x5f\x05\xc1\x2b\x6d\x7f\xe6\x77\x6a\x0a\x64\x8f\xfe\x11\
\x71\x99\x4e\xf8\xe5\x02\x53\x14\xcf\x84\xe0\xd5\xb6\xff\x25\x92\
\x91\x0e\x86\x1e\xfd\xa8\x78\xc6\xc4\xf8\xc9\x05\xae\x32\xf2\x55\
\x4e\x70\x25\xdb\x57\x40\x30\x84\xfd\x5b\xed\x8c\x4c\x87\xf7\x34\
\x70\x85\x91\xaf\x74\x82\xab\x89\x67\x43\x70\x45\xf1\x4c\x08\x96\
\x91\xff\xe8\x57\x58\x76\xfb\xaf\xf3\x80\x2b\x8e\x3c\xd3\x09\xae\
\x2e\x1e\x0d\xc1\x7b\x10\x8f\x84\xe0\xcc\x4e\x2a\xb6\x4f\x5d\x07\
\x28\xb6\xef\x6a\x39\xc9\x4e\x3b\x57\xcb\x49\xf6\x9c\xe3\xc8\x9c\
\xcc\x82\x80\x9c\x70\x53\xe6\x00\x24\x04\xf4\xdb\x26\xf5\x6b\x30\
\xbb\xb3\x08\xf1\xd0\xaf\xc1\x4c\x27\xb0\xd6\x19\xd4\x75\x40\x14\
\x02\x73\x91\x05\xd9\x11\x6a\x81\xc0\x5e\x61\x42\x37\x45\x8f\x8a\
\x41\x8b\xa7\x6f\x8a\x1e\x71\x42\xc5\xb7\x05\x1c\x40\x14\x42\x95\
\xf8\xaf\x29\x90\x99\x06\x2d\xeb\x81\xcb\x9c\x0c\x9d\x11\xc3\xaa\
\x17\xa0\x1e\x8e\x46\x9d\xc0\x3c\x22\xa7\x1f\x8f\xff\x13\xc7\xae\
\x14\x29\x29\x90\xf8\xe6\x04\x84\xf8\x7f\x05\x12\x65\x25\x32\xef\
\x10\x2a\xc4\x87\x01\x20\x21\xa0\x22\x5a\x25\xe6\xcb\xe0\x31\x0b\
\x25\x4f\x34\x3e\x6e\xa9\xac\x32\x08\x5a\xb1\xb4\x22\x84\x92\x72\
\x79\x15\x08\xad\x97\x26\xe6\x95\x19\x40\xc7\xc6\xbc\x34\x85\x84\
\xd1\xd5\xb5\xb9\x0c\x20\xcc\x8b\x93\x33\x46\x8f\x07\x53\x21\x72\
\xe7\x17\x36\x2b\x63\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
\x82\
\x00\x00\x03\xac\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x03\x29\x49\x44\
\x41\x54\x58\x85\xed\x95\x4f\x68\x5c\x55\x14\xc6\x7f\xe7\x65\x88\
\x64\xda\xc6\xbd\xa9\x94\x48\x57\xb6\x91\x3a\x28\xae\xd3\x4d\xc5\
\x0a\x4d\x40\x66\x63\xda\x37\x2f\x25\xcd\x46\x07\xd1\x24\x8e\xae\
\xb2\x50\xa8\x49\xdd\x64\x99\xc2\xbc\x19\xd3\x6e\x9e\x20\x53\xc1\
\xe2\x9f\x85\x75\x1b\xfc\xd3\xa4\x15\x91\x52\x4a\x70\x4a\xd7\x25\
\x33\x24\xcd\xe0\xfb\x5c\xbc\x37\x4d\x90\xbc\x37\x1d\xe9\xce\xf9\
\x56\xf7\xcf\x77\xce\xfd\xee\x39\xe7\x9e\x0b\x3d\xf4\xf0\x7f\x87\
\x75\x43\x0e\x82\xa0\x7f\xab\xd1\x18\x97\xd9\x98\x41\x0e\x18\x8a\
\xb7\xea\x98\xfd\x2a\xa8\x65\xb3\xd9\x5a\x3e\x9f\xdf\x79\xea\x02\
\xaa\xe5\xf2\x5b\x98\x2d\x00\xc3\x06\xb7\x04\x37\x64\x56\x07\x70\
\xc2\x70\x08\xb3\x51\xc1\x08\x70\xd7\x60\xee\x9c\xe7\x7d\xf5\x54\
\x04\x04\x41\xd0\xb7\xd5\x6c\x2e\x00\xef\x1b\x7c\x6b\x61\x58\x3a\
\x7b\xfe\xfc\xda\x7e\x5c\xdf\xf7\x4f\x38\x70\x11\x38\x05\x2c\xde\
\xdb\xd8\x28\xcd\xcf\xcf\x87\x69\xfe\x33\x9d\x04\xc4\x87\xbf\x27\
\x69\xd6\x9d\x9c\xbc\x94\xc6\xf5\x3c\xef\x26\xf0\x7a\xd5\xf7\x67\
\x81\x8b\xc3\x47\x8e\x00\xcc\xa5\xd9\xa4\x46\x20\x0e\xfb\x97\x66\
\x36\x73\xae\x50\xf8\x1c\x60\x69\x69\xe9\x99\xc1\xc1\xc1\x69\x93\
\xde\x26\x0a\x39\x26\xad\xcb\xec\xea\xc3\xcd\xcd\xe5\x62\xb1\xf8\
\x08\xa0\x52\xa9\xcc\x99\xf4\x99\x03\xe3\x67\x3d\xaf\xd6\xb5\x80\
\x20\x08\xfa\xb7\x9b\xcd\x3f\x24\xfd\xe9\x4e\x4e\xbe\x01\x70\xe5\
\xf2\xe5\xc3\x61\x26\x73\x3d\xce\x75\x08\x38\x31\x3d\x1a\x9b\xad\
\xf7\xb5\x5a\xa7\x27\xa6\xa6\xea\x00\x15\xdf\xff\xde\xcc\x86\x07\
\xb2\xd9\x63\x49\x85\xe9\xec\xb7\x08\xb0\xd5\x68\x8c\x0b\x5e\x70\
\xa4\x8f\xda\x37\x0f\x33\x99\xeb\x32\x3b\xbe\x8f\x6d\x7b\x3c\xf2\
\x77\x26\xf3\x4d\x10\x04\xfd\x00\xe6\x38\x1f\x22\x1d\xdd\x6e\x36\
\xcf\x24\x9d\x93\x28\x40\x66\x63\xc0\x5a\xbb\xe0\x9e\x3d\x74\xe8\
\x82\x60\x04\x29\x39\x6d\xd1\xde\x4b\x5b\x8d\xc6\x05\x00\xd7\x75\
\x7f\xc3\xec\x36\xd0\xbd\x00\x83\x9c\x49\x3f\xed\x59\x9a\x20\x0a\
\x75\x3a\xa4\xd0\x22\x6e\x7b\xfe\xa3\xe0\x95\xae\x05\x60\xf6\x5c\
\xfb\x9d\xc7\x38\x96\xca\xdf\xb5\x73\x14\x71\xdb\xb8\x8f\xd9\x50\
\x12\x3d\xd5\xa1\xcc\xba\xea\x94\xfb\xea\x01\x43\x4a\x8c\x5c\xb2\
\x00\xe9\x81\x49\x87\xf7\xac\xfc\xce\x13\xa6\x40\x70\xfb\xf1\x34\
\xba\xfd\x83\xee\x05\x98\xfd\x8c\xd9\xe8\x9e\x95\x2b\xa9\xfc\x5d\
\x3b\xc7\xe0\xea\xae\x1e\x9d\x04\x56\xbb\x16\x20\xa8\x21\x1d\xf7\
\x7d\xff\x04\xc0\xc3\xcd\xcd\x65\xcc\xd6\x31\x53\xca\xe1\x02\x6e\
\x0e\x1c\x3c\xb8\x0c\xb0\x52\x2e\xe7\x0c\x5e\x44\xfa\xba\x6b\x01\
\xd9\x6c\xb6\x06\xdc\x8d\x7b\x3b\xc5\x62\xf1\x51\x5f\xab\x75\x1a\
\xb8\x15\x53\x76\xd3\xd1\xce\xb1\xb4\x86\xe3\xbc\x99\xcf\xe7\x77\
\x24\x59\x18\x7d\x5e\x77\xb6\x5b\xad\x6b\x5d\x0b\xc8\xe7\xf3\x3b\
\x38\xce\x2c\x70\x2a\xee\xed\x4c\x4c\x4d\xd5\x07\xb2\xd9\x57\x91\
\xde\x95\xb4\x0a\x34\x81\xa6\x60\xd5\xcc\xde\x19\x38\x70\xe0\x35\
\xd7\x75\xef\x03\x54\x7d\xbf\x04\x9c\x94\xd9\xcc\xf4\xf4\x74\x2b\
\xe9\x9c\x8e\x55\x5e\xf5\xfd\x05\xe0\x03\xa0\xe4\x7a\xde\x62\x27\
\xbe\x24\xab\xfa\x7e\xc9\xcc\x3e\x01\x16\x5d\xcf\x2b\xa5\xf1\x3b\
\x16\xd5\xbd\x8d\x8d\x92\xa4\x4b\xc0\x42\xd5\xf7\xbf\xab\x56\xab\
\x2f\x27\x71\x57\xca\xe5\xdc\x17\x95\xca\x0f\x66\xf6\x29\xd1\x77\
\xfc\x71\x27\xff\x4f\xfc\xce\x57\x7c\x7f\x2c\x34\x5b\x44\x3a\x1a\
\xb7\xd7\x1b\x82\xbf\x62\x27\xcf\x23\x8d\x12\x35\xa0\x3b\x32\x9b\
\x29\x14\x0a\x89\x85\xf7\x9f\x04\xc0\xe3\x1f\xf2\x8c\x60\x0c\xc8\
\x61\x16\xf5\x09\xa9\x6e\xf0\x8b\xa4\xda\x76\xab\x75\x2d\x2d\xe7\
\x3d\xf4\xd0\xc3\xbf\xf1\x0f\x78\xe5\x4e\xf2\x11\xe4\x69\x42\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xe3\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x60\x49\x44\
\x41\x54\x58\x85\xed\xd7\x3b\x4e\x42\x61\x10\x86\xe1\x77\x40\x45\
\xbc\x2c\x00\xdd\x82\x98\x90\x00\x46\x05\x57\x21\xa5\x17\x62\x2c\
\xb0\x43\x12\x5d\x83\x0d\xd8\x88\x15\xde\x62\x89\x7b\x30\x39\x60\
\x14\x49\x4e\x08\x7b\x10\x7b\x2f\x08\x08\x63\xa1\x87\x40\xa0\x3c\
\xc4\x44\xcf\xd7\xfd\x53\xfc\xdf\x53\xce\xc0\x7f\x8f\xf4\xbd\x54\
\x25\x92\x79\xd8\x16\x95\x04\x82\x1f\x98\xb4\xa9\xe7\x03\xa5\x0a\
\x92\x35\xf6\x43\x97\x88\xe8\x20\x40\x55\xd6\x8e\x4b\x17\xaa\x6c\
\x02\x0d\x01\x53\xd1\x57\x3b\xda\x05\x99\x51\x08\x00\x1e\x90\x73\
\x23\x19\xda\xb1\x10\x5d\x40\x24\x7d\x1f\x17\xe4\x0c\xb4\x88\x8c\
\xc5\x8c\x64\xb0\x66\x47\xb9\x95\x68\xa6\xec\x43\xdb\x79\x60\x45\
\x95\xad\x42\x6a\xe9\x0a\xc0\xd5\x55\xaa\x24\x80\x86\xfb\xd3\xb5\
\x6e\x77\x39\x80\x91\x0c\xd6\x3a\xad\x56\x0c\x68\x8a\xb0\x67\xcd\
\xbb\x00\x84\x05\x01\xf3\xf6\x20\xfc\x6c\x77\xb9\x95\xe2\x61\xe4\
\x09\x30\x01\xff\x20\x00\xbc\x0a\xef\xa3\x2a\xef\xc9\x1b\x30\x35\
\x0c\xf0\x2b\x71\x00\x0e\xc0\x01\x38\x00\x07\xe0\x00\x1c\x80\x03\
\xe8\x05\xd4\xa5\x67\x53\x19\x61\xa6\x81\xfa\x10\x80\x56\x15\x02\
\xd1\x4c\xd9\x37\xaa\xe6\xe5\xf4\xdd\x3c\x10\x10\xa8\x0c\x02\xd4\
\x75\x0a\x78\xd0\xf6\xcd\xea\x51\x61\x6e\x14\xe5\xe3\xb8\xf3\xc0\
\x44\x47\x34\x6b\xcd\xfb\x0e\x93\x68\xe6\x31\x07\x1a\x07\x9a\x80\
\x09\xfa\x62\x4f\xbd\xcc\xf2\x7d\x98\x4c\x28\xe4\x0a\xc9\xf0\xee\
\xc0\x61\x62\x21\x22\xe9\xd2\xc6\xcf\xde\xbe\x08\x78\xed\x01\x50\
\x17\xa8\xa8\xca\x89\x91\x0a\x5f\xdb\xf4\xe7\x1f\xc9\x17\xa4\x29\
\x70\x23\xfc\x8b\x13\x87\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\
\x60\x82\
\x00\x00\x00\x9e\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x08\x15\x0f\xfd\
\x8f\xf8\x2e\x00\x00\x00\x22\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x0d\xfe\x9f\x87\xb1\x18\x91\x05\x18\x0d\xe1\x42\x48\x2a\x0c\x19\
\x18\x18\x91\x05\x10\x2a\xd1\x00\x00\xca\xb5\x07\xd2\x76\xbb\xb2\
\xc5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\xd8\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x02\x55\x49\x44\
\x41\x54\x58\x85\xed\x95\x4d\x4f\x53\x51\x10\x86\x9f\xb9\x1a\x12\
\xef\x4f\x10\x0d\xc1\xb0\x12\x4d\xb0\xf1\x0f\xc0\x06\xe3\x06\x48\
\x4c\x77\xd0\x0f\x16\x6c\x8d\x01\x2c\xae\x58\x68\x82\x05\xff\xc2\
\x3d\xad\xec\xae\x89\x16\x57\x7e\x2c\xc4\xad\xf1\x8b\x68\x62\x0c\
\x21\xa4\xb1\x86\x3f\xd0\x86\x86\x26\x7d\x5d\xb4\x21\xc6\x70\x5b\
\x2e\xb0\xb3\xef\x76\xe6\xcc\x3c\x67\xce\x99\x19\xe8\xa9\xa7\xff\
\x5d\x16\xc7\x39\x0c\xc3\xbe\xfd\x6a\x75\x4a\x66\x93\x06\x09\xa0\
\xbf\x6d\xaa\x60\xf6\x59\x50\xf2\x7d\xbf\x94\x4c\x26\x0f\xce\x1c\
\xa0\x18\x04\x77\x30\xcb\x03\x83\x06\xdf\x04\x9b\x32\xab\x00\x78\
\xcd\x66\x3f\x66\xa3\x82\xeb\xc0\x8e\xc1\xe2\x4c\x26\xf3\xfc\x4c\
\x00\xc2\x30\x3c\xb7\x5f\xab\xe5\x81\x7b\x06\xaf\xac\xd9\xcc\x4d\
\xcf\xce\x6e\x1d\xe5\xeb\x9c\x1b\xf1\x60\x05\x18\x07\x56\x77\xcb\
\xe5\xdc\xf2\xf2\x72\xb3\x53\xfc\xf3\xdd\x00\xda\xc9\xef\x4a\x5a\
\x48\x65\xb3\x6b\x9d\x7c\x33\x99\xcc\x57\xe0\x56\xd1\xb9\x05\x60\
\x65\x70\x60\x00\x60\xb1\xd3\x99\x8e\x15\x68\x97\xfd\x99\x99\xcd\
\xcf\xa4\xd3\x4f\xba\xc1\xfe\xad\x42\xa1\xb0\x68\xd2\x63\x0f\xa6\
\xa6\x33\x99\x52\x6c\x80\x30\x0c\xfb\xea\xb5\xda\x0f\x49\x3f\x53\
\xd9\xec\xed\x38\xc9\x0f\x21\x9c\x7b\x63\x66\x83\x17\x7c\x7f\x38\
\xea\x63\x7a\x51\x87\xf7\xab\xd5\x29\xc1\x15\x4f\x5a\x3a\x49\x72\
\x00\xf3\xbc\xfb\x48\x43\xf5\x5a\x6d\x22\xca\x27\x12\x40\x66\x93\
\xc0\x56\xd4\x87\x3b\x8e\x52\xa9\xd4\x17\xcc\xbe\x03\xf1\x01\x0c\
\x12\x26\xbd\x3f\x69\xf2\x43\x49\xef\x04\x37\xa3\xcc\xd1\x5d\x60\
\x76\x51\x50\x39\x35\x00\xfc\xc6\xac\x3f\xca\x18\x59\x01\x00\x99\
\xc5\x9a\x94\x47\xc9\xc0\x90\x22\x67\x41\x34\x80\xb4\x67\xd2\xa5\
\xd3\x02\xa8\x75\xfb\xbd\x28\x7b\xa7\x27\xf8\x08\x8c\x9e\x1a\x40\
\x1a\x33\xf8\x10\x65\x8f\xee\x02\x28\x21\x5d\x73\xce\x8d\x9c\x34\
\xf9\x7a\x10\x24\x0c\xae\x22\xbd\x8c\x0d\xe0\xfb\x7e\x09\xd8\x69\
\xcf\xf6\xd8\x92\x64\xcd\xd6\xf2\xda\xae\x37\x1a\x1b\xb1\x01\x92\
\xc9\xe4\x01\x9e\xb7\x00\x8c\xb7\x67\x7b\x2c\x15\x9d\xcb\x01\x63\
\x32\x9b\x9f\x9b\x9b\x6b\xc4\x06\x00\x48\xa5\x52\x2f\x80\x55\x60\
\xe5\xb8\x10\x92\xac\x10\x04\x4b\x66\xf6\x10\xc8\xa7\xd3\xe9\xc8\
\xf2\x77\x05\x00\xd8\x2d\x97\x73\x92\xd6\x80\x7c\xd1\xb9\xd7\xc5\
\x62\xf1\x46\x94\xef\x7a\x10\x24\x9e\x16\x0a\x6f\xcd\xec\x11\xad\
\x75\xfc\xa0\x5b\xfc\x63\xf7\xf9\xba\x73\x93\x4d\xb3\x55\xa4\xa1\
\xf6\x78\xdd\x14\xfc\x6a\x07\xb9\x8c\x34\x0a\x0c\x03\xdb\x32\x9b\
\xef\x76\xf3\xd8\x00\x70\xb8\x21\x27\x04\x93\x40\x02\xb3\xd6\x9c\
\x90\x2a\x06\x9f\x24\x95\xea\x8d\xc6\x46\xa7\x37\xef\xa9\xa7\x9e\
\xfe\xd5\x1f\x3e\xd4\xef\x44\x0d\xbc\xff\x65\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xa5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\x9c\x53\x34\xfc\x5d\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x0b\x02\x04\x6d\
\x98\x1b\x69\x00\x00\x00\x29\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x00\x8c\x0c\x0c\xff\xcf\xa3\x08\x18\x32\x32\x30\x20\x0b\x32\x1a\
\x32\x30\x30\x42\x98\x10\x41\x46\x43\x14\x13\x50\xb5\xa3\x01\x00\
\xd6\x10\x07\xd2\x2f\x48\xdf\x4a\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82\
\x00\x00\x03\xa5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x03\x22\x49\x44\
\x41\x54\x58\x85\xed\x96\x4d\x6c\x54\x55\x14\xc7\x7f\xe7\x0d\xa9\
\x09\xcc\x90\x50\x76\xb6\xc6\x60\x60\xe3\xa3\x86\x34\xf4\xc3\xc6\
\x67\xa4\x1b\xa2\x98\x40\x13\x5d\xc9\x1a\x36\xda\x84\x7e\x59\x5c\
\xcd\xce\x3a\xa4\x33\x09\xcb\xae\x65\x83\x89\x19\x4c\x04\xc3\xc6\
\x3a\x98\xb4\x6f\x22\x62\x4b\x27\xc6\x34\xac\x9c\x06\x37\x94\x74\
\x98\x92\x50\x3a\xef\xef\xe2\x4d\xa7\x35\x99\xe9\xcc\x43\x76\xf4\
\xbf\xba\xe7\xbd\x73\xef\xf9\xdd\x73\xee\x17\xec\x69\x4f\xaf\xba\
\x2c\x8a\xb3\x9b\x2c\xb4\x1d\x4e\xac\x0f\xc9\x38\x07\xea\x06\x3a\
\xaa\xbf\x8a\x88\xdf\xcd\x2c\xfb\xa8\x74\x20\x5b\x48\xba\x1b\x2f\
\x1d\xc0\xcb\xcc\x7f\x82\x2c\x05\x1c\x01\xbb\x8f\x34\x8b\x43\x11\
\xc0\xa4\x0e\xe1\x9c\x02\x75\x61\x3c\x30\x6c\x22\x77\xa9\xf7\xfb\
\x97\x02\xf0\xe9\xf5\xeb\xb1\x7f\x56\xde\x4c\x21\x46\x80\x9f\x24\
\x26\x7f\x1d\xed\x5b\xa8\xe7\x3b\x90\xc9\x9f\x88\x05\x9a\xc2\x38\
\x0d\x5c\xb9\x53\xea\x9d\x24\x69\x41\xab\x93\xac\x2b\x2f\xe3\x4f\
\x7b\x69\xbf\xf2\x7e\x66\x7e\xac\xe5\x3e\x69\x7f\xdc\x4b\xfb\x15\
\x2f\xed\xa7\x9a\xf9\xee\x9a\x81\x6a\xda\xbf\x33\x6c\x2c\x37\xd2\
\x3b\x0d\xf0\xe1\xd5\xe5\xd7\x9e\x3c\x7f\x7c\xd1\xe0\x33\x59\xd0\
\x15\x0e\x62\x8b\x18\xd7\xe2\xb1\xf6\x99\x5b\xc3\xc7\x9e\x55\xc1\
\x27\x10\xdf\x60\x0c\xdd\xb9\xd4\x97\x8d\x0c\xe0\x26\x0b\x6d\xed\
\x07\xcb\x7f\x1a\xfa\x2b\x37\xd2\xff\x11\xc0\x07\x57\xe7\x3b\x2b\
\x9b\xce\x4d\x50\x17\x58\x00\x72\xaa\xc3\x84\x6d\x63\x31\x16\xd3\
\x99\xd9\xe1\xfe\x22\xc0\x7b\x99\xfc\x6d\x93\x8e\xac\x96\xe2\x6e\
\xa3\x85\xe9\x34\x02\x38\x9c\x58\x1f\x02\xde\x0a\x64\x97\xb7\x66\
\x5e\xd9\x74\x6e\x62\x3a\x1e\x7a\x68\x47\xdf\x5a\xbb\xab\xb2\xc9\
\x8f\x6e\xb2\xd0\x06\xe0\x04\xf6\x25\x70\xf4\x50\xa2\x7c\xb6\x51\
\x9c\x86\x00\xe1\x56\x63\x61\x6b\xc1\x95\x2b\xab\x17\x40\x5d\x68\
\x97\xb2\x09\x03\x7b\xa7\xfd\x60\xf9\x02\x40\x6e\xb4\xe7\x9e\xc4\
\x92\x41\x74\x00\x50\xb7\xa1\x5f\x6a\x66\x60\xe7\xc3\x54\xef\x2e\
\x41\x00\x9c\xdf\xb2\x0d\x7e\xc6\x38\xf9\x02\x00\xbc\x2e\xac\x58\
\xb3\x4c\xee\x7f\xd3\x5e\x5f\x06\x0e\xc8\xdd\x01\xb4\xc2\xf6\x81\
\x15\x09\x00\x2c\xda\x49\x59\x37\x80\x99\x11\x66\x25\x32\xc0\x43\
\x02\x3a\x6b\x96\xac\xd0\x6a\x09\x24\x96\xb6\x6d\x75\x00\x0f\xa3\
\x03\x88\xdf\x04\xa7\xb6\x3d\xf5\x6d\xab\x25\x30\xb3\x6b\x3b\x3e\
\x0d\x02\xf9\xc8\x00\x66\x96\x35\xe3\xf8\x40\x26\x7f\x02\x20\x1e\
\x6b\x9f\xc1\x58\xc4\xd0\x2e\xd1\x25\xe3\x8f\xd5\x52\x7c\x06\xc0\
\xcb\xcc\x75\x03\x6f\x63\xfa\x21\x32\xc0\xa3\xd2\x81\x2c\xc6\x83\
\x58\xa0\x29\x80\x5b\xc3\xc7\x9e\xc5\x62\x3a\x03\xdc\xaf\x46\xab\
\x95\xa3\xba\xf2\x11\x2c\x54\x54\xf9\xb8\x90\x74\x37\x90\x0c\x39\
\x29\x60\xf9\xe9\xfe\x7d\x37\x22\x03\x14\x92\xee\x86\xc4\x38\xc6\
\x69\x2f\xed\x8f\x03\xcc\x0e\xf7\x17\x57\xd7\xe2\x3d\xc0\x17\x52\
\x90\x07\xd6\x81\x75\xa4\xbc\x99\x3e\x7f\xbc\x16\xef\x9b\x1b\x19\
\x58\x01\xf0\xd2\xfe\x24\x30\x68\x0a\xc6\xee\x5e\x3c\xf9\xbc\x51\
\x9c\xa6\xf2\xd2\x7e\xaa\x7a\xb1\x8c\xb7\xd4\x41\x32\x6f\x7a\xfe\
\x72\x78\x81\xf9\x53\xcd\xdc\x9b\x6f\xb3\xa4\x1c\x2f\x91\xff\x1a\
\x63\x02\xb8\x6d\x72\x26\x73\xa3\x3d\xf7\xea\xc2\x66\xe6\xba\xab\
\x69\x1f\x34\x23\x95\x5b\xeb\xfd\xaa\xd9\x75\x1c\xe1\x41\xe2\x9f\
\x43\x5c\x01\x8e\x4a\x2c\x99\x31\x8b\xf1\x37\x00\xe2\x0d\xc2\x1d\
\xe3\x02\xcb\xa6\x60\x2c\x37\xfa\x6e\xc3\x85\xf7\x42\x00\x10\xde\
\x90\x87\x12\xe5\xb3\x54\x9f\x64\x86\x75\x86\xf1\x55\x34\xd9\x5d\
\x1c\x65\x9f\xee\xdf\x77\xe3\x7f\xd5\x7c\x4f\x7b\x7a\xe5\xf4\x2f\
\x95\x3f\x47\xac\x6d\xe5\x30\x73\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82\
\x00\x00\x01\xec\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x69\x49\x44\
\x41\x54\x58\x85\xed\x97\x3b\x4e\xc3\x40\x10\x86\xbf\xb1\xa2\x84\
\xe7\x01\x02\x57\x00\xa4\xdc\x85\x94\x8e\xed\x44\x14\x70\x1f\x42\
\x65\x2d\x1b\x53\x86\x3b\xd0\x50\x47\x51\xee\x40\xe8\x79\x84\x3c\
\xe4\xa1\x70\x8c\x8c\x2c\x25\x05\x36\x05\xf8\xaf\x76\xb5\x23\x7f\
\x9f\xad\x95\x3c\x03\xff\x3d\x92\xdd\xa8\xaa\x58\x63\x7c\x47\xe4\
\x52\xe1\x14\xd8\x29\x88\xf3\x21\x30\x01\xfa\xae\xef\x5b\x11\xd1\
\x9c\x80\xaa\x4a\x64\xcc\xad\x8a\x74\x80\x39\x30\x42\xe4\xb5\x10\
\xbc\xea\x01\xd0\x02\x1a\x88\x98\x8e\xe7\xf5\x52\x89\x5a\x5a\x63\
\x8d\xf1\x25\x81\x3f\x3a\xb5\x5a\xdb\x75\xdd\x69\x21\xf0\x75\xa2\
\x28\x6a\xc6\xab\xd5\x10\xd5\xc0\x5a\xfb\x00\x0c\x00\x9c\xb4\xc0\
\x11\xb9\x04\xe6\x31\x9c\x17\x0d\x07\x70\x5d\x77\xba\x8a\xe3\x36\
\xb0\x10\xd5\xab\x2f\x6e\xba\x50\x38\x01\x46\x41\x10\x3c\x17\x0d\
\x4f\xd3\xeb\xf5\x9e\x80\x11\xc9\xfd\xfa\x2e\x00\xec\x02\xef\x65\
\xc1\x33\x79\x03\xf6\xd2\x4d\x6d\x43\x21\x00\xd6\x18\xdd\x56\xb3\
\x29\x5e\x10\xc8\xa6\x73\x67\xd3\xe1\x6f\xa4\x12\xa8\x04\x2a\x81\
\x4a\xa0\x12\xa8\x04\x2a\x81\xad\xfd\xc0\xb6\xff\xf9\x4f\x93\xfd\
\x02\x33\x32\x9d\x4a\x89\xd9\x5f\xb3\x72\x02\x13\xa0\x15\x45\x51\
\xb3\x2c\xb2\xb5\xf6\x98\xa4\x3d\x1f\xe7\x04\x04\x6e\x80\x46\xbc\
\x5c\xde\x87\x61\x78\x54\x0a\x3c\x8e\x87\x40\x5d\xa0\x9f\xe1\x26\
\x51\x55\x19\x58\x1b\xa2\x1a\x00\x0b\x92\xc1\xe4\xa5\x10\xba\xea\
\x21\xc9\x9b\xd7\x15\x42\xcf\xf7\x2f\xd2\xc1\x24\x3f\x9a\x59\xeb\
\xae\xfb\xf6\x33\x92\x4e\xb9\x88\xcc\x80\x31\xaa\xd7\x5e\xb7\x7b\
\x57\xd0\x33\xff\x48\x3e\x01\xac\x18\x7a\x56\x83\xd7\xe8\x6e\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xed\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x6a\x49\x44\
\x41\x54\x58\x85\xed\x97\xcb\x4e\xc2\x40\x14\x86\xbf\x43\x08\x78\
\x7d\x00\xf4\x15\xd4\x84\x77\x91\x65\x69\x0b\x71\xa1\xef\x23\xae\
\x9a\x71\xa8\x4b\x7c\x07\x37\xae\x09\xe1\x1d\xc4\xbd\x17\xe4\x92\
\x1e\x17\xa5\xa6\x06\xd8\x98\x21\x18\xed\xbf\x9a\x76\x26\xfd\xbe\
\x4e\xa6\xcd\x39\xf0\xdf\x23\xf9\x0b\x55\x15\x6b\x4c\x50\x12\xb9\
\x54\x38\x05\x76\x1c\x71\x3e\x04\x86\x40\xc7\x0b\x02\x2b\x22\xba\
\x24\xa0\xaa\x12\x1b\x73\xab\x22\x4d\x60\x02\xf4\x11\x79\x75\x82\
\x57\x3d\x00\xea\x40\x15\x11\xd3\xf4\xfd\x76\x26\x51\xce\xd6\x58\
\x63\x02\x49\xe1\x8f\xa5\x72\xb9\xe1\x79\xde\xc8\x09\x7c\x91\x38\
\x8e\x6b\xc9\x7c\xde\x43\x35\xb4\xd6\x3e\x00\x5d\x80\x52\xb6\xa0\
\x24\x72\x09\x4c\x12\x38\x77\x0d\x07\xf0\x3c\x6f\x34\x4f\x92\x06\
\x30\x15\xd5\xab\x2f\x6e\x36\x50\x38\x01\xfa\x61\x18\x3e\xbb\x86\
\x67\x69\xb7\xdb\x4f\x40\x9f\xf4\x7c\x7d\x17\x00\x76\x81\xf7\x4d\
\xc1\x73\x79\x03\xf6\x56\x09\x6c\x25\x85\xc0\xd6\x05\xca\xeb\x26\
\xac\x31\xba\x6e\xee\x27\xf1\xc3\x50\x56\xdd\xdf\xfa\x0e\x14\x02\
\x85\x40\x21\xb0\xf6\x3f\xb0\xee\xbb\x75\x9d\xad\xef\x40\x21\xf0\
\xab\x04\xc6\xe4\x2a\x95\x0d\x66\x7f\xc1\x5a\x12\x18\x02\xf5\x38\
\x8e\x6b\x9b\x22\x5b\x6b\x8f\x49\xcb\xf3\xc1\x92\x80\xc0\x0d\x50\
\x4d\x66\xb3\xfb\x28\x8a\x8e\x36\x02\x4f\x92\x1e\x50\x11\xe8\xe4\
\xb8\x69\x54\x55\xba\xd6\x46\xa8\x86\xc0\x94\xb4\x31\x79\x71\x42\
\x57\x3d\x24\x7d\xf3\x8a\x42\xe4\x07\xc1\x45\xd6\x98\x2c\xb7\x66\
\xd6\x7a\x8b\xba\xfd\x8c\xb4\x52\x76\x91\x31\x30\x40\xf5\xda\x6f\
\xb5\xee\x1c\x3d\xf3\x8f\xe4\x13\xfb\x36\x7a\x56\x11\xde\xcf\xd8\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x56\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdf\x04\x19\x10\x14\x2d\x80\x7a\x92\xdf\x00\x00\x00\x1d\x69\x54\
\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x00\x00\x00\x00\x43\x72\
\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x64\
\x2e\x65\x07\x00\x00\x01\xba\x49\x44\x41\x54\x78\xda\xed\x9b\x5b\
\x92\x02\x21\x0c\x45\x4d\x16\xa6\x1b\xd0\xd5\x8e\x1b\xd0\x8d\xe9\
\x9f\x65\x39\xda\x3c\x92\x7b\x13\x68\xf2\x3d\x95\xe6\x1c\x1e\x43\
\x10\x0e\x87\x15\x2b\x56\xec\x39\x84\xf9\xb1\xbf\xe3\xf1\x51\xf3\
\x77\x97\xfb\x5d\xa6\x10\x50\x0b\x1c\x29\x44\xb2\x42\xb3\x64\xc8\
\x28\xe0\x28\x11\x32\x22\xbc\xa7\x04\x19\x11\xdc\x53\x84\x8c\x0e\
\x6f\x95\x20\xa3\x83\x5b\x45\xc8\x4c\xf0\x3d\x12\x64\x36\xf8\x56\
\x09\xba\xb6\xc2\x13\xf6\x7e\xcb\x28\x10\x2b\xfc\xf9\x76\x7b\xe5\
\xb8\x9e\x4e\x14\x51\xef\xdf\x2c\x7d\xb7\x24\x41\xbd\x1b\xf6\xd9\
\x38\x34\xbc\x35\x14\x31\xf4\x51\x12\x7a\xf2\x96\x18\x14\x35\xef\
\xbd\x25\x58\xf2\x6d\xb1\x98\xa7\xc0\xd6\xfc\xf3\x92\xb0\x95\xc7\
\xba\xee\x88\x57\xef\xa3\x1a\xe9\x99\xf7\xdb\x82\xe8\xb6\x08\x22\
\x46\x02\xb2\xe7\x21\xff\x05\x3c\x25\x30\xe0\xbf\x4e\x01\x8f\x4d\
\x8f\xb5\xf1\x48\xf8\xcf\x69\x00\xd9\x0a\x5b\x46\x02\xab\xe7\xe1\
\xb5\x40\x8f\x04\x36\x3c\xbc\x18\x6a\x91\x10\x01\xff\x6f\x0d\x40\
\x15\x3d\x25\x38\x36\xfc\xfb\x3a\x40\x29\x87\x7b\xd7\x04\x46\x71\
\x45\x3b\x0f\x68\x85\x61\x55\x96\xd4\x03\x91\x5a\x28\x16\x3c\x5d\
\x40\x0d\x1c\x13\x3e\x44\x80\x65\x1f\x30\xbc\x80\x5a\x38\xa6\x04\
\xcd\x06\xcf\x96\xa0\xd1\xf0\x8c\xf3\x84\x50\x01\x35\xf0\x91\x12\
\x20\xd5\x60\x6f\xcf\x33\x36\x45\x94\x6a\xb0\x17\x26\x62\x24\x68\
\xa6\x39\x1f\x21\x41\x33\xc1\x47\x48\x70\x3b\x14\x45\xcc\x61\xef\
\x7c\xd0\x43\x51\xc4\x02\xc6\x18\x09\x9a\x15\x9e\x25\xe1\x67\x82\
\xda\x69\xc0\xaa\xe7\xad\xdf\xf9\xf5\x23\x69\xc8\x99\x60\x86\x7c\
\x45\x01\x96\x9b\x57\xa8\xc6\xf6\xe6\xdd\x62\xd1\xec\x3d\x8f\xce\
\x6f\xbe\x20\x91\x3d\x4a\x23\x79\x5d\x91\xa9\x4d\xb6\x6e\x89\x4d\
\x1a\xeb\xa2\x64\x6b\xf2\x5d\x5f\x95\xcd\x2c\x82\x76\x59\x3a\xa3\
\x84\x90\xeb\xf2\x59\x24\x58\x1f\x4d\xac\x27\x33\xde\x0d\xdb\xed\
\xa3\x29\xa4\x8c\xa1\x9e\xcd\x79\x08\x61\x3e\x9c\x5c\xb1\xf7\x78\
\x02\x51\xa0\x5a\x91\x77\xd2\x02\x23\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\x93\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x06\x00\x00\x00\x09\x08\x04\x00\x00\x00\xbb\x93\x95\x16\
\x00\x00\x00\x02\x62\x4b\x47\x44\x00\xd3\xb5\x57\xa0\x5c\x00\x00\
\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\
\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x0b\x07\x0c\
\x0c\x2b\x4a\x3c\x30\x74\x00\x00\x00\x24\x49\x44\x41\x54\x08\xd7\
\x63\x60\x40\x05\xff\xff\xc3\x58\x4c\xc8\x5c\x26\x64\x59\x26\x64\
\xc5\x70\x0e\x23\x23\x9c\xc3\xc8\x88\x61\x1a\x0a\x00\x00\x9e\x14\
\x0a\x05\x2b\xca\xe5\x75\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\
\x60\x82\
\x00\x00\x00\xa6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x09\x00\x00\x00\x06\x08\x04\x00\x00\x00\xbb\xce\x7c\x4e\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\x9c\x53\x34\xfc\x5d\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x0b\x1b\x0e\x16\
\x4d\x5b\x6f\x00\x00\x00\x2a\x49\x44\x41\x54\x08\xd7\x63\x60\xc0\
\x00\x8c\x0c\x0c\x73\x3e\x20\x0b\xa4\x08\x30\x32\x30\x20\x0b\xa6\
\x08\x30\x30\x30\x42\x98\x10\xc1\x14\x01\x14\x13\x50\xb5\xa3\x01\
\x00\xc6\xb9\x07\x90\x5d\x66\x1f\x83\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x00\xdc\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x10\x00\x00\x00\x40\x08\x06\x00\x00\x00\x13\x7d\xf7\x96\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xb3\x00\x79\x00\x79\xdc\xdd\
\x53\xfc\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdf\x04\x19\x10\x2d\x19\xaf\x4a\xeb\xd0\x00\x00\x00\x1d\x69\x54\
\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x00\x00\x00\x00\x43\x72\
\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x64\
\x2e\x65\x07\x00\x00\x00\x40\x49\x44\x41\x54\x58\xc3\xed\xce\x31\
\x0a\x00\x20\x0c\x03\x40\xf5\xa3\x7d\x5b\x5f\xaa\x53\xc1\xc9\xc5\
\x45\xe4\x32\x05\x1a\x8e\xb6\x76\x99\x5e\x25\x22\x66\xf5\xcc\xec\
\xfb\xe8\x74\x1b\xb7\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\xf0\x36\xf0\x41\x16\x0b\x42\x08\x78\x15\x57\x44\xa2\x00\
\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xa0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x06\x00\x00\x00\x09\x08\x04\x00\x00\x00\xbb\x93\x95\x16\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x02\x62\x4b\x47\x44\x00\x9c\x53\x34\xfc\x5d\x00\x00\x00\x09\x70\
\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\
\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\x0b\x1b\x29\xb3\
\x47\xee\x04\x00\x00\x00\x24\x49\x44\x41\x54\x08\xd7\x63\x60\x40\
\x05\x73\x3e\xc0\x58\x4c\xc8\x5c\x26\x64\x59\x26\x64\xc5\x70\x4e\
\x8a\x00\x9c\x93\x22\x80\x61\x1a\x0a\x00\x00\x29\x95\x08\xaf\x88\
\xac\xba\x34\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xd0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x4d\x49\x44\
\x41\x54\x58\x85\xed\xd7\x4d\x4e\xc2\x40\x18\xc6\xf1\xff\x5b\x08\
\x08\xea\x01\xd0\x2b\x88\x09\x5b\xcf\x21\xbb\xca\xd8\x1a\x49\xe0\
\x3e\x62\x42\x42\x69\x49\x97\x78\x0c\xd7\x84\x70\x07\x71\xef\x07\
\x02\x81\xd7\x85\xd4\x10\xc0\xdd\x10\x13\xed\xb3\x9b\xc9\x9b\x79\
\x7e\x93\x6e\x3a\xf0\xdf\x23\x9b\x6b\xcf\x98\x6b\xa0\x01\x94\x81\
\x03\x4b\x3d\x1f\xc0\x48\x44\x5a\x41\x18\x46\x80\xee\x02\x88\x67\
\x4c\x08\xd4\x80\x29\x30\x00\x5e\x2d\x01\x8e\x80\x0a\x90\x07\xba\
\xdd\x28\xba\x49\x10\xdf\x00\xcf\x18\x0f\x08\x04\x1e\xb3\x8b\x45\
\xb5\x1d\xc7\x63\x4b\xe5\x00\xd4\x5d\xb7\x34\x77\x9c\x3e\x22\x17\
\x02\x26\x88\xa2\x1e\x80\xb3\x36\xd3\x00\xa6\x4b\x91\x4b\xdb\xe5\
\x00\xed\x38\x1e\x4b\x36\x5b\x05\x66\x2a\xd2\x4c\xf6\xd7\x01\x67\
\xc0\x20\x0c\xc3\x67\xdb\xe5\x49\x82\x20\x78\x42\x64\x80\x6a\x79\
\x17\xa0\x80\xea\xfb\xbe\xca\xbf\xb3\x5c\xbe\x01\xc5\x5d\x80\x5f\
\x49\x0a\x48\x01\x29\x20\x05\xa4\x80\x14\x90\x02\x52\xc0\x3a\x60\
\x82\x48\xf1\xc7\x49\x6b\x8d\xce\x21\x30\xd9\x02\x28\x8c\x80\x4a\
\xdd\x75\x4b\xfb\xea\xae\xd5\x6a\xa7\xa8\x56\x80\xe1\x16\xc0\x11\
\xb9\x07\xf2\xf3\x4c\xe6\xc1\xf7\xfd\x93\x7d\x94\x67\x44\xfa\x40\
\x4e\x45\x5a\xc9\xfe\xe6\xc3\xa4\x03\x78\xc0\x6c\xf5\xf7\xfa\x62\
\xa5\x5d\xe4\x78\x75\xf3\x9c\x42\x27\x8c\xa2\x5b\x36\x1f\x26\xc9\
\xa8\x6f\xcc\x95\x8a\x34\x51\x3d\x07\x0a\x56\x00\x5f\xdf\x7c\x88\
\xea\x5d\xb7\xd7\x8b\x2d\x9d\xf9\x47\xf2\x09\x3e\x70\x64\x41\x95\
\x87\xdf\x69\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\xd0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x4d\x49\x44\
\x41\x54\x58\x85\xed\x97\x3b\x4e\xc3\x40\x14\x00\xe7\x45\x51\xc2\
\xf7\x00\x81\x2b\x00\x52\xee\x42\xca\x8d\xed\x58\x14\x70\x1f\x42\
\x65\x99\x8d\x29\xc3\x1d\x68\xa8\xa3\x28\x77\x20\xf4\x7c\x42\x3e\
\xf2\xa3\x70\x8c\x8c\x4c\xb9\x16\x12\x78\x2a\x5b\x5a\x79\x66\x25\
\x17\xef\xc1\x7f\x47\x8a\x2f\xaa\x2a\x36\x8e\xfd\x86\xc8\xa5\xc2\
\x29\xb0\xe3\xc8\xf3\x21\x30\x03\x86\xc6\xf7\xad\x88\x68\x29\x40\
\x55\x25\x89\xe3\x5b\x15\xe9\x03\x4b\x60\x82\xc8\xab\x13\xbd\xea\
\x01\xd0\x05\xda\x88\xc4\x7d\xcf\x0b\xf3\x88\x66\x7e\xc6\xc6\xb1\
\x2f\x99\xfc\xb1\xd1\x6c\xf6\x8c\x31\x73\x27\xf2\x2d\x49\x92\x74\
\xd2\xcd\x66\x8c\x6a\x60\xad\x7d\x00\x46\x00\x8d\xfc\x40\x43\xe4\
\x12\x58\xa6\x70\xee\x5a\x0e\x60\x8c\x99\x6f\xd2\xb4\x07\xac\x44\
\xf5\xea\xcb\x9b\x3f\x28\x9c\x00\x93\x20\x08\x9e\x5d\xcb\x73\xc2\
\x30\x7c\x02\x26\x64\xff\xd7\xf7\x00\x60\x17\x78\xaf\x4a\x5e\xe0\
\x0d\xd8\xfb\x29\xe0\x57\xa8\x03\xea\x80\x3a\xa0\x0e\xa8\x03\xea\
\x80\x3a\xa0\x0e\x28\x06\x2c\x28\x4c\x2a\x15\xb2\xbf\x75\x95\x02\
\x66\x40\x37\x49\x92\x4e\x55\x66\x6b\xed\x31\xd9\x78\x3e\x2d\x05\
\x08\xdc\x00\xed\x74\xbd\xbe\x8f\xa2\xe8\xa8\x12\x79\x9a\x8e\x81\
\x96\xc0\xb0\xe0\xcd\x50\x55\x19\x59\x1b\xa1\x1a\x00\x2b\xb2\xc5\
\xe4\xc5\x89\x5d\xf5\x90\xec\xe6\x2d\x85\xc8\xf3\xfd\x8b\x7c\x31\
\x29\xaf\x66\xd6\x9a\xed\xdc\x7e\x46\x36\x29\xbb\x60\x01\x4c\x51\
\xbd\xf6\x06\x83\x3b\x47\xdf\xfc\x23\x7c\x02\x90\xc4\x75\x30\xa3\
\x38\xd1\xd4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\xd4\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01\x42\x28\x9b\x78\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x02\x51\x49\x44\
\x41\x54\x58\x85\xed\x96\x41\x4b\x54\x51\x14\xc7\x7f\xe7\x8d\xb8\
\xd0\x26\x30\x77\x69\x84\xe1\xaa\x29\x90\x41\xc7\x92\x5e\xa0\x1b\
\xa1\x8d\x0a\xf5\x19\x5a\x3b\x33\xda\xd8\x6a\x16\x41\x36\x83\xf3\
\xbe\x87\x41\x8d\xad\xc2\x4d\xf6\x14\xf4\x0d\x99\x48\x0e\x11\xe2\
\xaa\x11\xdb\x18\x34\xa8\x0b\xc3\x77\x5a\xcc\x48\x10\xf3\x74\xee\
\xe8\xae\xf9\x6f\xef\x39\xfc\x7f\xf7\xdc\x7b\xcf\x3d\xd0\x54\x53\
\xff\xbb\xc4\x24\x38\x92\x2e\xb6\x76\x86\x0f\x27\x54\x18\x07\x8d\
\x02\x5d\xd5\xa5\x12\xca\x67\x11\xc9\xef\x97\xdb\xf3\xc5\x74\xe4\
\xf8\xd2\x01\x6c\x67\xed\x31\x2a\x19\xa0\x07\xe4\x0b\xaa\x4b\x58\
\x94\x00\x44\xb5\x4b\xb1\x86\x41\xef\x22\xec\x08\x32\xed\x4e\xc6\
\xde\x5c\x0a\xc0\x93\xf9\xf9\xd0\x8f\xdd\x9b\x19\x94\x38\xf0\x5e\
\x95\xd4\x4a\x62\x70\xb3\x56\xec\x90\x53\xe8\x0b\xf9\x3a\x8b\x30\
\x0a\x64\x97\xcb\xb1\x14\x69\xf1\xeb\xdd\x64\x4d\xd9\x8e\x37\x67\
\xe7\xbc\x93\x87\xce\x5a\xb2\xee\x9c\x9c\x37\x65\xe7\xbc\x13\x3b\
\xe7\x65\xce\x8b\x3d\xb3\x02\xd5\xb2\xbf\x16\x24\xe9\xc6\x63\x73\
\xf5\x02\x54\x72\xbd\x69\x94\x57\x08\x13\xcb\x93\x83\x79\x63\x80\
\x48\xba\xd8\x7a\xed\xea\xc1\x57\x41\xbf\xb9\xf1\x7b\x8f\x4c\xcc\
\x4f\xf5\xc0\x29\x2c\x8a\x6a\xcf\xcf\xf2\x95\x48\xd0\xc5\xb4\x82\
\x92\x3b\xc3\x87\x13\xc0\x2d\x5f\x65\xa6\x11\x73\x00\xcb\x97\x67\
\x40\x6f\x47\xf8\x60\x2c\x30\x26\x68\xa1\xf2\xd4\xd8\x0c\xba\x70\
\xf5\xc8\x4d\x0c\x6c\xa8\xb2\x25\x60\x0e\x00\x1a\x15\xf4\x63\xa3\
\xe6\xa7\x12\xf8\x80\xd0\xdf\x00\x00\xd7\x15\x29\x5d\x14\x40\x61\
\x97\xbf\x0d\xcb\x08\x00\xc4\xac\x53\xd6\x34\x10\x11\x20\xb0\x17\
\x9c\x05\xb0\x87\x4f\xf7\x45\x01\x14\xed\x02\xf6\xcc\x01\x94\x4f\
\x0a\xc3\x17\x05\x00\x46\x80\x82\x31\x80\x88\xe4\x45\xb8\x33\xe4\
\x14\xfa\x1a\x75\xb6\x9d\xd5\x28\x70\x1b\xd1\x77\xc6\x00\xfb\xe5\
\xf6\x3c\xc2\x4e\xc8\xd7\xd9\x86\xdc\x55\x05\xb5\x32\xc0\xf6\x51\
\x5b\xcb\x82\x31\x40\x31\x1d\x39\x56\x65\x0a\x61\xd4\xce\x79\x53\
\xa6\xfe\x76\xce\x4b\x01\x23\xa2\x7e\x72\xfd\x69\xff\x6f\x63\x00\
\x80\x95\xf8\xe0\x5b\x20\x0b\xcc\xd6\x0d\xa1\x2a\xf6\xdc\xda\x0c\
\x22\x2f\x44\xc8\xb8\x89\xfb\x81\xe5\x87\x7a\xe6\x81\xb4\x5a\x76\
\xb8\xf0\x12\x61\x1a\x58\x14\xb5\x52\x6e\x62\x60\xa3\x56\xa8\xed\
\xac\x46\xab\x65\x1f\x11\x21\xe3\xfe\x8a\x3d\x3f\xef\x3b\x36\x18\
\x48\xbc\x71\x94\x2c\xd0\xab\xca\x96\x08\x4b\x08\xdf\x01\x50\x6e\
\x50\x79\x31\x11\x60\x5b\xd4\x4f\x9e\xb7\x73\x63\x00\xa8\xfc\x90\
\x1d\xe1\x83\x31\xaa\x23\x99\x20\xdd\x15\x7f\x2d\x89\xca\x3a\x96\
\xe6\x8f\xda\x5a\x16\xce\x3a\xf3\xa6\x9a\x6a\xea\x5f\xfd\x01\xd3\
\x1c\xd9\x7f\x5e\xb9\x33\xcd\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x00\xbb\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3f\x00\x00\x00\x07\x08\x06\x00\x00\x00\xbf\x76\x95\x1f\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x08\x17\
\x09\x35\x2b\x55\xca\x52\x6a\x00\x00\x00\x3b\x49\x44\x41\x54\x38\
\xcb\x63\x60\x18\x05\x23\x13\x30\x12\xa3\xa8\xbe\x7d\x2a\x25\x76\
\xfc\xa7\x97\x3b\xd1\xc1\xaa\xa5\x73\x18\xae\x5f\x39\x8f\x53\x9e\
\x69\x34\xe6\x09\x00\x4d\x1d\xc3\x21\x19\xf3\x0c\x0c\x0c\x78\x63\
\x7e\x14\x8c\x54\x00\x00\x69\x64\x0b\x05\xfd\x6b\x58\xca\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x02\x56\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\
\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xdf\x04\x19\x10\x15\x00\xdc\xbe\xff\xeb\x00\x00\x00\x1d\x69\x54\
\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x00\x00\x00\x00\x43\x72\
\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x64\
\x2e\x65\x07\x00\x00\x01\xba\x49\x44\x41\x54\x78\xda\xed\x9b\x5b\
\x92\x02\x21\x0c\x45\x4d\xd6\x37\x2e\x48\x17\xa0\x0b\xd2\xfd\xe9\
\x9f\x65\x39\xda\x3c\x92\x7b\x13\x68\xf2\x3d\x95\xe6\x1c\x1e\x43\
\x10\x0e\x87\x15\x2b\x56\xec\x39\x84\xf9\xb1\xdb\xe9\xf4\xa8\xf9\
\xbb\xe3\xf5\x2a\x53\x08\xa8\x05\x8e\x14\x22\x59\xa1\x59\x32\x64\
\x14\x70\x94\x08\x19\x11\xde\x53\x82\x8c\x08\xee\x29\x42\x46\x87\
\xb7\x4a\x90\xd1\xc1\xad\x22\x64\x26\xf8\x1e\x09\x32\x1b\x7c\xab\
\x04\x5d\x5b\xe1\x09\x7b\xbf\x65\x14\x88\x15\xfe\xef\x72\x79\xe5\
\xb8\x9f\xcf\x14\x51\xef\xdf\x2c\x7d\xb7\x24\x41\xbd\x1b\xf6\xd9\
\x38\x34\xbc\x35\x14\x31\xf4\x51\x12\x7a\xf2\x96\x18\x14\x35\xef\
\xbd\x25\x58\xf2\x6d\xb1\x98\xa7\xc0\xd6\xfc\xf3\x92\xb0\x95\xc7\
\xba\xee\x88\x57\xef\xa3\x1a\xe9\x99\xf7\xdb\x82\xe8\xb6\x08\x22\
\x46\x02\xb2\xe7\x21\xff\x05\x3c\x25\x30\xe0\xbf\x4e\x01\x8f\x4d\
\x8f\xb5\xf1\x48\xf8\xcf\x69\x00\xd9\x0a\x5b\x46\x02\xab\xe7\xe1\
\xb5\x40\x8f\x04\x36\x3c\xbc\x18\x6a\x91\x10\x01\xff\x6f\x0d\x40\
\x15\x3d\x25\x38\x36\xfc\xfb\x3a\x40\x29\x87\x7b\xd7\x04\x46\x71\
\x45\x3b\x0f\x68\x85\x61\x55\x96\xd4\x03\x91\x5a\x28\x16\x3c\x5d\
\x40\x0d\x1c\x13\x3e\x44\x80\x65\x1f\x30\xbc\x80\x5a\x38\xa6\x04\
\xcd\x06\xcf\x96\xa0\xd1\xf0\x8c\xf3\x84\x50\x01\x35\xf0\x91\x12\
\x20\xd5\x60\x6f\xcf\x33\x36\x45\x94\x6a\xb0\x17\x26\x62\x24\x68\
\xa6\x39\x1f\x21\x41\x33\xc1\x47\x48\x70\x3b\x14\x45\xcc\x61\xef\
\x7c\xd0\x43\x51\xc4\x02\xc6\x18\x09\x9a\x15\x9e\x25\xe1\x67\x82\
\xda\x69\xc0\xaa\xe7\xad\xdf\xf9\xf5\x23\x69\xc8\x99\x60\x86\x7c\
\x45\x01\x96\x9b\x57\xa8\xc6\xf6\xe6\xdd\x62\xd1\xec\x3d\x8f\xce\
\x6f\xbe\x20\x91\x3d\x4a\x23\x79\x5d\x91\xa9\x4d\xb6\x6e\x89\x4d\
\x1a\xeb\xa2\x64\x6b\xf2\x5d\x5f\x95\xcd\x2c\x82\x76\x59\x3a\xa3\
\x84\x90\xeb\xf2\x59\x24\x58\x1f\x4d\xac\x27\x33\xde\x0d\xdb\xed\
\xa3\x29\xa4\x8c\xa1\x9e\xcd\x79\x08\x61\x3e\x9c\x5c\xb1\xf7\x78\
\x02\x47\xb0\x5b\x07\x3a\x44\x3e\x01\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
"
qt_resource_name = b"\
\x00\x09\
\x09\x5f\x97\x13\
\x00\x71\
\x00\x73\x00\x73\x00\x5f\x00\x69\x00\x63\x00\x6f\x00\x6e\x00\x73\
\x00\x11\
\x0b\x14\x5d\x13\
\x00\x50\
\x00\x79\x00\x51\x00\x74\x00\x35\x00\x5f\x00\x73\x00\x74\x00\x79\x00\x6c\x00\x65\x00\x73\x00\x68\x00\x65\x00\x65\x00\x74\x00\x73\
\
\x00\x0e\
\x00\x8b\x21\x43\
\x00\x73\
\x00\x74\x00\x79\x00\x6c\x00\x65\x00\x5f\x00\x44\x00\x61\x00\x72\x00\x6b\x00\x2e\x00\x71\x00\x73\x00\x73\
\x00\x07\
\x0a\x89\x16\x03\
\x00\x44\
\x00\x61\x00\x72\x00\x6b\x00\x5f\x00\x72\x00\x63\
\x00\x1a\
\x05\x11\xe0\xe7\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x5f\
\x00\x66\x00\x6f\x00\x63\x00\x75\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x19\
\x08\x3e\xcc\x07\
\x00\x73\
\x00\x74\x00\x79\x00\x6c\x00\x65\x00\x73\x00\x68\x00\x65\x00\x65\x00\x74\x00\x2d\x00\x62\x00\x72\x00\x61\x00\x6e\x00\x63\x00\x68\
\x00\x2d\x00\x65\x00\x6e\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x08\x8c\x6a\xa7\
\x00\x48\
\x00\x73\x00\x65\x00\x70\x00\x61\x00\x72\x00\x74\x00\x6f\x00\x6f\x00\x6c\x00\x62\x00\x61\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x0f\
\x0c\xe2\x68\x67\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x70\x00\x61\x00\x72\x00\x65\x00\x6e\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x14\
\x0b\xc5\xd7\xc7\
\x00\x73\
\x00\x74\x00\x79\x00\x6c\x00\x65\x00\x73\x00\x68\x00\x65\x00\x65\x00\x74\x00\x2d\x00\x76\x00\x6c\x00\x69\x00\x6e\x00\x65\x00\x2e\
\x00\x70\x00\x6e\x00\x67\
\x00\x1d\
\x09\x07\x81\x07\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x5f\
\x00\x64\x00\x69\x00\x73\x00\x61\x00\x62\x00\x6c\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x20\
\x09\xd7\x1f\xa7\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x69\x00\x6e\x00\x64\x00\x65\x00\x74\x00\x65\x00\x72\x00\x6d\
\x00\x69\x00\x6e\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x66\x00\x6f\x00\x63\x00\x75\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x1c\
\x01\xe0\x4a\x07\
\x00\x72\
\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x5f\x00\x75\x00\x6e\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x5f\x00\x64\
\x00\x69\x00\x73\x00\x61\x00\x62\x00\x6c\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x18\
\x03\x8e\xde\x67\
\x00\x72\
\x00\x69\x00\x67\x00\x68\x00\x74\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x5f\x00\x64\x00\x69\x00\x73\x00\x61\x00\x62\
\x00\x6c\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x17\
\x0c\xab\x51\x07\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x5f\x00\x64\x00\x69\x00\x73\x00\x61\x00\x62\x00\x6c\
\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x17\
\x0c\x65\xce\x07\
\x00\x6c\
\x00\x65\x00\x66\x00\x74\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x5f\x00\x64\x00\x69\x00\x73\x00\x61\x00\x62\x00\x6c\
\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x1a\
\x01\x21\xeb\x47\
\x00\x73\
\x00\x74\x00\x79\x00\x6c\x00\x65\x00\x73\x00\x68\x00\x65\x00\x65\x00\x74\x00\x2d\x00\x62\x00\x72\x00\x61\x00\x6e\x00\x63\x00\x68\
\x00\x2d\x00\x6d\x00\x6f\x00\x72\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0c\
\x06\x41\x40\x87\
\x00\x73\
\x00\x69\x00\x7a\x00\x65\x00\x67\x00\x72\x00\x69\x00\x70\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x01\x07\x4a\xa7\
\x00\x56\
\x00\x6d\x00\x6f\x00\x76\x00\x65\x00\x74\x00\x6f\x00\x6f\x00\x6c\x00\x62\x00\x61\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x15\
\x0f\xf3\xc0\x07\
\x00\x75\
\x00\x70\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x5f\x00\x64\x00\x69\x00\x73\x00\x61\x00\x62\x00\x6c\x00\x65\x00\x64\
\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x09\
\x06\x98\x83\x27\
\x00\x63\
\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x1a\
\x0e\xbc\xc3\x67\
\x00\x72\
\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x5f\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x5f\x00\x64\x00\x69\x00\x73\
\x00\x61\x00\x62\x00\x6c\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0e\
\x0e\xde\xfa\xc7\
\x00\x6c\
\x00\x65\x00\x66\x00\x74\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x12\
\x07\x8f\x9d\x27\
\x00\x62\
\x00\x72\x00\x61\x00\x6e\x00\x63\x00\x68\x00\x5f\x00\x6f\x00\x70\x00\x65\x00\x6e\x00\x2d\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\
\x00\x67\
\x00\x0f\
\x02\x9f\x05\x87\
\x00\x72\
\x00\x69\x00\x67\x00\x68\x00\x74\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0a\
\x05\x95\xde\x27\
\x00\x75\
\x00\x6e\x00\x64\x00\x6f\x00\x63\x00\x6b\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x0a\xe5\x6c\x07\
\x00\x72\
\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x5f\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x1c\
\x08\x3f\xda\x67\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x75\x00\x6e\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\
\x00\x64\x00\x5f\x00\x66\x00\x6f\x00\x63\x00\x75\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0c\
\x06\xe6\xe6\x67\
\x00\x75\
\x00\x70\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x13\
\x08\xc8\x96\xe7\
\x00\x72\
\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x5f\x00\x75\x00\x6e\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x2e\x00\x70\
\x00\x6e\x00\x67\
\x00\x0e\
\x04\xa2\xfc\xa7\
\x00\x64\
\x00\x6f\x00\x77\x00\x6e\x00\x5f\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x17\
\x0f\x1e\x9b\x47\
\x00\x72\
\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x5f\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x5f\x00\x66\x00\x6f\x00\x63\
\x00\x75\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x14\
\x07\xec\xd1\xc7\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x2e\
\x00\x70\x00\x6e\x00\x67\
\x00\x1a\
\x01\x87\xae\x67\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x69\x00\x6e\x00\x64\x00\x65\x00\x74\x00\x65\x00\x72\x00\x6d\
\x00\x69\x00\x6e\x00\x61\x00\x74\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x08\x90\x94\x67\
\x00\x63\
\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x2d\x00\x70\x00\x72\x00\x65\x00\x73\x00\x73\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x14\
\x06\x5e\x2c\x07\
\x00\x62\
\x00\x72\x00\x61\x00\x6e\x00\x63\x00\x68\x00\x5f\x00\x63\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x64\x00\x2d\x00\x6f\x00\x6e\x00\x2e\
\x00\x70\x00\x6e\x00\x67\
\x00\x0f\
\x06\x53\x25\xa7\
\x00\x62\
\x00\x72\x00\x61\x00\x6e\x00\x63\x00\x68\x00\x5f\x00\x6f\x00\x70\x00\x65\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x01\x00\xca\xa7\
\x00\x48\
\x00\x6d\x00\x6f\x00\x76\x00\x65\x00\x74\x00\x6f\x00\x6f\x00\x6c\x00\x62\x00\x61\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x0b\xda\x30\xa7\
\x00\x62\
\x00\x72\x00\x61\x00\x6e\x00\x63\x00\x68\x00\x5f\x00\x63\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x1f\
\x0a\xae\x27\x47\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x75\x00\x6e\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\
\x00\x64\x00\x5f\x00\x64\x00\x69\x00\x73\x00\x61\x00\x62\x00\x6c\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x16\
\x01\x75\xcc\x87\
\x00\x63\
\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x62\x00\x6f\x00\x78\x00\x5f\x00\x75\x00\x6e\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\
\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x19\
\x0b\x59\x6e\x87\
\x00\x72\
\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x5f\x00\x75\x00\x6e\x00\x63\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x65\x00\x64\x00\x5f\x00\x66\
\x00\x6f\x00\x63\x00\x75\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x08\xc4\x6a\xa7\
\x00\x56\
\x00\x73\x00\x65\x00\x70\x00\x61\x00\x72\x00\x74\x00\x6f\x00\x6f\x00\x6c\x00\x62\x00\x61\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x0f\
\x01\xf4\x81\x47\
\x00\x63\
\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x2d\x00\x68\x00\x6f\x00\x76\x00\x65\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\x18\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x40\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x62\x00\x02\x00\x00\x00\x27\x00\x00\x00\x05\
\x00\x00\x06\x36\x00\x00\x00\x00\x00\x01\x00\x00\x42\x05\
\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x21\x4b\
\x00\x00\x02\xc4\x00\x00\x00\x00\x00\x01\x00\x00\x20\x0c\
\x00\x00\x06\xc8\x00\x00\x00\x00\x00\x01\x00\x00\x45\x5d\
\x00\x00\x05\x82\x00\x00\x00\x00\x00\x01\x00\x00\x3c\x79\
\x00\x00\x01\xe8\x00\x00\x00\x00\x00\x01\x00\x00\x1b\x18\
\x00\x00\x07\x5a\x00\x00\x00\x00\x00\x01\x00\x00\x4a\xc8\
\x00\x00\x04\x10\x00\x00\x00\x00\x00\x01\x00\x00\x2a\x38\
\x00\x00\x02\x26\x00\x00\x00\x00\x00\x01\x00\x00\x1e\x14\
\x00\x00\x04\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x36\x37\
\x00\x00\x00\x76\x00\x00\x00\x00\x00\x01\x00\x00\x11\xd1\
\x00\x00\x04\x34\x00\x00\x00\x00\x00\x01\x00\x00\x2a\xdc\
\x00\x00\x02\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x20\xc6\
\x00\x00\x06\x12\x00\x00\x00\x00\x00\x01\x00\x00\x41\x5b\
\x00\x00\x05\xe4\x00\x00\x00\x00\x00\x01\x00\x00\x40\xc4\
\x00\x00\x03\x72\x00\x00\x00\x00\x00\x01\x00\x00\x22\xd6\
\x00\x00\x04\xb4\x00\x00\x00\x00\x00\x01\x00\x00\x32\xb9\
\x00\x00\x03\xe6\x00\x00\x00\x00\x00\x01\x00\x00\x29\x9e\
\x00\x00\x05\x54\x00\x00\x00\x00\x00\x01\x00\x00\x3a\x89\
\x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x13\xd5\
\x00\x00\x04\x76\x00\x00\x00\x00\x00\x01\x00\x00\x30\xd2\
\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x01\x00\x00\x14\xb9\
\x00\x00\x05\xbc\x00\x00\x00\x00\x00\x01\x00\x00\x3e\x6a\
\x00\x00\x07\x32\x00\x00\x00\x00\x00\x01\x00\x00\x4a\x09\
\x00\x00\x04\xd2\x00\x00\x00\x00\x00\x01\x00\x00\x33\x5b\
\x00\x00\x01\x62\x00\x00\x00\x00\x00\x01\x00\x00\x17\x23\
\x00\x00\x01\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x19\x12\
\x00\x00\x06\x84\x00\x00\x00\x00\x00\x01\x00\x00\x43\x89\
\x00\x00\x04\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x2d\x22\
\x00\x00\x06\xfa\x00\x00\x00\x00\x00\x01\x00\x00\x47\x31\
\x00\x00\x01\x34\x00\x00\x00\x00\x00\x01\x00\x00\x16\x30\
\x00\x00\x06\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x42\xe5\
\x00\x00\x02\x90\x00\x00\x00\x00\x00\x01\x00\x00\x1f\x62\
\x00\x00\x02\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x1e\xb8\
\x00\x00\x01\x10\x00\x00\x00\x00\x00\x01\x00\x00\x15\x69\
\x00\x00\x03\x8a\x00\x00\x00\x00\x00\x01\x00\x00\x25\x24\
\x00\x00\x03\xc4\x00\x00\x00\x00\x00\x01\x00\x00\x28\xf4\
\x00\x00\x05\x20\x00\x00\x00\x00\x00\x01\x00\x00\x36\xe0\
\x00\x00\x03\x42\x00\x00\x00\x00\x00\x01\x00\x00\x22\x33\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x18\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x40\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x71\x72\xc5\x03\x54\
\x00\x00\x00\x62\x00\x02\x00\x00\x00\x27\x00\x00\x00\x05\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x06\x36\x00\x00\x00\x00\x00\x01\x00\x00\x42\x05\
\x00\x00\x01\x71\x72\xc5\x01\x88\
\x00\x00\x03\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x21\x4b\
\x00\x00\x01\x71\x72\xc5\x01\x9c\
\x00\x00\x02\xc4\x00\x00\x00\x00\x00\x01\x00\x00\x20\x0c\
\x00\x00\x01\x71\x72\xc5\x02\x3c\
\x00\x00\x06\xc8\x00\x00\x00\x00\x00\x01\x00\x00\x45\x5d\
\x00\x00\x01\x71\x72\xc5\x01\xba\
\x00\x00\x05\x82\x00\x00\x00\x00\x00\x01\x00\x00\x3c\x79\
\x00\x00\x01\x71\x72\xc5\x01\xb1\
\x00\x00\x01\xe8\x00\x00\x00\x00\x00\x01\x00\x00\x1b\x18\
\x00\x00\x01\x71\x72\xc5\x02\x1e\
\x00\x00\x07\x5a\x00\x00\x00\x00\x00\x01\x00\x00\x4a\xc8\
\x00\x00\x01\x71\x72\xc5\x01\xc4\
\x00\x00\x04\x10\x00\x00\x00\x00\x00\x01\x00\x00\x2a\x38\
\x00\x00\x01\x71\x72\xc5\x02\x32\
\x00\x00\x02\x26\x00\x00\x00\x00\x00\x01\x00\x00\x1e\x14\
\x00\x00\x01\x71\x72\xc5\x02\x32\
\x00\x00\x04\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x36\x37\
\x00\x00\x01\x71\x72\xc5\x01\xc4\
\x00\x00\x00\x76\x00\x00\x00\x00\x00\x01\x00\x00\x11\xd1\
\x00\x00\x01\x71\x72\xc5\x01\xb1\
\x00\x00\x04\x34\x00\x00\x00\x00\x00\x01\x00\x00\x2a\xdc\
\x00\x00\x01\x71\x72\xc5\x02\x3c\
\x00\x00\x02\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x20\xc6\
\x00\x00\x01\x71\x72\xc5\x02\x32\
\x00\x00\x06\x12\x00\x00\x00\x00\x00\x01\x00\x00\x41\x5b\
\x00\x00\x01\x71\x72\xc5\x01\xa7\
\x00\x00\x05\xe4\x00\x00\x00\x00\x00\x01\x00\x00\x40\xc4\
\x00\x00\x01\x71\x72\xc5\x01\x9c\
\x00\x00\x03\x72\x00\x00\x00\x00\x00\x01\x00\x00\x22\xd6\
\x00\x00\x01\x71\x72\xc5\x01\xc4\
\x00\x00\x04\xb4\x00\x00\x00\x00\x00\x01\x00\x00\x32\xb9\
\x00\x00\x01\x71\x72\xc5\x02\x3c\
\x00\x00\x03\xe6\x00\x00\x00\x00\x00\x01\x00\x00\x29\x9e\
\x00\x00\x01\x71\x72\xc5\x01\xa7\
\x00\x00\x05\x54\x00\x00\x00\x00\x00\x01\x00\x00\x3a\x89\
\x00\x00\x01\x71\x72\xc5\x01\xa7\
\x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x13\xd5\
\x00\x00\x01\x71\x72\xc5\x02\x32\
\x00\x00\x04\x76\x00\x00\x00\x00\x00\x01\x00\x00\x30\xd2\
\x00\x00\x01\x71\x72\xc5\x01\xc4\
\x00\x00\x00\xe8\x00\x00\x00\x00\x00\x01\x00\x00\x14\xb9\
\x00\x00\x01\x71\x72\xc5\x01\x92\
\x00\x00\x05\xbc\x00\x00\x00\x00\x00\x01\x00\x00\x3e\x6a\
\x00\x00\x01\x71\x72\xc5\x01\xc4\
\x00\x00\x07\x32\x00\x00\x00\x00\x00\x01\x00\x00\x4a\x09\
\x00\x00\x01\x71\x72\xc5\x01\x9c\
\x00\x00\x04\xd2\x00\x00\x00\x00\x00\x01\x00\x00\x33\x5b\
\x00\x00\x01\x71\x72\xc5\x02\x14\
\x00\x00\x01\x62\x00\x00\x00\x00\x00\x01\x00\x00\x17\x23\
\x00\x00\x01\x71\x72\xc5\x01\xb1\
\x00\x00\x01\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x19\x12\
\x00\x00\x01\x71\x72\xc5\x01\xb1\
\x00\x00\x06\x84\x00\x00\x00\x00\x00\x01\x00\x00\x43\x89\
\x00\x00\x01\x71\x72\xc5\x01\xba\
\x00\x00\x04\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x2d\x22\
\x00\x00\x01\x71\x72\xc5\x01\xe2\
\x00\x00\x06\xfa\x00\x00\x00\x00\x00\x01\x00\x00\x47\x31\
\x00\x00\x01\x71\x72\xc5\x02\x1e\
\x00\x00\x01\x34\x00\x00\x00\x00\x00\x01\x00\x00\x16\x30\
\x00\x00\x01\x71\x72\xc5\x02\x3c\
\x00\x00\x06\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x42\xe5\
\x00\x00\x01\x71\x72\xc5\x01\xa7\
\x00\x00\x02\x90\x00\x00\x00\x00\x00\x01\x00\x00\x1f\x62\
\x00\x00\x01\x71\x72\xc5\x01\xce\
\x00\x00\x02\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x1e\xb8\
\x00\x00\x01\x71\x72\xc5\x01\xc4\
\x00\x00\x01\x10\x00\x00\x00\x00\x00\x01\x00\x00\x15\x69\
\x00\x00\x01\x71\x72\xc5\x02\x3c\
\x00\x00\x03\x8a\x00\x00\x00\x00\x00\x01\x00\x00\x25\x24\
\x00\x00\x01\x71\x72\xc5\x01\xec\
\x00\x00\x03\xc4\x00\x00\x00\x00\x00\x01\x00\x00\x28\xf4\
\x00\x00\x01\x71\x72\xc5\x01\xce\
\x00\x00\x05\x20\x00\x00\x00\x00\x00\x01\x00\x00\x36\xe0\
\x00\x00\x01\x71\x72\xc5\x02\x0a\
\x00\x00\x03\x42\x00\x00\x00\x00\x00\x01\x00\x00\x22\x33\
\x00\x00\x01\x71\x72\xc5\x02\x3c\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
|
dongmengshi/easylearn | eslearn/machine_learning/classfication/el_classify_sensitive_person_train_validation.py | # -*- coding: utf-8 -*-
"""
Created on 2020/03/16
------
@author: <NAME>
"""
import os
import numpy as np
import pandas as pd
import xlwt
from sklearn import svm
from sklearn.linear_model import LogisticRegression as lr
from sklearn.linear_model import LassoCV, Lasso
from sklearn.externals import joblib
from sklearn.linear_model import lasso_path, enet_path
from sklearn.feature_selection import RFECV
from sklearn.svm import SVC
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.preprocessing import OneHotEncoder
from sklearn import preprocessing
from eslearn.utils.lc_evaluation_model_performances import eval_performance
from eslearn.utils.el_preprocessing import Preprocessing
from eslearn.utils.lc_niiProcessor import NiiProcessor
import eslearn.utils.el_preprocessing as elprep
class ClassifyFourKindOfPersonTrain():
"""
This class is used to training and validating classification model for 2 kind of sensitive person identification.
Parameters
----------
data_train_file: path str
Path of the training dataset
data_validation_file: path str
Path of the test dataset
label_train_file: path str
Path of the training label
label_validation_file: path str
Path of the test label
path_out :
Path to save results
is_feature_selection : bool
if perfrome feature selection.
is_showfig_finally: bool
If show figure after all iteration finished.
Returns
-------
Save all classification results and figures to local disk.
"""
def __init__(selftest,
data_train_file=None,
data_validation_file=None,
label_train_file=None,
label_validation_file=None,
path_out=None,
is_feature_selection=False,
n_features_to_select=None,
is_showfig_finally=True,
rand_seed=666):
selftest.data_train_file = data_train_file
selftest.data_validation_file = data_validation_file
selftest.label_train_file = label_train_file
selftest.label_validation_file = label_validation_file
selftest.path_out = path_out
selftest.n_features_to_select = n_features_to_select
selftest.is_feature_selection = is_feature_selection
selftest.is_showfig_finally = is_showfig_finally
selftest.rand_seed = rand_seed
def main_function(selftest):
"""
"""
print('Training model and testing...\n')
# load data
feature_train, feature_validation, label_train, label_validation, colname = selftest._load_data()
n_features_orig = feature_train.shape[1]
# Check data
# Age encoding
feature_train[:, 2] = selftest.age_encodeing(feature_train[:,2], feature_train[:,2])
feature_validation[:, 2] = selftest.age_encodeing(feature_train[:,2], feature_validation[:,2])
# Data normalization: do not need, because all variables are discrete variables.
# Feature selection: LassoCV
if selftest.is_feature_selection:
coef, mask_lassocv = selftest.feature_selection_lasso(feature_train, label_train)
feature_train, feature_validation = feature_train[:, mask_lassocv], feature_validation[:, mask_lassocv]
var_important = pd.DataFrame(np.array(colname)[mask_lassocv])
var_important_coef = pd.concat([var_important, pd.DataFrame(coef[coef != 0])], axis=1)
var_important_coef.columns=['变量', '系数(lasso); 正系数为危险因素,负系数为保护因素']
var_important_coef.to_csv(os.path.join(selftest.path_out, 'important_variables.txt'), index=False)
# Onehot encoding
# onehot = OneHotEncoder()
# onehot.fit(feature_train)
# feature_train = onehot.transform(feature_train).toarray()
# feature_validation= onehot.transform(feature_validation).toarray()
# Train
print('training and testing...\n')
if selftest.is_feature_selection:
model = selftest.training(feature_train, label_train)
else:
model, w = selftest.rfeCV(feature_train, label_train)
# Save model
with open(os.path.join(selftest.path_out, 'model_classification.pkl'), 'wb') as f_model:
joblib.dump(model, f_model)
# Validating
prediction_train, decision_train = selftest.testing(model, feature_train)
prediction_validation, decision_validation = selftest.testing(model, feature_validation)
# Evaluating classification performances
accuracy_train, sensitivity_train, specificity_train, AUC_train = eval_performance(label_train, prediction_train, decision_train,
accuracy_kfold=None, sensitivity_kfold=None, specificity_kfold=None, AUC_kfold=None,
verbose=1, is_showfig=0)
accuracy_validation, sensitivity_validation, specificity_validation, AUC_validation = eval_performance(label_validation,prediction_validation, decision_validation,
accuracy_kfold=None, sensitivity_kfold=None, specificity_kfold=None, AUC_kfold=None,
verbose=1, is_showfig=0)
# Save results and fig to local path
selftest.save_results(accuracy_train, sensitivity_train, specificity_train, AUC_train,
decision_train, prediction_train, label_train, 'train')
selftest.save_results(accuracy_validation, sensitivity_validation, specificity_validation, AUC_validation,
decision_validation, prediction_validation, label_validation, 'validation')
selftest.save_fig(label_train, prediction_train, decision_train, accuracy_train,
sensitivity_train, specificity_train, AUC_train,
'classification_performances_train.pdf')
selftest.save_fig(label_validation, prediction_validation, decision_validation, accuracy_validation,
sensitivity_validation, specificity_validation, AUC_validation,
'classification_performances_validation.pdf')
print(f"MSE = {np.mean(np.power((decision_validation - label_validation), 2))}")
print("--" * 10 + "Done!" + "--" * 10 )
return selftest
def _load_data(selftest):
"""
Load data
"""
data_all_file = r'D:\workstation_b\Fundation\给黎超.xlsx'
data_all = pd.read_excel(data_all_file)
colname = np.array(data_all.columns)[np.arange(2,18)]
data_train = np.load(selftest.data_train_file)
data_validation = np.load(selftest.data_validation_file)
label_train = np.load(selftest.label_train_file)
label_validation = np.load(selftest.label_validation_file)
return data_train, data_validation, label_train, label_validation, colname
def feature_selection_lasso(selftest, feature, label):
lc = LassoCV(cv=10, alphas=np.linspace(pow(10, -2), pow(10, 1), 1000))
lc.fit(feature, label)
with open(os.path.join(selftest.path_out, 'mask_selected_features_lassocv.pkl'), 'wb') as f_mask:
joblib.dump(lc.coef_, f_mask)
return lc.coef_, lc.coef_ != 0
def feature_selection_relief(selftest, feature_train, label_train, feature_validation, n_features_to_select=None):
"""
This functio is used to select the features using relief-based feature selection algorithms
"""
from skrebate import ReliefF
[n_sub, n_features] = np.shape(feature_train)
if n_features_to_select is None:
n_features_to_select = np.int(np.round(n_features / 10))
if isinstance(n_features_to_select, np.float):
n_features_to_select = np.int(np.round(n_features * n_features_to_select))
fs = ReliefF(n_features_to_select=n_features_to_select,
n_neighbors=100, discrete_threshold=10, verbose=True, n_jobs=-1)
fs.fit(feature_train, label_train)
feature_train = fs.transform(feature_train)
feature_validation = fs.transform(feature_validation)
mask = fs.top_features_[:n_features_to_select]
return feature_train, feature_validation, mask, n_features, fs
def age_encodeing(selftest, age_train, age_target):
"""
Encoding age_target to separate variable
"""
sep = pd.DataFrame(age_train).describe()
age_target[age_target < sep.loc['25%'].values] = 0
age_target[(age_target >= sep.loc['25%'].values) & (age_target < sep.loc['50%'].values)] = 1
age_target[(age_target >= sep.loc['50%'].values) & (age_target < sep.loc['75%'].values)] = 2
age_target[age_target >= sep.loc['75%'].values] = 3
return age_target
def rfeCV(selftest, train_x, train_y, step=1, cv=10, n_jobs=-1, permutation=0):
"""
Nested rfe
"""
n_samples, n_features = train_x.shape
estimator = SVC(kernel="linear")
model = RFECV(estimator, step=step, cv=cv, n_jobs=n_jobs)
model = model.fit(train_x, train_y)
mask = model.support_
optmized_model = model.estimator_
w = optmized_model.coef_ # 当为多分类时,w是2维向量
weight = np.zeros([w.shape[0], n_features])
weight[:, mask] = w
return model, weight
def training(selftest, train_X, train_y):
# Classfier is SVC
svc = lr(class_weight='balanced')
# svc = svm.SVC(kernel='linear', C=1, class_weight='balanced', random_state=0)
# svc = svm.SVC(kernel='rbf', class_weight='balanced', random_state=0)
svc.fit(train_X, train_y)
return svc
def testing(selftest, model, test_X):
predict = model.predict(test_X)
decision = model.decision_function(test_X)
return predict, decision
def save_results(selftest, accuracy, sensitivity, specificity, AUC,
decision, prediction, label_validation, preffix):
# Save performances and others
performances_to_save = np.array([accuracy, sensitivity, specificity, AUC]).reshape(1,4)
de_pred_label_to_save = np.vstack([decision.T, prediction.T, label_validation.T]).T
performances_to_save = pd.DataFrame(performances_to_save, columns=[['Accuracy','Sensitivity', 'Specificity', 'AUC']])
de_pred_label_to_save = pd.DataFrame(de_pred_label_to_save, columns=[['Decision','Prediction', 'Sorted_Real_Label']])
performances_to_save.to_csv(os.path.join(path_out, preffix + '_Performances.txt'), index=False, header=True)
de_pred_label_to_save.to_csv(os.path.join(path_out, preffix + '_Decision_prediction_label.txt'), index=False, header=True)
def save_fig(selftest, label_validation, prediction, decision, accuracy, sensitivity, specificity, AUC, outname):
# Save ROC and Classification 2D figure
acc, sens, spec, auc = eval_performance(label_validation, prediction, decision,
accuracy, sensitivity, specificity, AUC,
verbose=0, is_showfig=1, is_savefig=1,
out_name=os.path.join(path_out, outname),
legend1='Healthy', legend2='Unhealthy')
#
if __name__ == '__main__':
# =============================================================================
# All inputs
data_file = r'D:\workstation_b\Fundation\给黎超.xlsx'
path_out = r'D:\workstation_b\Fundation'
# =============================================================================
selftest = ClassifyFourKindOfPersonTrain(data_train_file=r'D:\workstation_b\Fundation\feature_train.npy',
data_validation_file=r'D:\workstation_b\Fundation\feature_validation.npy',
label_train_file=r'D:\workstation_b\Fundation\label_train.npy',
label_validation_file=r'D:\workstation_b\Fundation\label_validation.npy',
path_out=path_out,
is_feature_selection=1)
selftest.main_function()
|
dongmengshi/easylearn | eslearn/SSD_classification/Data_Inspection/lc_preprocess_for_UCLA.py | <gh_stars>1-10
"""
This script is used to transform the UCLA dataset into .npy format.
1.Transform the .mat files to one .npy file
2. Give labels to each subject, concatenate at the first column
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python')
import numpy as np
import pandas as pd
import os
from eslearn.utils.lc_read_write_Mat import read_mat
# Inputs
matroot = r'D:\WorkStation_2018\SZ_classification\Data\SelectedFC_UCLA'
scale = r'H:\Data\精神分裂症\ds000030\schizophrenia_UCLA_restfmri\participants.tsv'
n_node = 246 # number of nodes in the mat network
# Transform the .mat files to one .npy file
allmatname = os.listdir(matroot)
allmatpath = [os.path.join(matroot, matpath) for matpath in allmatname]
mask = np.triu(np.ones(n_node),1)==1
allmat = [read_mat(matpath)[mask].T for matpath in allmatpath]
allmat = np.array(allmat,dtype=np.float32)
# Give labels to each subject, concatenate at the first column
allmatname = pd.DataFrame(allmatname)
allsubjname = allmatname.iloc[:,0].str.findall(r'[1-9]\d*')
allsubjname = pd.DataFrame(['sub-' + name[0] for name in allsubjname])
scale_data = pd.read_csv(scale,sep='\t')
diagnosis = pd.merge(allsubjname,scale_data,left_on=0,right_on='participant_id')[['participant_id','diagnosis']]
diagnosis['diagnosis'][diagnosis['diagnosis'] == 'CONTROL']=0
diagnosis['diagnosis'][diagnosis['diagnosis'] == 'SCHZ']=1
diagnosis['participant_id'] = diagnosis['participant_id'].str.replace('sub-', '')
label = np.array(np.int32(diagnosis))
allmat_plus_label = np.concatenate([label, allmat], axis=1)
print(allmat_plus_label.shape)
# np.save(r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Data\UCLA.npy',allmat_plus_label)
#
# d1=np.load(r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Data\ML_data_npy\UCLA.npy')
# d2=np.load(r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Data\ML_data_npy\UCLA_rest.npy')
# d = np.concatenate([d1,d2],axis=0)
# np.save(r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Data\UCLA_all.npy',d)
# print(d.shape)
#%% Extract covariances: age and sex
cov = pd.merge(allsubjname,scale_data,left_on=0,right_on='participant_id')[['participant_id','diagnosis', 'age', 'gender']]
cov[['participant_id', 'diagnosis']] = diagnosis[['participant_id', 'diagnosis']]
cov['gender'] = cov['gender'] == 'M'
cov = pd.DataFrame(np.int64(cov))
cov.columns = ['folder', 'diagnosis', 'age', 'sex']
cov.to_csv(r'D:\WorkStation_2018\SZ_classification\Scale\cov_UCLA.txt', index=False)
|
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_svc_oneVsOne.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 25 14:45:04 2018
one vs one multi-class classfication
@author: lenovo
"""
from sklearn.svm import SVC
from sklearn import datasets
#
X,y=datasets.make_classification(n_samples=1000, n_features=200, n_informative=2, n_redundant=2,
n_repeated=0, n_classes=3, n_clusters_per_class=1, weights=None,
flip_y=0.01, class_sep=1.0, hypercube=True,shift=0.0, scale=1.0,
shuffle=True, random_state=None)
#
def oneVsOne(X,y):
clf = SVC(decision_function_shape='ovr')
clf.fit(X, y)
predict=clf.predict(X)
dec=clf.decision_function(X)
return predict,dec |
dongmengshi/easylearn | eslearn/utils/lc_resample_v1.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 5 10:45:52 2019
@author: <NAME>
"""
import SimpleITK as sitk
import numpy as np
import os
from lc_resample_base import ResampleImg
class ResampleImgV1(ResampleImg):
"""
Resample a 3D old_image to given new spacing
The new voxel spacing will determine the new old_image dimensions.
If is orginal data, use sitk.sitkLinear.
If is binary mask, usse sitk.sitkNearestNeighbor
"""
def __init__(sel,
root_roi_path,
outpath,
datatype,
is_overwrite=True):
super().__init__()
sel.root_roi_path = root_roi_path
sel.outpath = outpath
sel.datatype = datatype
sel.is_overwrite = is_overwrite
sel._new_spacing = np.array([0.684, 0.684, 0.684])
def read_roi_path(sel):
return [os.path.join(sel.root_roi_path, imgname) for imgname in os.listdir(sel.root_roi_path)]
def resample_for_allroi(sel):
allroi = sel.read_roi_path()
for i, roipath in enumerate(allroi):
sel.resample_for_oneroi(roipath, is_overwrite=sel.is_overwrite)
else:
print('All Done!\n')
def resample_for_oneroi(sel, roipath, is_overwrite=False):
# allroi = sel.read_roi_path()
# roipath = allroi[0]
roiname = os.path.basename(roipath)
allsubjfile_path = [os.path.join(roipath, roi)
for roi in os.listdir(roipath)]
n_subj = len(allsubjfile_path)
for i, file in enumerate(allsubjfile_path):
print(f'{roiname}:{i+1}/{n_subj}...')
# make save folder to save img file
if sel.datatype == 'series':
savefilename = os.path.basename(file) + '.nii'
else:
savefilename = os.path.basename(file)
saveroiname = os.path.basename(os.path.dirname(file))
savefolder = os.path.join(sel.outpath, saveroiname)
if not os.path.exists(savefolder):
os.makedirs(savefolder)
savename = os.path.join(sel.outpath, saveroiname, savefilename)
# If img file exists, then overwirte or pass
status = f'{roiname} failed!'
if os.path.exists(savename):
if is_overwrite:
print(f'\t{savename} exist Resampling and Overwriting...\n')
newimage = sel.resample(
file, datatype=sel.datatype) # resample!
sitk.WriteImage(newimage, savename)
status = f'{roiname} successfully!'
else:
print(f'\t{savename} exist Pass!\n')
continue
else:
print('\tResampling and Writting...')
newimage = sel.resample(
file, datatype=sel.datatype) # resample!
sitk.WriteImage(newimage, savename)
status = f'{roiname} successfully!\n'
print(status)
if __name__ == '__main__':
sel = ResampleImgV1(root_roi_path=r'I:\Project_Lyph\DICOM\venous_splited\DICOM',
outpath=r'I:\Project_Lyph\DICOM\venous_splited\DICOM_resampled_v1',
datatype='series',
is_overwrite=False)
sel.resample_for_allroi()
|
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_rfe_svc_given_trainingdata_testingdata.py | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 12 16:25:57 2019
@author: <NAME>
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python')
sys.path.append(r'F:\黎超\dynamicFC\Code\lc_rsfmri_tools_python-master\Machine_learning\classfication')
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python\Utils')
import numpy as np
from lc_read_nii import read_multiNii_LC
from lc_read_nii import read_sigleNii_LC
from lc_svc_rfe_cv_V2 import SVCRefCv
class SvcForGivenTrAndTe(SVCRefCv):
"""
Training model on given training data.
Then apply this mode to another testing data.
Last, evaluate the performance
If you encounter any problem, please contact <EMAIL>
"""
def __init__(self,
# =====================================================================
# all inputs are follows
patients_path=r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\mALFF\patient_mALFF', # 训练组病人
hc_path=r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\mALFF\control_mALFF', # 训练组正常人
val_path=r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\mALFF\control_mALFF', # 验证集数据
val_label=r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python\Machine_learning\classfication\val_label.txt', # 验证数据的label文件
suffix='.img', #图像文件的后缀
mask=r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\mALFF\patient_mALFF\mALFFMap_sub006.img',
k=2 # 训练集内部进行RFE时,用的kfold CV
# =====================================================================
):
super().__init__()
self.patients_path=patients_path
self.hc_path=hc_path
self.val_path=val_path
self.val_label=val_label
self.suffix=suffix
self.mask=mask
self.k=k
print("SvcForGivenTrAndTe initiated")
def _load_data_infolder(self):
"""load training data and validation data and generate label for training data"""
print("loading...")
# train data
data1,_=read_multiNii_LC(self.patients_path, self.suffix)
data1=np.squeeze(np.array([np.array(data1).reshape(1,-1) for data1 in data1]))
data2,_=read_multiNii_LC(self.hc_path, self.suffix)
data2=np.squeeze(np.array([np.array(data2).reshape(1,-1) for data2 in data2]))
data=np.vstack([data1,data2])
# validation data
data_validation,self.name_val=read_multiNii_LC(self.val_path, self.suffix)
data_validation=np.squeeze(np.array([np.array(data_validation).reshape(1,-1) for data_validation in data_validation]))
# data in mask
mask,_=read_sigleNii_LC(self.mask)
mask=mask>=0.2
mask=np.array(mask).reshape(-1,)
self.data_train=data[:,mask]
self.data_validation=data_validation[:,mask]
# label_tr
self.label_tr=np.hstack([np.ones([len(data1),])-1,np.ones([len(data2),])])
print("loaded")
return self
def tr_te_ev(self):
"""
训练,测试,评估
"""
# scale
data_train,data_validation=self.scaler(self.data_train,self.data_validation,self.scale_method)
# reduce dim
if 0<self.pca_n_component<1:
data_train,data_validation,trained_pca=self.dimReduction(data_train,data_validation,self.pca_n_component)
else:
pass
# training
print("training...\nYou need to wait for a while")
model,weight=self.training(data_train,self.label_tr,\
step=self.step, cv=self.k,n_jobs=self.num_jobs,\
permutation=self.permutation)
# fetch orignal weight
if 0 < self.pca_n_component< 1:
weight=trained_pca.inverse_transform(weight)
self.weight_all=weight
# testing
print("testing...")
self.predict,self.decision=self.testing(model,data_validation)
# eval performances
self.val_label=np.loadtxt(self.val_label)
self.eval_prformance(self.val_label,self.predict,self.decision)
return self
def main(self):
self.load_data()
self.tr_te_ev()
return self
if __name__=="__main__":
svc=SvcForGivenTrAndTe()
results=svc.main()
results=results.__dict__
print("Done!\n") |
dongmengshi/easylearn | eslearn/developer/class_template.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
"""This module is used to preprocess data.
Created on Wed Jul 4 13:57:15 2018
@author: <NAME>
Email:<EMAIL>
GitHub account name: lichao312214129
Institution (company): Brain Function Research Section, The First Affiliated Hospital of China Medical University, Shenyang, Liaoning, PR China.
License: MIT
"""
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import MinMaxScaler
from sklearn import preprocessing
class Preprocessing():
'''This class is used to preprocess features
TODO: add other preprocessing methods
Method 1: preprocess data in group level, namely one feature(column) by one feature(column).
Method 2: preprocess data in subject level, namely one subject(row) by one subject(row).
Parameters:
----------
data_preprocess_method: string
how to preprocess the features, 'StandardScaler' or 'MinMaxScaler'
data_preprocess_level: string
which level to preprocess features, 'subject' or 'group'
Attibutes:
----------
None
'''
def __init__(self, data_preprocess_method='StandardScaler', data_preprocess_level='subject'):
self.data_preprocess_method = data_preprocess_method
self.data_preprocess_level = data_preprocess_level
def data_preprocess(self, feature_train, feature_test):
'''This function is used to preprocess features
Method 1: preprocess data in group level, namely one feature(column) by one feature(column).
Method 2: preprocess data in subject level, namely one subject(row) by one subject(row).
Parameters
----------
feature_train: numpy.ndarray
features in training dataset
feature_test: numpy.ndarray
features in test dataset
Returns
------
preprocessed training features and test features.
'''
# Method 1: Group level preprocessing.
if self.data_preprocess_level == 'group':
feature_train, model = self.scaler(feature_train, self.data_preprocess_method)
feature_test = model.transform(feature_test)
elif self.data_preprocess_level == 'subject':
# Method 2: Subject level preprocessing.
scaler = preprocessing.StandardScaler().fit(feature_train.T)
feature_train = scaler.transform(feature_train.T) .T
scaler = preprocessing.StandardScaler().fit(feature_test.T)
feature_test = scaler.transform(feature_test.T) .T
else:
print('Please provide which level to preprocess features\n')
return
return feature_train, feature_test
def scaler(self, X, method):
"""The low level method
"""
if method == 'StandardScaler':
model = StandardScaler()
stdsc_x = model.fit_transform(X)
return stdsc_x, model
elif method == 'MinMaxScaler':
model = MinMaxScaler()
mima_x = model.fit_transform(X)
return mima_x, model
else:
print(f'Please specify the standardization method!')
return
def scaler_apply(self, train_x, test_x, scale_method):
"""Apply model to test data
"""
train_x, model = self.scaler(train_x, scale_method)
test_x = model.transform(test_x)
return train_x, test_x
|
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_svc_rfe_cv_V3.py | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed sel.decision 5 21:12:49 2018
@author: <NAME>
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python')
import matplotlib.pyplot as plt
from sklearn.model_selection import KFold
import pandas as pd
import numpy as np
from imblearn.over_sampling import SMOTE, ADASYN
from Utils.lc_scaler import scaler_apply
from Utils.lc_dimreduction import pca_apply
from Utils.fetch_kfoldidx import fetch_kFold_Index_for_allLabel
from Utils.fetch_kfoldidx import fetch_kfold_idx_for_alllabel_LOOCV
from Utils.lc_featureSelection_rfe import rfeCV
from Utils.lc_evaluation import eval_performance
class SVCRfeCv(object):
"""
利用递归特征消除的方法筛选特征,然后用SVR训练模型,后用cross-validation的方式来验证
1、 对特征进行归一化--主成分降维(可选)--RFE--喂入SVC中进行训练--prediction
2、 采取outer_k-fold的策略
3、 请注意: 在交叉验证时,我将每个不同的类别的样本都进行split,
得到训练集和测试集,然后再把每个类别的训练集组合成一个
大的训练集,测试集同样如此。因此,K参数不能大于数量较少的那个类别
(比如病人这一类别的样本量是50,正常类是40,那么K不能大于40,且当K=40时,将执行LOOCV)
Parameters:
----------
outer_k=3:outer_k-fold
step=0.1: rfe step 10%
num_jobs=1: parallel
scale_method='StandardScaler':standardization method
pca_n_component=0.9
permutation=0
Returns:
各种分类效果等
"""
def __init__(sel,
outer_k=5,
scale_method='StandardScaler',
pca_n_component=1, # not use PCA by default
inner_k=5, # nest k
step=0.1,
show_results=1,
show_roc=0,
num_jobs=1,
_seed=666,
is_resample=True):
sel.outer_k = outer_k
sel.scale_method = scale_method
sel.pca_n_component = pca_n_component
sel.inner_k = inner_k
sel.step = step
sel.show_results = show_results
sel.show_roc = show_roc
sel.num_jobs = num_jobs
sel._seed = 666 # keep the make the results comparable
sel.is_resample = is_resample # if resample (over- or under-resampling)
print("SVCRfeCv initiated")
def svc_rfe_cv(sel, x, y):
"""main function
"""
print('training model and _predict using ' +
str(sel.outer_k) + '-fold CV...\n')
# preprocess the x and y (# transform data into ndarry and reshape the
# y into 1 d)
x, y = np.array(x, dtype=np.float32), np.array(y, dtype=np.int16)
y = np.reshape(y, [-1, ])
# If k-fold or loocv
# If is k-fold, then the k must be less than the number of the group
# that has smallest sample
num_of_label = [np.sum(y == uni_y) for uni_y in np.unique(y)]
num_of_smallest_label = np.min(num_of_label)
if sel.outer_k < num_of_smallest_label:
index_train, index_test = fetch_kFold_Index_for_allLabel(
x, y, sel.outer_k, sel._seed)
elif sel.outer_k == len(y):
index_train, index_test = fetch_kfold_idx_for_alllabel_LOOCV(y)
else:
print(
"outer_k is greater than sample size!\nthe outer_k = {},\
and the sample size = {}".format(
sel.outer_k, num_of_smallest_label))
return
sel.predictlabel = pd.DataFrame([])
sel.decision = pd.DataFrame([])
sel.y_real_sorted = pd.DataFrame([])
sel.weight_all = np.zeros([sel.outer_k, int(
(len(np.unique(y)) * (len(np.unique(y)) - 1)) / 2), x.shape[1]])
for i in range(sel.outer_k):
# split
x_train, y_train = x[index_train[i]], y[index_train[i]]
# up-resample(Only training dataset)
if sel.is_resample:
x_train, y_train = sel.resample(x_train, y_train, method='over-sampling-SMOTE')
x_test, y_test = x[index_test[i]], y[index_test[i]]
np_size = np.size(x_test)
if np.shape(x_test)[0] == np_size:
x_test = x_test.reshape(1, np_size)
# 根据是否为LOOCV来进行不同的concat
if sel.outer_k < len(y):
sel.y_real_sorted = pd.concat(
[sel.y_real_sorted, pd.DataFrame(y_test)])
elif sel.outer_k == len(y):
sel.y_real_sorted = pd.concat(
[sel.y_real_sorted, pd.DataFrame([y_test])])
else:
print(
"outer_k(outer_k fold) is greater than sample size!\
the outer_k = {}, and the sample size = {}".format(
sel.outer_k, len(y)))
return
# scale
if sel.scale_method:
x_train, x_test = scaler_apply(x_train, x_test, sel.scale_method)
# pca
if 0 < sel.pca_n_component < 1:
x_train, x_test, trained_pca = pca_apply(
x_train, x_test, sel.pca_n_component)
print(x_train.shape[1])
else:
print(x_train.shape[1])
pass
# training
model, weight = sel._training(x_train, y_train,
step=sel.step, cv=sel.inner_k,
n_jobs=sel.num_jobs)
# fetch orignal weight
if 0 < sel.pca_n_component < 1:
weight = trained_pca.inverse_transform(weight)
sel.weight_all[i, :, :] = weight
# test
prd, de = sel._predict(model, x_test)
prd = pd.DataFrame(prd)
de = pd.DataFrame(de)
sel.predictlabel = pd.concat([sel.predictlabel, prd])
sel.decision = pd.concat([sel.decision, de])
print('{}/{}\n'.format(i + 1, sel.outer_k))
# evaluate trained model
if sel.show_results:
sel.accuracy, sel.sensitivity, sel.specificity, sel.auc = \
eval_performance(
sel.y_real_sorted.values,
sel.predictlabel.values,
sel.decision.values,
sel.show_roc)
return sel
def resample(sel, data, label, method='over-sampling-SMOTE'):
"""
Resamle data: over-sampling OR under-sampling
TODO: Other resample methods.
"""
if method == 'over-sampling-SMOTE':
data, label = SMOTE().fit_resample(data, label)
elif method == 'over-sampling-ADASYN':
data, label = ADASYN().fit_resample(data, label)
else:
print(f'TODO: Other resample methods')
return data, label
def _training(sel, x, y, step, cv, n_jobs):
model, weight = rfeCV(x, y, step, cv, n_jobs)
return model, weight
def _predict(sel, model, test_X):
predictlabel = model.predict(test_X)
decision = model.decision_function(test_X)
return predictlabel, decision
# for debugging
if __name__ == '__main__':
from sklearn import datasets
import Machine_learning.classfication.lc_svc_rfe_cv_V3 as lsvc
x, y = datasets.make_classification(n_samples=500, n_classes=3,
n_informative=50, n_redundant=3,
n_features=100, random_state=1)
sel = lsvc.SVCRfeCv(outer_k=5)
results = sel.svc_rfe_cv(x, y)
if results:
results = results.__dict__
|
dongmengshi/easylearn | eslearn/utils/lc_indentify_repeat_subjects.py | <reponame>dongmengshi/easylearn<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 6 18:54:37 2018
找到与subjects重复的ID
@author: lenovo
"""
#
import pandas as pd
from selectSubjID_inScale import loadExcel
from selectSubjID_inScale import selMain
def indentify_repeat_subjects_pairs(file, uid_header):
"""
Identify the unique ID of subjects that have repeated scan or visit
"""
allClinicalData = loadExcel(file)
originSubj = allClinicalData[uid_header]
folder, basic, hamd17, hama, yars, bprs, logicIndex_scale, logicIndex_repeat = selMain(file)
dia = allClinicalData[logicIndex_repeat]['诊断备注']
repeatNote = dia.str.findall(r'(\d*\d)')
repeatSubj = originSubj.loc[repeatNote.index]
return repeatNote, repeatSubj
#
if __name__ == '__main__':
repeatNote, repeatSubj = indentify_repeat_subjects_pairs(
file=r'D:\WorkStation_2018\WorkStation_CNN_Schizo\Scale\10-24大表.xlsx',
uid_header='folder')
repeatPairs = pd.concat([repeatSubj, repeatNote], axis=1)
# 转格式
repeatPairs = repeatPairs.astype({'folder': 'int'})
print(repeatPairs)
# repeatPairs['诊断备注'] = repeatPairs.诊断备注.map(lambda x:float(x))
|
dongmengshi/easylearn | eslearn/machine_learning/test/GCNNCourseCodes/enzymes_GCNN.py | from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
from utils import *
from models import GCNN
from tensorflow import set_random_seed
import matplotlib.pyplot as plt
import scipy.io as sio
import scipy
from scipy.sparse import csr_matrix, lil_matrix
import numpy as np
def myaccalc(pred,yhat):
return np.sum(np.argmax(pred,1)==np.argmax(yhat,1))
# random seed for reproducability
seed = 32
np.random.seed(seed)
tf.set_random_seed(seed)
# Settings
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_float('learning_rate', 0.01, 'Initial learning rate.')
flags.DEFINE_integer('epochs', 500, 'Number of epochs to train.')
flags.DEFINE_integer('hidden1', 320, 'Number of units in hidden graph conv layer 1.')
flags.DEFINE_integer('hidden2', 100, 'Number of units in hidden graph conv layer 2.')
flags.DEFINE_integer('dense', 100, 'Number of units in hidden dense layer.')
flags.DEFINE_float('dropout', 0.10, 'Dropout rate (1 - keep probability).')
flags.DEFINE_float('weight_decay', 0.0, 'Weight for L2 loss on embedding matrix.')
flags.DEFINE_integer('nkernel', 3, 'number of kernels')
nkernel=flags.FLAGS.nkernel
# how many times do you want to update parameters over one epoch. batchsize=trainsize/bsize
bsize=3
# read data
a=sio.loadmat('enzymes.mat')
# list of adjacency matrix
A=a['A'][0]
# list of features
F=a['F'][0]
# label of graphs
Y=a['Y'][0]
# test train index for 10-fold test
TRid=a['tr']
TSid=a['ts']
# max number of nodes
nmax=0
for i in range(0,len(A)):
nmax=max(nmax,A[i].shape[0])
# number of node per graph
ND=np.zeros((len(A),1))
# node feature matrix
FF=np.zeros((len(A),nmax,3))
# one-hot coding output matrix
YY=np.zeros((len(A),6))
# Convolution kernels, supports
SP=np.zeros((len(A),nkernel,nmax,nmax))
# prepare inputs, outputs, convolution kernels for each graph
for i in range(0,len(A)):
# number of node in graph
n=F[i].shape[0]
ND[i,0]=n
# feature matrix
FF[i,0:n,:]= F[i]
# one-hot coding output matrix
YY[i,Y[i]]=1
# set kernels
chebnet = chebyshev_polynomials(A[i], nkernel-1)
for j in range(0,nkernel):
SP[i,j,0:n,0:n]=chebnet[j].toarray()
## GCN convolution kernel
#gcn= (normalize_adj(A[i] + sp.eye(A[i].shape[0]))).toarray()
#SP[i,0,0:n,0:n]=gcn
## MLP convolution kernel
#mlp=np.eye(n)
#SP[i,0,0:n,0:n]=gcn
## A and I convolution kernel
# SP[i,0,0:n,0:n]=np.eye(n)
# SP[i,1,0:n,0:n]=A[i]
NB=np.zeros((FLAGS.epochs,10))
for fold in range(0,10):
# train and test ids
trid=TRid[fold]
tsid=TSid[fold]
placeholders = {
'support': tf.placeholder(tf.float32, shape=(None,nkernel,nmax,nmax)),
'features': tf.placeholder(tf.float32, shape=(None,nmax, FF.shape[2])),
'labels': tf.placeholder(tf.float32, shape=(None, 6)),
'nnodes': tf.placeholder(tf.float32, shape=(None, 1)),
'dropout': tf.placeholder_with_default(0., shape=()),
}
model = GCNN(placeholders, input_dim=FF.shape[2],nkernel=nkernel,logging=True,agg='mean')
sess = tf.Session()
sess.run(tf.global_variables_initializer())
# train data placeholders
feed_dict = dict()
feed_dict.update({placeholders['labels']: YY[trid,:]})
feed_dict.update({placeholders['features']: FF[trid,:,:]})
feed_dict.update({placeholders['support']: SP[trid,:,:,:]})
feed_dict.update({placeholders['nnodes']: ND[trid,]})
feed_dict.update({placeholders['dropout']: FLAGS.dropout})
# test data placeholders
feed_dictT = dict()
feed_dictT.update({placeholders['labels']: YY[tsid,:]})
feed_dictT.update({placeholders['features']: FF[tsid,:,:]})
feed_dictT.update({placeholders['support']: SP[tsid,:,:,:]})
feed_dictT.update({placeholders['nnodes']: ND[tsid,]})
feed_dictT.update({placeholders['dropout']: 0})
ind=np.round(np.linspace(0,len(trid),bsize+1))
for epoch in range(FLAGS.epochs):
np.random.shuffle(trid)
for i in range(0,bsize): # batch training
feed_dictB = dict()
bid=trid[int(ind[i]):int(ind[i+1])]
feed_dictB.update({placeholders['labels']: YY[bid,:]})
feed_dictB.update({placeholders['features']: FF[bid,:,:]})
feed_dictB.update({placeholders['support']: SP[bid,:,:,:]})
feed_dictB.update({placeholders['nnodes']: ND[bid,]})
feed_dictB.update({placeholders['dropout']: FLAGS.dropout})
# train for batch data
outs = sess.run([model.opt_op], feed_dict=feed_dictB)
# check performance for all train sample
outs = sess.run([model.accuracy, model.loss, model.entropy,model.outputs], feed_dict=feed_dict)
# check performance for all test sample
outsT = sess.run([model.accuracy, model.loss, model.entropy,model.outputs], feed_dict=feed_dictT)
# number of true classified test graph
vtest=myaccalc(outsT[3],YY[tsid,:])
NB[epoch,fold]=vtest
if np.mod(epoch + 1,1)==0 or epoch==0:
print(fold," Epoch:", '%04d' % (epoch + 1), "train_loss=", "{:.5f}".format(outs[1]),"train_xent=", "{:.5f}".format(outs[2]),"train_acc=", "{:.5f}".format(outs[0]),"test_loss=", "{:.5f}".format(outsT[1]),
"test_xent=", "{:.5f}".format(outsT[2]), "test_acc=", "{:.5f}".format(outsT[0]), " ntrue=", "{:.0f}".format(vtest))
import pandas as pd
pd.DataFrame(NB).to_csv('testresultsoverepoch.csv')
|
dongmengshi/easylearn | eslearn/GUI/easylearn_data_loading_gui.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\My_Codes\easylearn-fmri\eslearn\gui_test\easylearn_data_loading_gui.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1093, 845)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout_group_modality = QtWidgets.QVBoxLayout()
self.verticalLayout_group_modality.setObjectName("verticalLayout_group_modality")
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setObjectName("gridLayout_2")
self.verticalLayout_group = QtWidgets.QVBoxLayout()
self.verticalLayout_group.setObjectName("verticalLayout_group")
self.label_group = QtWidgets.QLabel(self.centralwidget)
self.label_group.setObjectName("label_group")
self.verticalLayout_group.addWidget(self.label_group)
self.listView_groups = QtWidgets.QListView(self.centralwidget)
self.listView_groups.setMinimumSize(QtCore.QSize(20, 10))
self.listView_groups.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
self.listView_groups.setObjectName("listView_groups")
self.verticalLayout_group.addWidget(self.listView_groups)
self.group_btn = QtWidgets.QHBoxLayout()
self.group_btn.setObjectName("group_btn")
self.pushButton_addgroups = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_addgroups.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_addgroups.setToolTipDuration(-5)
self.pushButton_addgroups.setObjectName("pushButton_addgroups")
self.group_btn.addWidget(self.pushButton_addgroups)
self.pushButton_removegroups = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_removegroups.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_removegroups.setObjectName("pushButton_removegroups")
self.group_btn.addWidget(self.pushButton_removegroups)
self.pushButton_cleargroups = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_cleargroups.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_cleargroups.setObjectName("pushButton_cleargroups")
self.group_btn.addWidget(self.pushButton_cleargroups)
self.verticalLayout_group.addLayout(self.group_btn)
self.gridLayout_2.addLayout(self.verticalLayout_group, 3, 1, 1, 1)
self.verticalLayout_group_modality.addLayout(self.gridLayout_2)
spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.verticalLayout_group_modality.addItem(spacerItem)
self.verticalLayout_modality = QtWidgets.QVBoxLayout()
self.verticalLayout_modality.setObjectName("verticalLayout_modality")
self.label_modalities = QtWidgets.QLabel(self.centralwidget)
self.label_modalities.setObjectName("label_modalities")
self.verticalLayout_modality.addWidget(self.label_modalities)
self.listView_modalities = QtWidgets.QListView(self.centralwidget)
self.listView_modalities.setMinimumSize(QtCore.QSize(20, 10))
self.listView_modalities.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
self.listView_modalities.setObjectName("listView_modalities")
self.verticalLayout_modality.addWidget(self.listView_modalities)
self.modality_btn = QtWidgets.QHBoxLayout()
self.modality_btn.setObjectName("modality_btn")
self.pushButton_addmodalities = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_addmodalities.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_addmodalities.setToolTipDuration(-5)
self.pushButton_addmodalities.setObjectName("pushButton_addmodalities")
self.modality_btn.addWidget(self.pushButton_addmodalities)
self.pushButton_removemodalites = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_removemodalites.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_removemodalites.setObjectName("pushButton_removemodalites")
self.modality_btn.addWidget(self.pushButton_removemodalites)
self.pushButton_clearmodalities = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_clearmodalities.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_clearmodalities.setObjectName("pushButton_clearmodalities")
self.modality_btn.addWidget(self.pushButton_clearmodalities)
self.verticalLayout_modality.addLayout(self.modality_btn)
self.verticalLayout_group_modality.addLayout(self.verticalLayout_modality)
self.horizontalLayout_2.addLayout(self.verticalLayout_group_modality)
spacerItem1 = QtWidgets.QSpacerItem(30, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.verticalLayout_files = QtWidgets.QVBoxLayout()
self.verticalLayout_files.setObjectName("verticalLayout_files")
self.verticalLayout_file = QtWidgets.QVBoxLayout()
self.verticalLayout_file.setObjectName("verticalLayout_file")
self.label_file = QtWidgets.QLabel(self.centralwidget)
self.label_file.setObjectName("label_file")
self.verticalLayout_file.addWidget(self.label_file)
self.listView_files = QtWidgets.QListView(self.centralwidget)
self.listView_files.setMinimumSize(QtCore.QSize(10, 200))
self.listView_files.setBaseSize(QtCore.QSize(10, 10))
self.listView_files.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
self.listView_files.setObjectName("listView_files")
self.verticalLayout_file.addWidget(self.listView_files)
self.file_btn = QtWidgets.QHBoxLayout()
self.file_btn.setObjectName("file_btn")
self.pushButton_addfiles = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_addfiles.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_addfiles.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_addfiles.setToolTipDuration(-5)
self.pushButton_addfiles.setObjectName("pushButton_addfiles")
self.file_btn.addWidget(self.pushButton_addfiles)
self.pushButton_removefiles = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_removefiles.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_removefiles.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_removefiles.setObjectName("pushButton_removefiles")
self.file_btn.addWidget(self.pushButton_removefiles)
self.pushButton_clearfiles = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_clearfiles.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_clearfiles.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_clearfiles.setObjectName("pushButton_clearfiles")
self.file_btn.addWidget(self.pushButton_clearfiles)
self.verticalLayout_file.addLayout(self.file_btn)
self.verticalLayout_files.addLayout(self.verticalLayout_file)
self.horizontalLayout_2.addLayout(self.verticalLayout_files)
self.gridLayout.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.gridLayout.addItem(spacerItem2, 1, 0, 1, 1)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.gridLayout_3 = QtWidgets.QGridLayout()
self.gridLayout_3.setObjectName("gridLayout_3")
self.lineEdit_mask = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_mask.setMinimumSize(QtCore.QSize(30, 40))
self.lineEdit_mask.setObjectName("lineEdit_mask")
self.gridLayout_3.addWidget(self.lineEdit_mask, 1, 0, 1, 1)
self.label_mask = QtWidgets.QLabel(self.centralwidget)
self.label_mask.setObjectName("label_mask")
self.gridLayout_3.addWidget(self.label_mask, 0, 0, 1, 1)
self.file_btn_2 = QtWidgets.QHBoxLayout()
self.file_btn_2.setObjectName("file_btn_2")
self.pushButton_selectMask = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_selectMask.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_selectMask.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_selectMask.setToolTipDuration(-5)
self.pushButton_selectMask.setObjectName("pushButton_selectMask")
self.file_btn_2.addWidget(self.pushButton_selectMask)
self.pushButton_clearMask = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_clearMask.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_clearMask.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_clearMask.setObjectName("pushButton_clearMask")
self.file_btn_2.addWidget(self.pushButton_clearMask)
self.gridLayout_3.addLayout(self.file_btn_2, 2, 0, 1, 1)
self.pushButton_mask = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_mask.setStyleSheet("gridline-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 rgba(255, 255, 255, 255), stop:0.1 rgba(255, 255, 255, 255), stop:0.2 rgba(255, 176, 176, 167), stop:0.3 rgba(255, 151, 151, 92), stop:0.4 rgba(255, 125, 125, 51), stop:0.5 rgba(255, 76, 76, 205), stop:0.52 rgba(255, 76, 76, 205), stop:0.6 rgba(255, 180, 180, 84), stop:1 rgba(255, 255, 255, 0));")
self.pushButton_mask.setObjectName("pushButton_mask")
self.gridLayout_3.addWidget(self.pushButton_mask, 1, 1, 1, 1)
self.horizontalLayout.addLayout(self.gridLayout_3)
spacerItem3 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem3)
self.gridLayout_4 = QtWidgets.QGridLayout()
self.gridLayout_4.setObjectName("gridLayout_4")
self.label_target = QtWidgets.QLabel(self.centralwidget)
self.label_target.setObjectName("label_target")
self.gridLayout_4.addWidget(self.label_target, 0, 0, 1, 1)
self.file_btn_3 = QtWidgets.QHBoxLayout()
self.file_btn_3.setObjectName("file_btn_3")
self.pushButton_selectTarget = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_selectTarget.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_selectTarget.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_selectTarget.setToolTipDuration(-5)
self.pushButton_selectTarget.setObjectName("pushButton_selectTarget")
self.file_btn_3.addWidget(self.pushButton_selectTarget)
self.pushButton_clearTarget = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_clearTarget.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_clearTarget.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_clearTarget.setObjectName("pushButton_clearTarget")
self.file_btn_3.addWidget(self.pushButton_clearTarget)
self.gridLayout_4.addLayout(self.file_btn_3, 3, 0, 1, 1)
self.lineEdit_target = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_target.setMinimumSize(QtCore.QSize(30, 40))
self.lineEdit_target.setObjectName("lineEdit_target")
self.gridLayout_4.addWidget(self.lineEdit_target, 2, 0, 1, 1)
self.pushButton_target = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_target.setObjectName("pushButton_target")
self.gridLayout_4.addWidget(self.pushButton_target, 2, 1, 1, 1)
self.horizontalLayout.addLayout(self.gridLayout_4)
spacerItem4 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem4)
self.gridLayout_5 = QtWidgets.QGridLayout()
self.gridLayout_5.setObjectName("gridLayout_5")
self.label_covariance = QtWidgets.QLabel(self.centralwidget)
self.label_covariance.setObjectName("label_covariance")
self.gridLayout_5.addWidget(self.label_covariance, 0, 0, 1, 1)
self.file_btn_4 = QtWidgets.QHBoxLayout()
self.file_btn_4.setObjectName("file_btn_4")
self.pushButton_selectCovariance = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_selectCovariance.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_selectCovariance.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_selectCovariance.setToolTipDuration(-5)
self.pushButton_selectCovariance.setObjectName("pushButton_selectCovariance")
self.file_btn_4.addWidget(self.pushButton_selectCovariance)
self.pushButton_clearCovriance = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_clearCovriance.setMinimumSize(QtCore.QSize(20, 40))
self.pushButton_clearCovriance.setBaseSize(QtCore.QSize(10, 10))
self.pushButton_clearCovriance.setObjectName("pushButton_clearCovriance")
self.file_btn_4.addWidget(self.pushButton_clearCovriance)
self.gridLayout_5.addLayout(self.file_btn_4, 3, 0, 1, 1)
self.lineEdit_covariates = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_covariates.setMinimumSize(QtCore.QSize(30, 40))
self.lineEdit_covariates.setObjectName("lineEdit_covariates")
self.gridLayout_5.addWidget(self.lineEdit_covariates, 2, 0, 1, 1)
self.pushButton_covariate = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_covariate.setObjectName("pushButton_covariate")
self.gridLayout_5.addWidget(self.pushButton_covariate, 2, 1, 1, 1)
self.horizontalLayout.addLayout(self.gridLayout_5)
self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1093, 26))
self.menubar.setObjectName("menubar")
self.menuConfiguration_file = QtWidgets.QMenu(self.menubar)
self.menuConfiguration_file.setObjectName("menuConfiguration_file")
self.menuHelp_H = QtWidgets.QMenu(self.menubar)
self.menuHelp_H.setObjectName("menuHelp_H")
self.menuSkin = QtWidgets.QMenu(self.menubar)
self.menuSkin.setObjectName("menuSkin")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionChoose_configuration_file = QtWidgets.QAction(MainWindow)
self.actionChoose_configuration_file.setObjectName("actionChoose_configuration_file")
self.actionSave_configuration = QtWidgets.QAction(MainWindow)
self.actionSave_configuration.setObjectName("actionSave_configuration")
self.actionWeb = QtWidgets.QAction(MainWindow)
self.actionWeb.setObjectName("actionWeb")
self.actionPDF = QtWidgets.QAction(MainWindow)
self.actionPDF.setObjectName("actionPDF")
self.actionDark = QtWidgets.QAction(MainWindow)
self.actionDark.setObjectName("actionDark")
self.actionBlack = QtWidgets.QAction(MainWindow)
self.actionBlack.setObjectName("actionBlack")
self.actionDarkOrange = QtWidgets.QAction(MainWindow)
self.actionDarkOrange.setObjectName("actionDarkOrange")
self.actionGray = QtWidgets.QAction(MainWindow)
self.actionGray.setObjectName("actionGray")
self.actionBlue = QtWidgets.QAction(MainWindow)
self.actionBlue.setObjectName("actionBlue")
self.actionNavy = QtWidgets.QAction(MainWindow)
self.actionNavy.setObjectName("actionNavy")
self.actionClassic = QtWidgets.QAction(MainWindow)
self.actionClassic.setObjectName("actionClassic")
self.actionLight = QtWidgets.QAction(MainWindow)
self.actionLight.setObjectName("actionLight")
self.menuConfiguration_file.addAction(self.actionChoose_configuration_file)
self.menuConfiguration_file.addAction(self.actionSave_configuration)
self.menuHelp_H.addAction(self.actionWeb)
self.menuHelp_H.addAction(self.actionPDF)
self.menuSkin.addAction(self.actionDark)
self.menuSkin.addAction(self.actionBlack)
self.menuSkin.addAction(self.actionDarkOrange)
self.menuSkin.addAction(self.actionGray)
self.menuSkin.addAction(self.actionBlue)
self.menuSkin.addAction(self.actionNavy)
self.menuSkin.addAction(self.actionClassic)
self.menuSkin.addAction(self.actionLight)
self.menubar.addAction(self.menuConfiguration_file.menuAction())
self.menubar.addAction(self.menuHelp_H.menuAction())
self.menubar.addAction(self.menuSkin.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_group.setText(_translate("MainWindow", "Groups"))
self.pushButton_addgroups.setWhatsThis(_translate("MainWindow", "<html><head/><body><p>push the button then close program</p></body></html>"))
self.pushButton_addgroups.setText(_translate("MainWindow", "Add"))
self.pushButton_removegroups.setText(_translate("MainWindow", "Remove"))
self.pushButton_cleargroups.setText(_translate("MainWindow", "Clear"))
self.label_modalities.setText(_translate("MainWindow", "Modalities"))
self.pushButton_addmodalities.setWhatsThis(_translate("MainWindow", "<html><head/><body><p>push the button then close program</p></body></html>"))
self.pushButton_addmodalities.setText(_translate("MainWindow", "Add"))
self.pushButton_removemodalites.setText(_translate("MainWindow", "Remove"))
self.pushButton_clearmodalities.setText(_translate("MainWindow", "Clear"))
self.label_file.setText(_translate("MainWindow", "Files"))
self.pushButton_addfiles.setWhatsThis(_translate("MainWindow", "<html><head/><body><p>push the button then close program</p></body></html>"))
self.pushButton_addfiles.setText(_translate("MainWindow", "Add"))
self.pushButton_removefiles.setText(_translate("MainWindow", "Remove"))
self.pushButton_clearfiles.setText(_translate("MainWindow", "Clear"))
self.label_mask.setText(_translate("MainWindow", "Mask"))
self.pushButton_selectMask.setWhatsThis(_translate("MainWindow", "<html><head/><body><p>push the button then close program</p></body></html>"))
self.pushButton_selectMask.setText(_translate("MainWindow", "Select mask"))
self.pushButton_clearMask.setText(_translate("MainWindow", "Clear mask"))
self.pushButton_mask.setText(_translate("MainWindow", "OK"))
self.label_target.setText(_translate("MainWindow", "Targets"))
self.pushButton_selectTarget.setWhatsThis(_translate("MainWindow", "<html><head/><body><p>push the button then close program</p></body></html>"))
self.pushButton_selectTarget.setText(_translate("MainWindow", "Select targets"))
self.pushButton_clearTarget.setText(_translate("MainWindow", "Clear targets"))
self.pushButton_target.setText(_translate("MainWindow", "Ok"))
self.label_covariance.setText(_translate("MainWindow", "Covariates"))
self.pushButton_selectCovariance.setWhatsThis(_translate("MainWindow", "<html><head/><body><p>push the button then close program</p></body></html>"))
self.pushButton_selectCovariance.setText(_translate("MainWindow", "Select covariates"))
self.pushButton_clearCovriance.setText(_translate("MainWindow", "Clear covariates"))
self.pushButton_covariate.setText(_translate("MainWindow", "Ok"))
self.menuConfiguration_file.setTitle(_translate("MainWindow", "Configuration file(&F)"))
self.menuHelp_H.setTitle(_translate("MainWindow", "Help(&H)"))
self.menuSkin.setTitle(_translate("MainWindow", "Skin"))
self.actionChoose_configuration_file.setText(_translate("MainWindow", "Load configuration"))
self.actionSave_configuration.setText(_translate("MainWindow", "Save configuration"))
self.actionWeb.setText(_translate("MainWindow", "Web"))
self.actionPDF.setText(_translate("MainWindow", "PDF"))
self.actionDark.setText(_translate("MainWindow", "Dark"))
self.actionBlack.setText(_translate("MainWindow", "Black"))
self.actionDarkOrange.setText(_translate("MainWindow", "DarkOrange"))
self.actionGray.setText(_translate("MainWindow", "Gray"))
self.actionBlue.setText(_translate("MainWindow", "Blue"))
self.actionNavy.setText(_translate("MainWindow", "Navy"))
self.actionClassic.setText(_translate("MainWindow", "Classic"))
self.actionLight.setText(_translate("MainWindow", "Light"))
|
dongmengshi/easylearn | eslearn/utils/lc_fetch_cov_according_folder.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 3 23:04:33 2019
当给定了影像数据和量表时,如果量表数据包括而且大于影像数据时,我们需要从中提取与影像数据匹配的部分
@author: lenovo
"""
import sys
import os
cpwd = __file__
root = os.path.dirname(os.path.dirname(__file__))
sys.path.append(root)
print(f'##{root}')
import pandas as pd
import Utils.lc_copy_selected_file_V6 as copy
class screening_covariance_to_match_neuroimage():
def __init__(sel):
sel.folder = r'D:\WorkStation_2018\WorkStation_dynamicFC_V1\Data\zDynamic\state\covariances\folder_MDD.xlsx'
sel.path_neuroimage = r'D:\WorkStation_2018\WorkStation_dynamicFC_V1\Data\zDynamic\state\allState17_5\state5_all\state5\state5_MDD'
sel.cov_path = r'D:\WorkStation_2018\WorkStation_dynamicFC_V1\Data\zDynamic\state\covariances\ageANDsex_MDD.xlsx'
sel.save_path = r'D:\WorkStation_2018\WorkStation_dynamicFC_V1\Data\zDynamic\state\allState17_5\state5_all\state5\cov'
sel.save_name = 'state5_cov_MDD.xlsx'
def fetch_folder(sel):
""" fetch sel.folder"""
sel_folder = copy.CopyFmri(
reference_file=sel.folder,
targe_file_folder=sel.path_neuroimage,
keywork_reference_for_uid='([1-9]\d*)',
ith_reference_for_uid=0,
keyword_targetfile_for_uid='([1-9]\d*)',
matching_pointnumber_in_backwards=1,
ith_targetfile_for_uid=0,
keyword_targetfile_not_for_uid='',
keyword_parentfolder_contain_targetfile='',
savePath=sel.save_path,
n_processess=2,
ifSaveLog=0,
ifCopy=0,
ifMove=0,
saveInToOneOrMoreFolder='saveToOneFolder',
saveNameSuffix='',
ifRun=0)
result = sel_folder.main_run()
uid = result.allSubjName
values = [int(v) for v in uid.values]
uid = pd.DataFrame(values)
return uid
def fecth_cov_acord_to_folder(sel,uid, left_on=0, right_on='Unnamed: 0'):
"""求folder和cov的交集"""
cov = pd.read_excel(sel.cov_path)
cov_selected = pd.merge(
uid,
cov,
left_on=left_on,
right_on=right_on,
how='inner')
return cov_selected
if __name__ == "__main__":
sel = screening_covariance_to_match_neuroimage()
uid = sel.fetch_folder()
cov_selected = sel.fecth_cov_acord_to_folder(uid)
# save
cov_selected[['年龄', '性别']].to_excel(os.path.join(
sel.save_path, sel.save_name), index=False, header=False)
|
dongmengshi/easylearn | eslearn/utils/lc_addsubjID.py | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Sat May 18 15:50:17 2019
@author: lenovo
"""
import os
class Input():
"""
process input
"""
def __init__(sel):
# cwd = os.path.dirname(__file__)
cwd = os.getcwd()
input_path = os.path.join(cwd, "input.txt")
if not os.path.exists(input_path):
input("No input text file!")
with open(input_path, 'r', encoding='UTF-8') as f:
cont = f.readlines()
allinput = [cont_.split('=')[1] for cont_ in cont]
allinput = [allin.split('\n')[0] for allin in allinput]
sel.root_path = eval(allinput[0])
sel.modality = eval(allinput[1])
sel.metric = eval(allinput[2])
class AddSubjID(Input):
"""
add subject ID to files in BIDS
"""
def __init__(sel, root_path=None, modality=None, metric=None):
super().__init__()
if not sel.root_path:
print("please set root path")
print("AddsubjID initiated!")
def addsubjid(sel):
"""
main function
"""
sel.__get_all_subj_folder()
sel.__get_all_metric_path()
sel.__get_all_files_path()
sel.__addid()
input("All Done!\nPress any key to exit...")
def __get_all_subj_folder(sel):
sel.all_subj_folder_name = os.listdir(sel.root_path)
def __get_all_metric_path(sel):
sel.all_metric_path = \
[os.path.join(sel.root_path, folder, sel.modality, sel.metric) for folder in sel.all_subj_folder_name]
return sel.all_metric_path
def __get_all_files_path(sel):
all_files_name = [os.listdir(filepath) for filepath in sel.all_metric_path]
sel.all_files_path = []
for metric, file in zip(sel.all_metric_path, all_files_name):
filepath = [os.path.join(metric, onefile) for onefile in file]
sel.all_files_path.append(filepath)
return sel.all_files_path
def __addid(sel):
n_subj = len(sel.all_subj_folder_name)
i = 1
for folder_name, file_path in zip(sel.all_subj_folder_name, sel.all_files_path):
print("processing {}/{}".format(i, n_subj))
old_name = file_path
old_basename = [os.path.basename(oldname) for oldname in old_name]
old_dirname = [os.path.dirname(oldname) for oldname in old_name]
new_name = [folder_name + "_" + basename for basename in old_basename]
new_name = [os.path.join(olddirname, newname) for olddirname, newname in zip(old_dirname, new_name)]
# execute!
[os.rename(oldname, newname) for oldname, newname in zip(old_name, new_name)]
i += 1
if __name__ == "__main__":
addid = AddSubjID(root_path=r'F:\黎超\陆衡鹏飞\2d_sample')
addid.addsubjid()
|
dongmengshi/easylearn | eslearn/utils/lc_resample_base.py | <reponame>dongmengshi/easylearn
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 5 10:45:52 2019
@author: lenovo
"""
from SimpleITK import ReadImage, ImageSeriesReader, GetArrayFromImage
import SimpleITK as sitk
import numpy as np
class ResampleImg():
"""
Resample a 3D old_image to given new spacing
The new voxel spacing will determine the new old_image dimensions.
If is orginal data, use sitk.sitkLinear.
If is binary mask, usse sitk.sitkNearestNeighbor
"""
def __init__(sel):
sel._new_spacing = np.array([0.684, 0.684, 0.684])
def resample(sel, old_image_path, datatype='series'):
"""
Usage: resample(sel, old_image_path)
Resample a 3D old_image to given new spacing
The new voxel spacing will determine the new old_image dimensions.
interpolation选项 所用的插值方法
INTER_NEAREST 最近邻插值
INTER_LINEAR 双线性插值(默认设置)
INTER_AREA 使用像素区域关系进行重采样。 它可能是图像抽取的首选方法,因为它会产生无云纹理的结果。 但是当图像缩放时,它类似于INTER_NEAREST方法。
INTER_CUBIC 4x4像素邻域的双三次插值
INTER_LANCZOS4 8x8像素邻域的Lanczos插值
"""
# read dicom series
if datatype == 'series':
reader = ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames(old_image_path)
reader.SetFileNames(dicom_names)
reader.MetaDataDictionaryArrayUpdateOn()
reader.LoadPrivateTagsOn()
series_ids = reader.GetGDCMSeriesIDs(old_image_path) # get all series id
series_file_names = reader.GetGDCMSeriesFileNames(old_image_path, series_ids[0]) # get the first series
reader.SetFileNames(series_file_names)
old_image = reader.Execute() # type: sitk.Image
elif datatype == 'nii':
# read nifiti file
old_image = ReadImage(old_image_path)
else:
print(f'Datatype {datatype} is wrong!\n')
# get old information and new information
old_spacing = old_image.GetSpacing()
size = old_image.GetSize()
new_size = (np.round(size*(old_spacing/sel._new_spacing))).astype(int).tolist()
# EXE
# If is orginal data ('series'), use sitk.sitkLinear.
# If is binary mask ('nii'), usse sitk.sitkNearestNeighbor.
# TODO: other methods;
# FIXME: Some cases the 'series' may not indicate the orginal data
# FIXME:Some cases the 'nii' may not indicate the binary mask
if datatype == 'series':
resampled_img = sitk.Resample(old_image, new_size, sitk.Transform(),
sitk.sitkLinear, old_image.GetOrigin(), sel._new_spacing,
old_image.GetDirection(), 0.0, old_image.GetPixelID())
elif datatype == 'nii':
resampled_img = sitk.Resample(old_image, new_size, sitk.Transform(),
sitk.sitkNearestNeighbor, old_image.GetOrigin(), sel._new_spacing,
old_image.GetDirection(), 0.0, old_image.GetPixelID())
# resampled_img.GetSpacing()
# resampled_img.GetSize()
return resampled_img
if __name__ == '__main__':
sel = ResampleImg()
# resampled_img = sel.resample(old_img_path)
# resampled_img.GetSpacing()
# resampled_img.GetSize()
|
dongmengshi/easylearn | eslearn/GUI/dec.py | <filename>eslearn/GUI/dec.py
from sklearn.datasets import make_friedman1
from sklearn.feature_selection import RFECV
from sklearn.svm import SVR
from sklearn.linear_model import LinearRegression
from sklearn import linear_model
X, y = make_friedman1(n_samples=50, n_features=10, random_state=0)
estimator = SVR(kernel="linear")
estimator= LinearRegression()
estimator = linear_model.BayesianRidge()
selector = RFECV(estimator, step=1, cv=5)
selector = selector.fit(X, y)
dir(selector)
s = selector.support_
|
dongmengshi/easylearn | eslearn/visualization/dALFF_cirBar.py | <reponame>dongmengshi/easylearn<filename>eslearn/visualization/dALFF_cirBar.py
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 20:55:51 2018
@author: lenovo
"""
import sys
sys.path.append(r'D:\myCodes\MVPA_LIChao\MVPA_Python\MVPA\utils')
from lc_read_write_Mat import read_mat
import numpy as np
import pandas as pd
hcPath=r'I:\dynamicALFF\Results\DALFF\50_0.9\Statistical_Results\Signal\ROISignals_ROISignal_FWHM4_HC.mat'
szPath=r'I:\dynamicALFF\Results\DALFF\50_0.9\Statistical_Results\Signal\ROISignals_ROISignal_FWHM4_SZ.mat'
bdPath=r'I:\dynamicALFF\Results\DALFF\50_0.9\Statistical_Results\Signal\ROISignals_ROISignal_FWHM4_BD.mat'
mddPath=r'I:\dynamicALFF\Results\DALFF\50_0.9\Statistical_Results\Signal\ROISignals_ROISignal_FWHM4_MDD.mat'
dataset_struct,datasetHC=read_mat(hcPath,'ROISignals')
dataset_struct,datasetSZ=read_mat(szPath,'ROISignals')
dataset_struct,datasetBD=read_mat(bdPath,'ROISignals')
dataset_struct,datasetMDD=read_mat(mddPath,'ROISignals')
meanHC=pd.DataFrame(np.mean(datasetHC,axis=0))
meanSZ=pd.DataFrame(np.mean(datasetSZ,axis=0))
meanBD=pd.DataFrame(np.mean(datasetBD,axis=0))
meanMDD=pd.DataFrame(np.mean(datasetMDD,axis=0))
allData=pd.concat([meanHC,meanSZ,meanBD,meanMDD],axis=1)
allData.index=['左侧额中回/额上回 ','右侧额上回(靠内)','右侧前扣带回 ','右侧尾状核','左侧尾状核',
'右侧putamen','左侧putamen','右侧前岛叶',
'左侧前岛叶','右侧杏仁核 ','左侧杏仁核 ',
'右侧海马','左侧海马','右侧海马旁回','左侧海马旁回','右侧舌回','左侧舌回',
'右侧cuneus','左侧cuneus','右侧angular gyrus','右侧中央后回']
allData.columns=['HC','SZ','BD','MDD']
|
dongmengshi/easylearn | eslearn/utils/lc_cal_headmotion.py | <reponame>dongmengshi/easylearn<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
extract mean Power mean FD
Combine all subjects' mean FD to one excel file
"""
import numpy as np
import pandas as pd
import os
import re
# class GetPath():
# """get all files path
# """
# def __init__(sel,
# root_path=r'I:\Data_Code\Doctor\RealignParameter',
# keyword='Van'):
# sel.root_path = root_path
# sel.keyword = keyword
# print("GetPath initiated!")
# def get_all_subj_path(sel):
# all_subj = os.listdir(sel.root_path)
# sel.all_subj_path = [os.path.join(
# sel.root_path, allsubj) for allsubj in all_subj]
# def get_all_file_path(sel):
# sel.all_file_name = [os.listdir(subj_path)
# for subj_path in sel.all_subj_path]
# def screen_file_path(sel):
# """only select Power PD
# """
# file_path = []
# for i, filename in enumerate(sel.all_file_name):
# selected_file = [name for name in filename if sel.keyword in name]
# if selected_file:
# selected_file = selected_file[0]
# file_path.append(os.path.join(
# sel.all_subj_path[i], selected_file))
# sel.all_file_path = file_path
# def run_getpath(sel):
# sel.get_all_subj_path()
# sel.get_all_file_path()
# sel.screen_file_path()
# class CalcMeanValue(GetPath):
# """
# calculate the mean value (such as mean FD or mean rotation of head motion) for each subject
# """
# def __init__(sel):
# super().__init__(sel)
# sel.root_path = r'I:\Data_Code\Doctor\RealignParameter'
# sel.keyword = 'Power'
# print("CalcMeanValue initiated!")
# def calc(sel):
# print("\ncalculating mean value...")
# sel.MeanValue = [np.loadtxt(file_path).mean(axis=0) # each column is one parameter
# for file_path in sel.all_file_path]
# print("\ncalculate mean value Done!")
# def run_calc(sel):
# sel.calc()
# class SaveMeanFDToEachSubjFolder(CalcMeanValue):
# def __init__(sel,
# savename=r'D:\WorkStation_2018\WorkStation_dynamicFC\Scales\mean6.xlsx'):
# super().__init__()
# sel.root_path = r'I:\Data_Code\Doctor\RealignParameter'
# sel.keyword = 'rp_'
# sel.savename = savename
# print("SaveMeanFDToEachSubjFolder initiated!")
# def _get_subjname(sel, reg='([1-9]\d*)', ith=0):
# # ith: when has multiple match, select which.
# path = [os.path.dirname(path) for path in sel.all_file_path]
# subjname = [os.path.basename(pth) for pth in path]
# if reg:
# if ith != None:
# sel.subjname = [re.findall(reg, name)[ith]
# for name in subjname]
# else:
# sel.subjname = [re.findall(reg, name) for name in subjname]
# def combine(sel):
# """combine mean FD and subjname into DataFrame
# """
# mfd = pd.DataFrame(sel.MeanValue)
# sjnm = pd.DataFrame(sel.subjname)
# sel.subjname_meanFD = pd.concat([sjnm, mfd], axis=1)
# sel.subjname_meanFD.columns = ['ID'] + \
# ['meanvalue' + (str(i + 1)) for i in range(np.shape(mfd)[1])]
# def save(sel):
# sel.subjname_meanFD.to_excel(sel.savename, index=False)
# def run_save(sel):
# sel._get_subjname()
# sel.combine()
# sel.save()
# if __name__ == "__main__":
# sel = SaveMeanFDToEachSubjFolder()
# sel.run_getpath()
# sel.run_calc()
# sel.run_save()
# print("\nAll Done!")
|
dongmengshi/easylearn | eslearn/machine_learning/test/test_@.py | <reponame>dongmengshi/easylearn<filename>eslearn/machine_learning/test/test_@.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 11 15:44:22 2018
@author: lenovo
"""
def funcA(A):
print("function A")
def funcB(B):
# print(B(2))
print("function B")
@funcB
def func(c):
print("function C")
return c**2 |
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_svc_rfe_cv_V2.py | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed self.decision 5 21:12:49 2018
1、对特征进行归一化、主成分降维(可选)后,喂入SVC中进行训练,然后用此model对测试集进行预测
2、采取K-fold的策略
input:
k=3:k-fold
step=0.1:rfe step
num_jobs=1: parallel
scale_method='StandardScaler':standardization method
pca_n_component=0.9
permutation=0
output:
各种分类效果等
@author: <NAME>
new: return to self
"""
# =============================================================================
import sys
import os
root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(root)
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_curve, roc_auc_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
import matplotlib.pyplot as plt
from Utils.lc_featureSelection_rfe import rfeCV
from Utils.lc_dimreduction import pca
import Utils.lc_scaler as scl
#==============================================================================
class SVCRefCv(object):
"""
利用递归特征消除的方法筛选特征,然后用SVR训练模型,后用cross-validation的方式来验证
"""
def __init__(self,
k=3,
seed=10,
step=0.1,
num_jobs=1,
scale_method='StandardScaler',
pca_n_component=1, # 默认不使用pca降维
permutation=0,
show_results=1,
show_roc=0):
"""initial parameters"""
self.k=k
self.seed=seed # 随机种子
self.step=step
self.num_jobs=num_jobs
self.scale_method=scale_method
self.pca_n_component = pca_n_component
self.permutation=permutation
self.show_results=show_results
self.show_roc=show_roc
print("SVCRefCv initiated")
def svc_rfe_cv(self,x,y):
"""Mian function"""
print('training model and testing using '+ str(self.k)+'-fold CV...\n')
index_train,index_test=self.fetch_kFold_Index_for_allLabel(x,y,self.k)
self.predict=pd.DataFrame([])
self.decision=pd.DataFrame([])
self.y_real_sorted=pd.DataFrame([])
self.weight_all=np.zeros([self.k,int((len(np.unique(y))*(len(np.unique(y))-1))/2),x.shape[1]])
y=np.reshape(y,[-1,])
for i in range(self.k):
"""split"""
X_train,y_train=x[index_train[i]],y[index_train[i]]
X_test,y_test=x[index_test[i]],y[index_test[i]]
self.y_real_sorted=pd.concat([self.y_real_sorted,pd.DataFrame(y_test)])
"""scale"""
X_train,X_test=self.scaler(X_train,X_test,self.scale_method)
"""pca"""
if 0<self.pca_n_component<1:
X_train,X_test,trained_pca=self.dimReduction(X_train,X_test,self.pca_n_component)
else:
pass
"""training"""
model,weight=self.training(X_train,y_train,\
step=self.step, cv=self.k,n_jobs=self.num_jobs,\
permutation=self.permutation)
"""fetch orignal weight"""
if 0 < self.pca_n_component< 1:
weight=trained_pca.inverse_transform(weight)
self.weight_all[i,:,:]=weight
"""test"""
prd,de=self.testing(model,X_test)
prd=pd.DataFrame(prd)
de=pd.DataFrame(de)
self.predict=pd.concat([self.predict,prd])
self.decision=pd.concat([self.decision,de])
print('{}/{}\n'.format(i+1,self.k))
"""print performances"""
if self.show_results:
self.eval_prformance(self.y_real_sorted.values,self.predict.values,self.decision.values)
return self
def splitData_kFold_oneLabel(self,x,y):
"""
random k-fold selection
"""
kf = KFold(n_splits=self.k,random_state=self.seed)
sklearn.cross_validation.StratifiedKFold(y, n_folds=self.k, random_state=self.seed)
return X_train, X_test,y_test
def fetch_kFold_Index_for_allLabel(self,x,y,k):
"""分别从每个label对应的数据中,进行kFole选择,
然后把某个fold的数据组合成一个大的fold数据"""
uni_y=np.unique(y)
loc_uni_y=[np.argwhere(y==uni) for uni in uni_y]
train_index,test_index=[],[]
for y_ in loc_uni_y:
tr_index,te_index=self.fetch_kFold_Index_for_oneLabel(y_,k)
train_index.append(tr_index)
test_index.append(te_index)
indexTr_fold=[]
indexTe_fold=[]
for k_ in range(k):
indTr_fold=np.array([])
indTe_fold=np.array([])
for y_ in range(len(uni_y)):
indTr_fold=np.append(indTr_fold,train_index[y_][k_])
indTe_fold=np.append(indTe_fold,test_index[y_][k_])
indexTr_fold.append(indTr_fold)
indexTe_fold.append(indTe_fold)
index_train,index_test=[],[]
for I in indexTr_fold:
index_train.append([int(i) for i in I ])
for I in indexTe_fold:
index_test.append([int(i) for i in I])
return index_train,index_test
def fetch_kFold_Index_for_oneLabel(self,originLable,k):
"""获得对某一个类的数据的kfold index"""
np.random.seed(self.seed)
kf=KFold(n_splits=k)
train_index,test_index=[],[]
for tr_index,te_index in kf.split(originLable):
train_index.append(originLable[tr_index]), \
test_index.append(originLable[te_index])
return train_index,test_index
def scaler(self,train_X,test_X,scale_method):
"""标准化"""
train_X,model=scl.scaler(train_X,scale_method)
test_X=model.transform(test_X)
return train_X,test_X
def dimReduction(self,train_X,test_X,pca_n_component):
"""降维,如pca"""
train_X,trained_pca=pca(train_X,pca_n_component)
test_X=trained_pca.transform(test_X)
return train_X,test_X,trained_pca
def training(self,x,y,\
step, cv,n_jobs,permutation):
"""训练模型"""
model,weight=rfeCV(x,y,step, cv,n_jobs,permutation)
return model,weight
def testing(self,model,test_X):
"""用模型预测"""
predict=model.predict(test_X)
decision=model.decision_function(test_X)
return predict,decision
def eval_prformance(self,y_real_sorted,predict,decision):
"""评估模型"""
# accurcay, self.specificity(recall of negative) and self.sensitivity(recall of positive)
self.accuracy= accuracy_score (y_real_sorted,predict)
report=classification_report(y_real_sorted,predict)
report=report.split('\n')
self.specificity=report[2].strip().split(' ')
self.sensitivity=report[3].strip().split(' ')
self.specificity=float([spe for spe in self.specificity if spe!=''][2])
self.sensitivity=float([sen for sen in self.sensitivity if sen!=''][2])
# self.confusion_matrix matrix
self.confusion_matrix=confusion_matrix(y_real_sorted,predict)
# roc and self.auc
if len(np.unique(y_real_sorted))==2:
fpr, tpr, thresh = roc_curve(y_real_sorted,decision)
self.auc=roc_auc_score(y_real_sorted,decision)
else:
self.auc=None
# print performances
print('\naccuracy={:.2f}\n'.format(self.accuracy))
print('sensitivity={:.2f}\n'.format(self.sensitivity))
print('specificity={:.2f}\n'.format(self.specificity))
if self.auc:
print('auc={:.2f}\n'.format(self.auc))
else:
print('多分类不能计算auc\n')
if self.show_roc and self.auc:
fig,ax=plt.subplots()
ax.plot(figsize=(5, 5))
ax.set_title('ROC Curve')
ax.set_xlabel('False Positive Rate')
ax.set_ylabel('True Positive Rate')
ax.grid(True)
ax.plot(fpr, tpr,'-')
"""设置坐标轴在axes正中心"""
ax.spines['top'].set_visible(False) #去掉上边框
ax.spines['right'].set_visible(False) #去掉右边框
# ax.spines['bottom'].set_position(('axes',0.5 ))
# ax.spines['left'].set_position(('axes', 0.5))
return self
if __name__=='__main__':
from sklearn import datasets
import lc_svc_rfe_cv_V2 as lsvc
x,y=datasets.make_classification(n_samples=200, n_classes=2,
n_informative=50,n_redundant=3,
n_features=100,random_state=1)
sel=lsvc.SVCRefCv(k=3)
results=sel.svc_rfe_cv(x,y)
results=results.__dict__
|
dongmengshi/easylearn | eslearn/utils/lc_move_all_subj_roi_to_root_roi_folder_radiomics.py | <reponame>dongmengshi/easylearn
# utf-8
"""
Move or copy roi folder that saving in each subject's folder to the same root folder named ROI$i
"""
import os
import numpy as np
import shutil
def move_roi_to_root_allsubj(root_subjfolder, outpath):
"""
Move roi to root folder for one subject
"""
all_subjpath = os.listdir(root_subjfolder)
all_subjpath = [os.path.join(root_subjfolder, allsub) for allsub in all_subjpath]
nsubj = len(all_subjpath)
for i, asp in enumerate(all_subjpath):
print(f'{i+1}/{nsubj}\n')
move_roi_to_root_onesubj(asp, outpath)
def move_roi_to_root_onesubj(subjpath, outpath):
"""
Move roi to root folder for one subject
"""
# read roi folder path
roiname = os.listdir(subjpath)
roipath = [os.path.join(subjpath, rn) for rn in roiname]
# which folder for saving roi
uni_roi = np.unique(roiname)
outsubpath = [os.path.join(outpath, ur) for ur in uni_roi]
# move subject's roi to root ROI folder
for rp, osp in zip(roipath, outsubpath):
filename = os.listdir(rp)
if len(filename)==0:
print(f'{rp} containing nothing!')
continue
elif len(filename) > 1:
print(f'{rp} containing multiple files!')
continue
else:
filename = filename[0]
# exe
if not os.path.exists(osp):
os.makedirs(osp)
inname = os.path.join(rp, filename)
outname = os.path.join(osp, filename)
# pass exist file
if os.path.exists(outname):
print(f'{outname} exist!')
else:
shutil.copy(inname,outname)
if __name__ == '__main__':
root_subjfolder = r'I:\Project_Lyph\Raw\Grouped_ROI_Nocontrast_v1'
outpath = r'I:\Project_Lyph\Raw\ROI_Nocontrast_splited_v1'
move_roi_to_root_allsubj(root_subjfolder, outpath) |
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_rfe_svc_given_trandtedata_excel.py | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 10 10:14:01 2019
@author: lenovo
"""
import sys
import os
cpwd = __file__
root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(root)
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from Utils.lc_read_nii import read_multiNii_LC
from Utils.lc_read_nii import read_sigleNii_LC
from Machine_learning.classfication.lc_svc_rfe_cv_V2 import SVCRefCv
class SvcForGivenTrAndTe(SVCRefCv):
"""
Training model on given training data_tr.
Then apply this mode to another testing data_te.
Last, evaluate the performance
If you encounter any problem, please contact <EMAIL>
"""
def __init__(self,
# =====================================================================
# all inputs are follows
tr_path=r'D:\folder\file.xlsx', # tranining dataset path
te_path=r'D:\folder\file.xlsx', # test dataset path
col_name_of_label="label", # column name of the label
col_num_of_data=np.arange(1, 7), # column number of features
inner_k=3 # k: the k-fold cross validation of the inner CV
# =====================================================================
):
super().__init__()
self.tr_path = tr_path
self.te_path = te_path
self.col_name_of_label = col_name_of_label
self.col_num_of_data = col_num_of_data
self.inner_k = inner_k
# Default parameters
self.pca_n_component = 1 # PCA
self.verbose = 1 # if print results
self.show_roc = 1 # if show roc
self.seed = 100
self.step = 1
print("SvcForGivenTrAndTe initiated")
def _load_data_inexcel(self):
"""load training data_tr/label_tr and validation data_tr"""
print("loading...")
data_tr, label_tr = self._load_data_inexcel_forone(
self.tr_path, self.col_name_of_label, self.col_num_of_data)
data_te, label_te = self._load_data_inexcel_forone(
self.te_path, self.col_name_of_label, self.col_num_of_data)
print("loaded!")
return data_tr, data_te, label_tr, label_te
def _load_data_inexcel_forone(self, path, col_name_of_label, col_num_of_data):
"""
Load training data_tr/label_tr and validation data_tr
"""
data = pd.read_excel(path)
data = data.dropna()
label = data[col_name_of_label].values
# hot encoder
le = LabelEncoder()
le.fit(label)
label = le.transform(label)
data = data.iloc[:, col_num_of_data].values
return data, label
def tr_te_ev(self, data_tr, label_tr, data_te):
"""
训练,测试,评估
"""
# scale
data_tr, data_te = self.scaler(
data_tr, data_te, self.scale_method)
# reduce dim
if 0 < self.pca_n_component < 1:
data_tr, data_te, trained_pca = self.dimReduction(
data_tr, data_te, self.pca_n_component)
else:
pass
# training
print("training...\nYou need to wait for a while")
model, weight = self.training(data_tr, label_tr,
step=self.step, cv=self.inner_k, n_jobs=self.num_jobs,
permutation=self.permutation)
# fetch orignal weight
if 0 < self.pca_n_component < 1:
weight = trained_pca.inverse_transform(weight)
self.weight_all = weight
decision, predict = self.testing(model, data_te)
return predict, decision
def eval(self, label_te, predict, decision):
"""
eval performances
"""
print('Testing...')
self.eval_prformance(label_te, predict, decision)
print('Testing done!')
return self
def main(self):
data_tr, data_te, label_tr, label_te = self._load_data_inexcel()
self.decision, self.predict = self.tr_te_ev(data_tr, label_tr, data_te)
self.eval(label_te, self.predict, self.decision)
return self
if __name__ == "__main__":
self = SvcForGivenTrAndTe(
tr_path=r'D:\workstation_b\宝宝\allResampleResult.csv', # 训练组病人
te_path=r'D:\workstation_b\宝宝\allResampleResult.csv', # 验证集数据
col_name_of_label="label", # label所在列的项目名字
col_num_of_data=np.arange(1, 7), # 特征所在列的序号(第哪几列)
inner_k=3)
results = self.main()
results = results.__dict__
print("Done!\n")
|
dongmengshi/easylearn | eslearn/visualization/lc_hotMap.py | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 17 17:35:09 2018
plot hot map
@author: <NAME>
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python')
import statsmodels.stats.multitest as mlt
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from Utils.lc_read_write_Mat import read_mat
##=====================================================================
# 生成数据
x=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\r_DTI.xlsx',header=None,index=None)
p=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\p_DTI.xlsx',header=None,index=None)
mask=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\p_DTI.xlsx',header=None,index=None)
mask = mask > 0.05
data=pd.read_excel(r'D:\workstation_b\彦鸽姐\20190927\DTI.xlsx')
netsize = np.shape(p)
#results = mlt.multipletests(np.reshape(p.values,np.size(p)), alpha=0.05, method='fdr_bh', is_sorted=False, returnsorted=False)
#mask=np.reshape(results[0],netsize)
#mask=mask==False
header=list(data.columns)
header=header[3:]
# plot
f, (ax) = plt.subplots(figsize=(20,20))
sns.heatmap(x,
ax=ax,
annot=True,
annot_kws={'size':9,'weight':'normal', 'color':'k'},fmt='.3f',
cmap='RdBu_r',
# center=0,
square=True,
linewidths = 0.005,
linecolor= 'k',
mask=mask,
vmin=-1,
vmax=1)
#ax.set_title('hot map')
ax.set_xlabel('')
ax.set_ylabel('')
ax.set_xticklabels(header)
ax.set_yticklabels(header)
# 设置选中,以及方位
label_x = ax.get_xticklabels()
label_y = ax.get_yticklabels()
#
plt.subplots_adjust(top = 1, bottom = 0.5, right = 1, left = 0.5, hspace = 0, wspace = 0)
#plt.margins(0,0)
plt.setp(label_x, rotation=90,horizontalalignment='right')
plt.setp(label_y, rotation=0,horizontalalignment='right')
plt.setp(label_x, fontsize=15)
plt.setp(label_y, fontsize=15)
plt.show()
#ax.imshow(x)
plt.savefig(r'D:\workstation_b\彦鸽姐\20190927\r_dti.tiff',
transparent=True, dpi=600, pad_inches = 0) |
dongmengshi/easylearn | eslearn/visualization/lc_radarplot_pychar.py | <filename>eslearn/visualization/lc_radarplot_pychar.py
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 20 09:59:28 2018
@author: lenovo
"""
from pyecharts import Polar,Radar
#radius =['周一', '周二', '周三', '周四', '周五', '周六', '周日']
#polar =Polar("极坐标系-堆叠柱状图示例", width=1200, height=600)
#polar.add("", [1, 2, 3, 4, 3, 5, 1], radius_data=radius, type='barAngle', is_stack=True)
#polar.add("", [2, 4, 6, 1, 2, 3, 1], radius_data=radius, type='barAngle', is_stack=True)
#polar.add("", [1, 2, 3, 4, 1, 2, 5], radius_data=radius, type='barAngle', is_stack=True)
#polar.show_config()
#polar.render()
value_bj =[ [55, 9, 56, 0.46, 18, 6, 1], [25, 11, 21, 0.65, 34, 9, 2], [56, 7, 63, 0.3, 14, 5, 3], [33, 7, 29, 0.33, 16, 6, 4]]
value_sh =[ [91, 45, 125, 0.82, 34, 23, 1], [65, 27, 78, 0.86, 45, 29, 2], [83, 60, 84, 1.09, 73, 27, 3], [109, 81, 121, 1.28, 68, 51, 4]]
c_schema=[{"name": "AQI", "max": 300, "min": 5}, {"name": "PM2.5", "max": 250, "min": 20}, {"name": "PM10", "max": 300, "min": 5}, {"name": "CO", "max": 5}, {"name": "NO2", "max": 200}, {"name": "SO2", "max": 100}]
radar =Radar()
radar.config(c_schema=c_schema, shape='circle')
radar.add("北京", value_bj, item_color="#f9713c", symbol=None)
radar.add("上海", value_sh, item_color="#b3e4a1", symbol=None)
radar.show_config()
radar.render()
from pyecharts import Radar
schema =[ ("销售", 6500), ("管理", 16000), ("信息技术", 30000), ("客服", 38000), ("研发", 52000), ("市场", 25000)]
v1 =[[4300, 10000, 28000, 35000, 50000, 19000]]
v2 =[[5000, 14000, 28000, 31000, 42000, 21000]]
radar =Radar()
radar.config(schema)
radar.add("预算分配", v1, label_color=["#4e79a6"],is_splitline=True, is_axisline_show=True)
radar.add("实际开销", v2, label_color=["r"], is_area_show=True)
radar.show_config()
radar.render() |
dongmengshi/easylearn | eslearn/utils/lc_download_fcp1000.py |
urllib.request.urlretrieve('https://fcp-indi.s3.amazonaws.com/data/Projects/FCON1000/AnnArbor_a/sourcedata/sub-04111/anat/sub-04111_T1w.nii.gz',
r'F:\Data\ASD\Outputs\cpac\nofilt_noglobal\reho\test1.tar')
import numpy as np
d = np.load(r'F:\Data\Caltech_0051456_rois_cc200.1D') |
dongmengshi/easylearn | eslearn/utils/lc_statForPermutationTest.py | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 1 09:29:20 2018
statistical analysis for permutation test
@author: lenovo
"""
from lc_selectFile_permSVC import selectFile
from lc_read_write_Mat import read_mat
import pandas as pd
#
def stat():
# statistic
pass
def resultFusion(rootPath=r'D:\myCodes\LC_MVPA\Python\MVPA_Python\perm',
datasetName=['predict', 'dec', 'y_sorted', 'weight']):
# Fusion of all block results of permutation test
fileName = selectFile(rootPath)
dataset = []
for dsname in datasetName:
Ds = []
for flname in fileName:
_, ds = read_mat(flname, dsname)
Ds.append(ds)
dataset.append(Ds)
all_metrics = pd.DataFrame(dataset)
all_metrics = all_metrics.rename(
index={
0: 'predict',
1: 'dec',
2: 'y_sorted',
3: 'weight'})
y_true = all_metrics.loc['y_sorted'][0]
y_pred = all_metrics.loc['predict'][0]
y_true = pd.DataFrame(y_true)
y_pred = pd.DataFrame(y_pred)
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
accuracy_score(y_true.T, y_pred.T)
confusion_matrix(y_true.T, y_pred.T)
pr[1]
return dataset
|
dongmengshi/easylearn | eslearn/machine_learning/test/cv_test.py | <reponame>dongmengshi/easylearn<filename>eslearn/machine_learning/test/cv_test.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 11:47:37 2020
@author: lenovo
"""
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn import datasets
from sklearn import svm
from sklearn import metrics
X, y = datasets.load_iris(return_X_y=True)
from sklearn.model_selection import cross_val_score
clf = svm.SVC(kernel='linear', C=1)
scores = cross_val_score(clf, X, y, cv=5, scoring='f1_macro')
scores
from sklearn.pipeline import Pipeline
from sklearn.feature_selection import SelectKBest
pipe = Pipeline([(''), ('select', SelectKBest()),('model', clf)])
param_grid = {'select__k': [1, 2],'model__base_estimator__max_depth': [2, 4, 6, 8]}
search = GridSearchCV(pipe, param_grid, cv=5).fit(X, y)
|
dongmengshi/easylearn | eslearn/visualization/lc_violinplot.py | <filename>eslearn/visualization/lc_violinplot.py
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 20 16:03:39 2018
小提琴图
当我们的数据是num_subj*num_var,且有几个诊断组时,我们一般希望把var name作为x,把var value作为y,把诊断组作为hue
来做小提琴图,以便于观察每个var的组间差异。
此时,用于sns的特殊性,我们要将数据变换未长列的形式。
行数目为:num_subj*num_var。列数目=3,分别是hue,x以及y
input:
data_path=r'D:\others\彦鸽姐\final_data.xlsx'
x_location=np.arange(5,13,1)#筛选数据的列位置
未来改进:封装为类,增加可移植性
@author: lenovo
"""
#==========================================================
# 载入绘图模块
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
#==========================================================
class ViolinPlot():
# initial parameters
def __init__(sel,
data_path=r'D:\others\彦鸽姐\final_data.xlsx',
x_location=np.arange(5,13,1),
x_name='脑区',
y_name='reho',
hue_name='分组',
hue_order=[2,1],
if_save_figure=0,
figure_name='violin.tiff'):
#======================================
sel.data_path=data_path
sel.x_location=x_location
sel.x_name=x_name
sel.y_name=y_name
sel.hue_name=hue_name
sel.hue_order=hue_order
sel.if_save_figure=if_save_figure
sel.figure_name=figure_name
#====================================================
def data_preparation(sel):
# load data
df = pd.read_excel(sel.data_path,index=False)
# 筛选数据
df_selected=df.iloc[:,sel.x_location]
#把需要呈现的数据concat到一列
n_subj,n_col=df_selected.shape
df_decreased_long=pd.DataFrame([])
for nc in range(n_col):
df_decreased_long=pd.concat([df_decreased_long,df_selected.iloc[:,nc]])
# 整理columns
col_name=list(df_selected.columns)
col_name_long=[pd.DataFrame([name]*n_subj) for name in col_name]
col_name_long=pd.concat(col_name_long)
#整理分组标签
group=pd.DataFrame([])
for i in range(n_col):
group=pd.concat([group,df[sel.hue_name]])
#整合
sel.data=pd.concat([group,col_name_long,df_decreased_long],axis=1)
# 加列名
sel.data.columns=[sel.hue_name, sel.x_name, sel.y_name]
return sel
def plot(sel):
sel.data=sel.data_preparation().data
# plot
plt.plot(figsize=(5, 15))
# 小提琴框架
ax=sns.violinplot(x=sel.x_name, y=sel.y_name,hue=sel.hue_name,
data=sel.data,palette="Set2",
split=False,scale_hue=True,hue_order=sel.hue_order,
orient="v",inner="box")
#
# 设置label,以及方位
label_x = ax.get_xticklabels()
label_y = ax.get_yticklabels()
plt.setp(label_x, size=10,rotation=0, horizontalalignment='right')
plt.setp(label_y, size=10,rotation=0, horizontalalignment='right')
# save figure
if sel.if_save_figure:
f.savefig(sel.figure_name, dpi=300, bbox_inches='tight')
# plt.hold
# #加点/风格1
# sns.swarmplot(x=sel.x_name, y=sel.y_name,hue=sel.hue_name,data=sel.data,
# color="w", alpha=.5,palette="Set1")
##
#加点/风格2
# sns.stripplot(x=sel.x_name, y=sel.y_name,hue=sel.hue_name,data=sel.data,
# color="w", alpha=.5,palette="Set1", jitter=False)
# plt.show()
return sel
if __name__ == '__main__':
sel = ViolinPlot(data_path=r'D:\WorkStation_2018\WorkStation_dynamicFC_V3\Data\results_cluster\results_of_individual\temploral_properties.xlsx',
x_location=np.arange(1, 2, 1),
hue_name='group',
hue_order=None)
df =sel.data_preparation()
sel.plot()
|
dongmengshi/easylearn | eslearn/utils/__init__.py | # print("imported utils\n") |
dongmengshi/easylearn | eslearn/machine_learning/classfication/lc_pca_svc_pooling_3groups.py | <reponame>dongmengshi/easylearn<filename>eslearn/machine_learning/classfication/lc_pca_svc_pooling_3groups.py
# -*- coding: utf-8 -*-
"""
Created on 2019/11/20
All datasets were concatenate into one single dataset, then using cross-validation strategy.
This script is used to training a linear svc model using a given training dataset, and validation this model using validation dataset.
Finally, we test the model using test dataset.
Dimension reduction: PCA
@author: <NAME>
"""
import sys
sys.path.append(r'D:\My_Codes\LC_Machine_Learning\lc_rsfmri_tools\lc_rsfmri_tools_python')
import numpy as np
import pandas as pd
from sklearn import svm
from sklearn.model_selection import KFold
from sklearn import preprocessing
from sklearn.metrics import mean_squared_error
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_curve, roc_auc_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
from scipy import stats
from statsmodels.formula.api import ols
from statsmodels.stats.anova import anova_lm
import Utils.lc_niiProcessor as niiproc
import Utils.lc_dimreduction as dimreduction
from Utils.lc_evaluation import eval_performance
# =============================================================================
BD_path = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_patient\Weighted'
MDD_path = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_control\Weighted'
HC_path = r'D:\WorkStation_2018\Workstation_Old\WorkStation_2018-05_MVPA_insomnia_FCS\Degree\degree_gray_matter\Zdegree\Z_degree_control\Weighted'
# =============================================================================
class PCASVCPooling():
def __init__(sel,
dataset1_path = BD_path,
dataset2_path = MDD_path,
dataset3_path = HC_path,
is_dim_reduction=0,
components=0.80,
numofcv=3,
show_results=1,
show_roc=1):
sel.dataset1_path = dataset1_path
sel.dataset2_path = dataset2_path
sel.dataset3_path = dataset3_path
sel.is_dim_reduction = is_dim_reduction
sel.components = components
sel.numofcv = numofcv
sel.show_results = show_results
sel.show_roc = show_roc
def main_function(sel):
"""
The training data, validation data and test data are randomly splited
"""
print('training model and testing...\n')
# load data
dataset1 = sel.loadnii(sel.dataset1_path, '.nii')
dataset2 = sel.loadnii(sel.dataset2_path, '.nii')
dataset3 = sel.loadnii(sel.dataset3_path, '.nii')
data_all = np.vstack([dataset1,dataset2,dataset3])
label_all = np.hstack([np.ones([len(dataset1),])-1,np.ones([len(dataset2),]),np.ones([len(dataset2),])+1])
# KFold Cross Validation
label_test_all = np.array([], dtype=np.int16)
train_index = np.array([], dtype=np.int16)
test_index = np.array([], dtype=np.int16)
sel.decision = np.array([], dtype=np.int16)
sel.prediction = np.array([], dtype=np.int16)
sel.accuracy = np.array([], dtype=np.float16)
sel.sensitivity = np.array([], dtype=np.float16)
sel.specificity = np.array([], dtype=np.float16)
sel.AUC = np.array([], dtype=np.float16)
kf = KFold(n_splits=sel.numofcv, shuffle=True, random_state=0)
for i, (tr_ind, te_ind) in enumerate(kf.split(data_all)):
print(f'------{i+1}/{sel.numofcv}...------\n')
train_index = np.int16(np.append(train_index, tr_ind))
test_index = np.int16(np.append(test_index, te_ind))
feature_train = data_all[tr_ind, :]
label_train = label_all[tr_ind]
feature_test = data_all[te_ind, :]
label_test = label_all[te_ind]
label_test_all = np.int16(np.append(label_test_all, label_test))
# resampling training data
feature_train, label_train = sel.re_sampling(
feature_train, label_train)
# normalization
feature_train = sel.normalization(feature_train)
feature_test = sel.normalization(feature_test)
# dimension reduction using univariate feature selection
feature_train, feature_test, mask_selected = sel.dimReduction_filter(
feature_train, label_train, feature_test, 0.01)
# dimension reduction
if sel.is_dim_reduction:
feature_train, feature_test, model_dim_reduction = sel.dimReduction(
feature_train, feature_test, sel.components)
print(f'After dimension reduction, the feature number is {feature_train.shape[1]}')
else:
print('No dimension reduction perfromed\n')
# train and test
print('training and testing...\n')
model = sel.training(feature_train, label_train)
if sel.is_dim_reduction:
sel.coef = model_dim_reduction.inverse_transform(model.coef_)
else:
sel.coef = model.coef_
pred, dec = sel.testing(model, feature_test)
sel.prediction = np.append(sel.prediction, np.array(pred))
sel.decision = np.append(sel.decision, np.array(dec))
# Evaluating classification performances
acc, sens, spec, auc = eval_performance(label_test, pred, dec, sel.show_roc)
sel.accuracy = np.append(sel.accuracy, acc)
sel.sensitivity = np.append(sel.sensitivity, sens)
sel.specificity = np.append(sel.specificity, spec)
sel.AUC = np.append(sel.AUC, auc)
print(f'performances = {acc, sens, spec,auc}')
print('Done!')
return sel
def loadnii(sel, data_path, suffix):
niip = niiproc.NiiProcessor()
data, _ = niip.main(data_path, suffix)
data = np.squeeze(np.array([np.array(data).reshape(1, -1) for data in data]))
return data
def re_sampling(sel, feature, label):
"""
Used to over-sampling unbalanced data
"""
from imblearn.over_sampling import RandomOverSampler
ros = RandomOverSampler(random_state=0)
feature_resampled, label_resampled = ros.fit_resample(feature, label)
from collections import Counter
print(sorted(Counter(label_resampled).items()))
return feature_resampled, label_resampled
def normalization(sel, data):
'''
Because of our normalization level is on subject,
we should transpose the data matrix on python(but not on matlab)
'''
scaler = preprocessing.StandardScaler().fit(data.T)
z_data = scaler.transform(data.T) .T
return z_data
def dimReduction_filter(sel, feature_train, label_train, feature_test, p_thrd = 0.05):
"""
This function is used to Univariate Feature Selection:: ANOVA
"""
from sklearn.feature_selection import f_classif
f, p = f_classif(feature_train, label_train)
mask_selected = p < p_thrd
feature_train = feature_train[:,mask_selected]
feature_test = feature_test[:, mask_selected]
return feature_train, feature_test, mask_selected
def dimReduction(self, train_X, test_X, pca_n_component):
F_statistic, pVal = stats.f_oneway(group1, group2, group3)
train_X, trained_pca = dimreduction.pca(train_X, pca_n_component)
test_X = trained_pca.transform(test_X)
return train_X, test_X, trained_pca
def training(sel, train_X, train_y):
# svm GrigCV
svc = svm.SVC(kernel='linear', C=1, class_weight='balanced', max_iter=5000, random_state=0)
svc.fit(train_X, train_y)
return svc
def testing(sel, model, test_X):
predict = model.predict(test_X)
decision = model.decision_function(test_X)
return predict, decision
#
if __name__ == '__main__':
sel = PCASVCPooling()
results = sel.main_function()
results = results.__dict__
print(np.mean(results['accuracy']))
print(np.std(results['accuracy']))
print(np.mean(results['sensitivity']))
print(np.std(results['sensitivity']))
print(np.mean(results['specificity']))
print(np.std(results['specificity']))
|
dongmengshi/easylearn | eslearn/GUI/thread_test_1.py | import sys,time
from PyQt5.QtWidgets import QWidget,QPushButton,QApplication,QListWidget,QGridLayout
class WinForm(QWidget):
def __init__(self,parent=None):
super(WinForm, self).__init__(parent)
#设置标题与布局方式
self.setWindowTitle('实时刷新界面的例子')
layout=QGridLayout()
#实例化列表控件与按钮控件
self.listFile=QListWidget()
self.btnStart=QPushButton('开始')
#添加到布局中指定位置
layout.addWidget(self.listFile,0,0,1,2)
layout.addWidget(self.btnStart,1,1)
#按钮的点击信号触发自定义的函数
self.btnStart.clicked.connect(self.slotAdd)
self.setLayout(layout)
def slotAdd(self):
for n in range(10):
#获取条目文本
str_n='File index{0}'.format(n)
#添加文本到列表控件中
self.listFile.addItem(str_n)
#实时刷新界面
QApplication.processEvents()
#睡眠一秒
time.sleep(0.3)
if __name__ == '__main__':
app=QApplication(sys.argv)
win=WinForm()
win.show()
sys.exit(app.exec_())
|
dongmengshi/easylearn | eslearn/utils/regression/lc_calc_explained_variance_sCCA.py | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 20:31:13 2018
revised the rcca
this code is used to evaluate the sCCA model
@author: lenovo
"""
# search path append
import sys
sys.path.append(r'D:\Github_Related\Github_Code\sCCA_Python\pyrcca-master')
from rcca import predict
import numpy as np
def lc_compute_ev(vdata,ws,verbose=1,cutoff=1e-15):
# vdata is the validation datesets. ws is the weights
# derived from train datesets
# So, this function is used to validate the sCCA model
nD = len(vdata)
# nT = vdata[0].shape[0]
nC = ws[0].shape[1]
nF = [d.shape[1] for d in vdata]
ev = [np.zeros((nC, f)) for f in nF]
for cc in range(nC):
ccs = cc+1
if verbose:
print('Computing explained variance for component #%d' % ccs)
preds, corrs= predict(vdata, [w[:, ccs-1:ccs] for w in ws],
cutoff)
resids = [abs(d[0]-d[1]) for d in zip(vdata, preds)]
for s in range(nD):
ev_ = abs(vdata[s].var(0) - resids[s].var(0))/vdata[s].var(0)
ev_[np.isnan(ev_)] = 0.
ev[s][cc,:] = ev_
return ev |
dongmengshi/easylearn | eslearn/utils/test.py | <reponame>dongmengshi/easylearn<filename>eslearn/utils/test.py
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 28 15:07:49 2018
@author: lenovo
"""
from lc_svc_oneVsRest import oneVsRest
import numpy as np
import pandas as pd
from lc_read_write_Mat import read_mat
import sys
sys.path.append(r'D:\myCodes\LC_MVPA\Python\MVPA_Python\utils')
sys.path.append(r'D:\myCodes\LC_MVPA\Python\MVPA_Python\classfication')
# X
fileName = r'J:\分类测试_20180828\Ne-L_VS_Ne-R_n=709'
dataset_name = 'coef'
dataset_struct, dataset = read_mat(fileName, dataset_name)
X = dataset
X = pd.DataFrame(X)
# y
s = pd.read_excel(r'J:\分类测试_20180828\机器学习-ID.xlsx')
dgns = s['诊断'].values
# comb
xandy = pd.concat([pd.DataFrame(dgns), X], axis=1)
# NaN
xandy = xandy.dropna()
#
X = xandy.iloc[:, 1:].values
y = xandy.iloc[:, 0].values
X = np.reshape(X, [len(X), X.shape[1]])
y = [int(d) for d in y]
# predict and test
comp = [prd - y][0]
Acc = np.sum(comp == 0) / len(comp)
|
striderdu/xmind2csv | xmind2csv.py | from xmindparser import xmind_to_dict
import uuid
import csv
# dfs function
def s(a, parent):
for i in a:
for key in i:
if isinstance(i[key], str):
data = [i[key], uuid.uuid3(uuid.NAMESPACE_DNS, i[key]), uuid.uuid3(uuid.NAMESPACE_DNS, parent), CLASSIFYING_SYSTEM, \
ISVALID, ISEDIT, REVISER, TECH_FIELD, '']
writer.writerow(data)
else:
s(i[key], i['title'])
# xmind to dict
xmind_dict = xmind_to_dict('集成电路技术.xmind')
main_dict = xmind_dict[0]['topic']
# config
HEADERS = ['name','number','parent_number','classifying_system','isValid','isEdit','reviser','tech_field','synonym']
CLASSIFYING_SYSTEM = '自定义分类技术体系'
ISVALID = 1
ISEDIT = 0
REVISER = 'root'
TECH_FIELD = main_dict['title']
with open('集成电路技术.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(HEADERS)
data = [main_dict['title'], uuid.uuid3(uuid.NAMESPACE_DNS, main_dict['title']), '', CLASSIFYING_SYSTEM, ISVALID, ISEDIT, REVISER, TECH_FIELD, '']
writer.writerow(data)
s(main_dict['topics'], main_dict['title'])
|
MertYagmur/fun-python-projects | wordle.py | <reponame>MertYagmur/fun-python-projects<filename>wordle.py
"""
NOT COMPLETE
There's a bug that's yet to be solved.
More functionality will be added.
The program doesn't check whether user guesses are actual English words or not unlike the original game.
"""
# Try debug with word "wipes" and try "sinus"
from random_word import RandomWords
def get_random_word():
r = RandomWords()
word = r.get_random_word(includePartOfSpeech="noun",
minCorpusCount = 100,
minLength = 5,
maxLength = 5)
if (word is None) or (any(letter.isupper() for letter in word)) or (not word.isalpha()):
return get_random_word()
return word
def compare(user_guess, word):
comparison = {}
for letter in user_guess:
comparison[letter] = []
counter = 0
for letter_guess, letter_word in zip(user_guess, word):
if letter_guess == letter_word:
comparison[letter_guess].append("Full match")
word[counter] = 0
elif letter_guess in list(word):
comparison[letter_guess].append("Half match")
word[counter] = 0
else:
comparison[letter_guess].append("No match")
counter += 1
visualize(comparison)
return comparison
def win(comparison):
for item in comparison:
for element in item:
if (element != "Full match"):
return False
return True
def make_guess(word):
user_guess = input("Make a guess: ")
while (len(user_guess) != 5):
print("Only 5-letter words are accepted. Try again.")
user_guess = input("Make a guess: ")
comparison = (compare(user_guess, list(word))).values()
return comparison
def visualize(comparison):
letter_cells = ""
comparison_cells = ""
print(" ___ ___ ___ ___ ___")
print(" | | | | | | | | | |")
for letter in comparison:
for letter_comparison in comparison[letter]:
letter_cells += f" | {letter.upper()} | "
if (letter_comparison == "Full match"):
comparison_cells += " |_✔_| "
elif (letter_comparison == "Half match"):
comparison_cells += " |_✸_| "
else:
comparison_cells += " |_✘_| "
print(letter_cells)
print(comparison_cells)
def main():
word = get_random_word()
#print(word.upper())
tries = 0
while True:
if (win(make_guess(word))):
print("You won!")
break
tries += 1
if (tries == 6):
print("You lost")
print(f"It was '{word}'")
break
if (__name__ == "__main__"):
main()
|
MertYagmur/fun-python-projects | band_name_generator.py | from random import random
import wikipedia as wiki
random_article = wiki.random(pages=1)
# If it starts with a year, draw another article
if random_article[0:3].isnumeric():
random_article = wiki.random(pages=1)
# If it's a list, remove "List of"
if (random_article.startswith("List of")):
random_article = random_article.replace("List of", "").strip()
# This is to eliminate location names
comma_index = random_article.find(",")
if (comma_index != -1):
random_article = random_article[:comma_index]
# What band name has something in parantheses?
paranthesis_index = random_article.find("(")
if (paranthesis_index != -1):
random_article = random_article[:paranthesis_index]
print(random_article.title())
"""
Stuff to add:
- Human name detection
- Eliminate long names
""" |
linuxluser/ugtd | ugtd.py | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
"""ncurses Python application for "Getting Things Done".
[Methodology - Getting Things Done]
[Method - Todo.txt]
Todo.txt is a text data format designed to store personal task data. It follows
philosophies of simplicity, portability and functionality.
More details here:
http://todotxt.com/
Todo.txt is intending to follow the GTD methodology. It does do this but it
also, by necessity, imposes a specifc approach to the GTD methodology. This is
why I see it as a "method" more than just a format.
The creators do a fairly good job of explaining this method here:
https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format
Salient point about this method are:
- Meta-data about tasks only includes dates, completion, priority, projects and
contexts.
- There is no nesting of priority, projects or contexts. Your tasks are "flat".
- Dates to do not include time.
- Priorities are letters only, not numbers.
- All meta data can be written right into your task description.
[TaskWarrior - What It Got Wrong]
TaskWarrior is a command-line tool for implementing personal task management and
is probably the most popular one. TaskWarrior has good documentation and can be
used to facilitate a GTD methodology. It has a proven track-record of being very
useful and facilating productivity among those of us who still use the terminal.
Besides inventing it's own serialization format (they could have just use JSON,
no?), I found a few things frustrating about it to the point where I stopped
using it altogether. I thought and though about my experience with TaskWarrior
and the many other task management apps I tried out. I really wanted something
that I could use on a powerful UNIX shell but something about TaskWarrior just
didn't make it work right for me. Then I realized what it was: context.
No, not "context" in the todo.txt sense (mentioned above). Context, as in, what
is happening in my head as I work through my task list. It's the thing that GUI
applications have that terminal applications can't have. With a GUI app, I can
instantly and visually see all of my tasks. I can then pluck out ones I need to
change (mark "done"!) and move on. All the GUI apps focussed on the right
thing: presenting the tasks and allowing me to take my sweet time to decide what
to do. TaskWarrior could not do this. It presented the data, then would exit.
Once I figured out what to do, I told TaskWarrior through lots of typing and
then it happened. But I sacrificed context. I had to reprint the list again to
decide on the next thing to do.
By the time I had done my morning routine, my fingers were tired and I had a
feeling of not quite remembering what changes I had done. The problem was that
I could perform an action or get context (print tasks) but not both. Every time
I got context, I had to lose it to do something and then go back and get it
again.
Another problem was all the typing. If you look at your command history, you'll
see a lot of the same patterns over and over again with very few things changed.
This is an indicator that the user is being asked to do a lot of overhead to do
something simple.
"But that's what you do on a terminal!" Yes, but not if you have to do the same
thing over and over again. The terminal is a user interface and every terminal
application needs to strive to be as user-friendly as possible. If you're
making a website or a GUI app, you focus on how users go through the app and
use the essential functions of it. You care and you modify the design to appeal
to more users and make things easy without sacrificing functionality. Why should
a terminal application not do the same?
So TaskWarrior sucks at presenting a persistent context from which I can make
multiple decisions on. And TaskWarrior makes me type a lot of stuff for it.
Those two things made it a very user-unfriendly application for me. As a result,
I had to stop using it, no matter how many features it had.
[Application - Task Menu]
Like any good programmer (is that what I am?) I decided to write something that
took a different approach, in hopes that it would be useful to me and possibly
others.
Task Menu, is a curses-based application. This gives it the contextual power of
the GUI apps but the portability and leaness of a terminal app. It's the best
of both worlds!
Task Menu also applies a limited set of "views" you can have on your tasks. It
removed the ability for you, the user, to add new views or customize in that
way. This is another deviation from TaskWarrior which boasts customization.
I believe that by making the app ncurses-based and by having pre-defined views,
you, the user, can use your brain for what it's supposed to be used for: task
management.
There are generally 2 "modes" that your brain is in right before you fire up
your personal task management system: 1) you don't remember what needed to be
done and you need to see it OR 2) you have something very specific in mind that
you need to do and just want to do it.
For scenario #1, you need a way to see lots of tasks at once and scroll through
them if needed. curses works for this.
For scenario #2, you need to type as little as possible to tell the application
what to do. curses again words great because your enviornment (your context) is
already there, so all you need to do is hit a single key and something can
happen ("done"!).
[So why the limited number of views?]
Given the Todo.txt method, with it's "3 axis" of tasks, it turns out that we can
pivot off of those axis in 6 possible ways (3 factorial, for you math nerds).
They are:
- By Priority then Project
- By Priority then Context
- By Project then Priority
- By Project then Context
- By Context then Priority
- By Context then Project
You pivot off of one of then first, that leaves only 2 more "axis" to pivot
from. So you pivot off of the second one, and that leaves you with the last
remaining "axis" automatically. From those two pivot points, the application
can know everything it needs to present to you a filtered view of the tasks
that match that criteria.
And THAT is how Task Menu works. Since each tasks contains all its meta-data
already, all you need to see is the task itself. Thus, the only possible
variations you could have come from the "axis" themselves.
I don't know if Todo.txt intended this as a consequence. But the data itself
makes this possible.
"""
import collections
import datetime
import inspect
import itertools
import os
import string
import sys
import time
import urwid
#TODO_TEXT_FILE = os.path.join(os.path.expanduser('~'), '.todo.txt')
TODO_TEXT_FILE = os.path.join(os.path.expanduser('~'), 'todo.test.txt')
DIMENSIONS = ('projects', 'contexts', 'priority')
# LABEL - CATEGORY - GROUPING
VIEWS = ((u'[Pri/Ctx]', 'priority', 'contexts'),
(u'[Prj/Ctx]', 'projects', 'contexts'),
(u'[Prj/Pri]', 'projects', 'priority'),
(u'[Ctx/Prj]', 'contexts', 'projects'),
(u'[Ctx/Pri]', 'contexts', 'priority'),
(u'[Pri/Prj]', 'priority', 'projects'))
class Border(urwid.LineBox):
"""Draws a border around the widget with optional title.
Same as urwid.LineBox but the title is a little fancier and it's aligned left.
"""
def __init__(self, *args, **kwargs):
super(Border, self).__init__(*args, **kwargs)
# Remove the first line in the title to force the title to align left
if len(self.tline_widget.contents) == 3:
self.tline_widget.contents.pop(0)
def format_title(self, text):
if not text:
return ''
return u'┤ %s ├' % text
class Task(urwid.WidgetPlaceholder):
def __init__(self, S, todotxtfile):
self._todotxtfile = todotxtfile
self.UpdateFromString(S)
super(Task, self).__init__(self.text_widget_attrmap)
def __str__(self):
return self.text
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, self.text)
def selectable(self):
return True
def keypress(self, size, key):
return key
def _BuildTextWidget(self):
if self.completed:
icon = 'x'
elif self.creation_date and (datetime.date.today() - self.creation_date).days > 21:
icon = '!'
else:
icon = ' '
self.text_widget = urwid.Text([('prefix', ' '),
'[%s]' % icon,
' ',
self.text])
self.text_widget_attrmap = urwid.AttrMap(self.text_widget,
{'prefix': 'prefix:normal', None: 'normal'},
{'prefix': 'prefix:selected', None: 'selected'})
return self.text_widget_attrmap
def _Parse(self, line):
"""Parse a single-line string S as a task in the todo.txt format.
See: https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format
"""
line_stripped = line.strip()
# Completed
if line_stripped.startswith('x '):
completed = True
line_stripped = line_stripped[2:]
else:
completed = False
# Convenience string splitting function without the traceback mess
def head_tail(s, split_on=None):
if s:
try:
h,t = s.split(split_on, 1)
except ValueError:
h = s
t = ''
return h,t
else:
return '', ''
# Completion date
completion_date = None
if completed:
word, tail = head_tail(line_stripped)
try:
time_struct = time.strptime(word, '%Y-%m-%d')
except ValueError:
pass
else:
completion_date = datetime.date(*time_struct[:3])
line_stripped = tail
# Priority
if line_stripped.startswith('('):
end_pri = line_stripped.find(') ')
if end_pri != -1:
pri = line_stripped[1:end_pri].strip()
if len(pri) == 1 and pri in string.uppercase:
priority = pri
else:
priority = None
line_stripped = line_stripped[end_pri+1:].strip()
else:
priority = None
else:
priority = None
# Creation date
creation_date = None
word, tail = head_tail(line_stripped)
try:
time_struct = time.strptime(word, '%Y-%m-%d')
except ValueError:
pass
else:
creation_date = datetime.date(*time_struct[:3])
line_stripped = tail
# Body - main part of text after priority/dates but with contexts/projects in-tact
body = line_stripped
# Contexts and projects
contexts = []
projects = []
for word in line_stripped.split():
if word.startswith('+'):
prj = word[1:]
if prj:
projects.append(prj)
elif word.startswith('@'):
ctx = word[1:]
if ctx:
contexts.append(ctx)
return {'text': line,
'body': body,
'priority': priority,
'creation_date': creation_date,
'completion_date': completion_date,
'completed': completed,
'contexts': contexts,
'projects': projects,
}
def UpdateFromString(self, S):
"""Update this Task instance with a new task string S."""
# In cases of empty string we assign empty results
if not S:
self.text = ''
self.completed = False
self.completion_date = None
self.creation_date = None
self.priority = None
self.body = ''
self.projects = []
self.contexts = []
else:
# Skim off the top line if given a multi-line string
self.text = S.splitlines()[0]
# Parse
values = self._Parse(self.text)
# Assign attributes
self.completed = values['completed']
self.completion_date = values['completion_date']
self.creation_date = values['creation_date']
self.priority = values['priority']
self.body = values['body']
self.projects = values['projects']
self.contexts = values['contexts']
# Update the widget
self.original_widget = self._BuildTextWidget()
class Keyword(urwid.WidgetPlaceholder):
def __init__(self, S):
self.text_widget = urwid.Text(S)
widget = urwid.AttrMap(self.text_widget, 'normal', 'selected')
super(Keyword, self).__init__(widget)
@property
def text(self):
return self.text_widget.text
def selectable(self):
return True
def keypress(self, size, key):
return key
class TaskEdit(urwid.Edit):
"""Custom Edit widget which provides convenient keypress mappings for editing."""
def __init__(self, task):
self.clipboard = ''
caption = task.text_widget.text[:6]
edit_text = task.text_widget.text[6:]
super(TaskEdit, self).__init__(('editbox:caption', caption), edit_text)
def keypress(self, size, key):
# Cut word left of cursor
if key in ('ctrl w', 'ctrl backspace'):
# Split at cursor, preserving character under it
text = self.edit_text
pos = self.edit_pos
left, right = text[:pos], text[pos:]
# Find the last word in 'left' and remove it
head_tail = left.rsplit(None, 1)
if not head_tail:
last_word_index = 0 # Nothing but whitespace, so save nothing
else:
if len(head_tail) == 1:
last_word = head_tail[0]
else:
last_word = head_tail[1]
last_word_index = left.rfind(last_word)
self.clipboard = left[last_word_index:]
left = left[:last_word_index]
# Set text and position
self.set_edit_text(left + right)
self.set_edit_pos(last_word_index)
# Cut all text left of cursor
elif key == 'ctrl u':
text = self.edit_text
pos = self.edit_pos
left, right = text[:pos], text[pos:]
self.set_edit_text(right)
self.set_edit_pos(0)
self.clipboard = left
# Cut all text right of the cursor
elif key == 'ctrl k':
text = self.edit_text
pos = self.edit_pos
left, right = text[:pos], text[pos:]
self.set_edit_text(left)
self.set_edit_pos(len(left))
self.clipboard = right
# Move position to the start of the line
elif key == 'ctrl a':
self.set_edit_pos(0)
# Move position to the end of the line
elif key == 'ctrl e':
self.set_edit_pos(len(self.edit_text))
# Move one position forward
elif key == 'ctrl f':
self.set_edit_pos(self.edit_pos + 1)
# Move one position backwards
elif key == 'ctrl b':
self.set_edit_pos(self.edit_pos - 1)
# Change priority
elif key in ('+', 'up', '-', 'down'):
text = self.edit_text
if not text.startswith('x '):
pos = self.edit_pos
pri = text[:4]
if pri[0] == '(' and pri[2] == ')' and pri[3] == ' ':
priority = pri[1].upper()
else:
priority = None
# Decrease priority
if key in ('+', 'up'):
if priority is None:
self.set_edit_text('(A) %s' % text)
self.set_edit_pos(pos + 4)
elif priority != 'Z':
priority = chr(ord(pri[1].upper()) + 1)
self.set_edit_text('(%s) %s' % (priority, text[4:]))
# Increase priority
if key in ('-', 'down'):
if priority:
if priority == 'A':
self.set_edit_text(text[4:])
self.set_edit_pos(pos - 4)
else:
priority = chr(ord(pri[1].upper()) - 1)
self.set_edit_text('(%s) %s' % (priority, text[4:]))
else:
return super(TaskEdit, self).keypress(size, key)
class VimNavigationListBox(urwid.ListBox):
"""ListBox that also accepts vim navigation keys."""
VIM_KEYS = {
'k' : 'up',
'j' : 'down',
'ctrl u': 'page up',
'ctrl b': 'page up',
'ctrl d': 'page down',
'ctrl f': 'page down',
'h' : 'left',
'l' : 'right',
}
def __init__(self, items, panel):
self.items = items
self._panel = panel
self.edit_mode = False
super(VimNavigationListBox, self).__init__(items)
def keypress(self, size, key):
if self.edit_mode:
# Ignore page up/down in edit mode
if key in ('page up', 'page down'):
return
# Vim navigation translation
else:
if self.VIM_KEYS.has_key(key):
key = self.VIM_KEYS[key]
return super(VimNavigationListBox, self).keypress(size, key)
class TaskPile(urwid.Pile):
"""An urwid.Pile that handles groups of Tasks and editing them."""
def __init__(self, tasks, group, tasklistbox):
self.group = group
self.tasks = tasks
self.tasklistbox = tasklistbox
self.items = [urwid.Text(group)]
self.items.extend(tasks)
self.items.append(urwid.Divider())
super(TaskPile, self).__init__(self.items)
# Start out in 'nav' mode
self._mode = 'nav'
def keypress(self, size, key):
###################
### NAV MODE
if self._mode == 'nav':
# Enter 'edit' mode
if key == 'enter' and isinstance(self.focus, Task):
self._preserved_task = self.focus
edit_widget = self._BuildEditWidget(self._preserved_task)
self.contents[self.focus_position] = (edit_widget, ('pack', None))
self._mode = 'edit'
self.tasklistbox.edit_mode = True
return super(TaskPile, self).keypress(size, key)
###################
### EDIT MODE
elif self._mode == 'edit':
# Exit edit mode
if key in ('enter', 'esc'):
# Submit changes if any
if key == 'enter':
edit_widget = self.focus.original_widget
if self._preserved_task.text != edit_widget.get_edit_text():
# Get before/after properties and update the task itself
old_properties = self._preserved_task.__dict__.copy()
self._preserved_task.UpdateFromString(edit_widget.get_edit_text())
new_properties = self._preserved_task.__dict__.copy()
# Start a chain reaction so all widgets can deal with the changes
self.tasklistbox.DoTaskChangeWork(old_properties, new_properties)
self.contents[self.focus_position] = (self._preserved_task, ('pack', None))
self._preserved_task = None
self.tasklistbox.edit_mode = False
self._mode = 'nav'
return
return super(TaskPile, self).keypress(size, key)
def _BuildEditWidget(self, task):
widget = TaskEdit(task)
widget = urwid.AttrMap(widget, 'editbox', 'editbox')
return widget
class TaskListBox(VimNavigationListBox):
"""
"""
def __init__(self, piles, taskpanel, category, keyword, grouping):
# 'items' -> 'tasks'
# new 'piles'
self.piles = piles
self.taskpanel = taskpanel
self.category = category
self.keyword = keyword
self.grouping = grouping
self._mode = 'nav'
super(TaskListBox, self).__init__(piles, taskpanel)
def _BuildEditWidget(self, task):
widget = TaskEdit(task)
widget = urwid.AttrMap(widget, 'editbox', 'editbox')
return widget
def DoTaskChangeWork(self, old_properties, new_properties):
########################
### Added task
if not old_properties:
groups_added_to = new_properties[self.grouping]
if not hasattr(groups_added_to, '__iter__'):
groups_added_to = [groups_added_to]
groups_removed_from = []
########################
### Deleted task
elif not new_properties:
groups_removed_from = old_properties[self.grouping]
if not hasattr(groups_removed_from, '__iter__'):
groups_removed_from = [groups_removed_from]
groups_added_to = []
########################
### Modified task
else:
old_group = old_properties[self.grouping]
new_group = new_properties[self.grouping]
if hasattr(old_group, '__iter__'):
groups_removed_from = set(old_group) - set(new_group)
groups_removed_from = sorted(groups_removed_from)
groups_added_to = set(new_group) - set(old_group)
groups_added_to = sorted(groups_added_to)
else:
if old_group != new_group:
groups_removed_from = [old_group]
groups_added_to = [new_group]
else:
groups_removed_from = []
groups_added_to = []
class KeywordPanel(urwid.WidgetPlaceholder):
"""Panel to hold the keywords and allow selection of tasks.
"""
def __init__(self, app, keywords_dict={}):
self.app = app
self._keywords_dict = keywords_dict
self._listboxes = {}
for cat,keywords in self._keywords_dict.items():
kw_widgets = [Keyword(k or u'--none--') for k in keywords]
listbox = VimNavigationListBox(kw_widgets, self)
self._keywords_dict[cat] = kw_widgets
self._listboxes[cat] = listbox
self._selected_category = self._keywords_dict.keys()[0]
self.padding_widget = urwid.Padding(urwid.SolidFill(u'x'), left=1, right=1)
self.border_widget = Border(self.padding_widget, 'Empty')
super(KeywordPanel, self).__init__(self.border_widget)
def render(self, size, focus=False):
"""Intercept render() in case it's because the selected keyword changed.
"""
self.app.startKeywordChange(self.GetSelectedKeyword(), None)
return super(KeywordPanel, self).render(size, focus)
def GetKeywords(self, category):
keywords = []
for w in self._listboxes[category].body.contents:
text = w.text_widget.text
if text == '--none--':
keywords.append(None)
else:
keywords.append(text)
return keywords
def GetSelectedKeyword(self):
"""Get the keyword that is selected and in the current view."""
text = self._listboxes[self._selected_category].focus.text
if text == '--none--':
return None
else:
return text
def doViewChange(self, new_view, old_view):
new_category,_ = new_view
if new_category in self._listboxes:
listbox = self._listboxes[new_category]
self.padding_widget.original_widget = listbox
self.border_widget.set_title(new_category.capitalize())
self._selected_category = new_category
def doKeywordChange(self, new_keyword, old_keyword):
return
class TaskPanel(urwid.WidgetPlaceholder):
def __init__(self, app, tasks):
self.app = app
self.tasks = tasks
self._listboxes = {}
# We only want to deal with tasks that are incomplete or recently completed
tasks = []
for task in self.tasks:
if task.completed:
if task.completion_date:
if (datetime.date.today() - task.completion_date).days < 2:
tasks.append(task)
else:
tasks.append(task)
# Build ListBoxes for every permutation of (category, keyword, grouping)
permutations = itertools.permutations(DIMENSIONS)
for category, grouping, sorting in permutations:
for keyword in self.app.keyword_panel.GetKeywords(category):
# Find matching Tasks
matching_tasks = []
for task in tasks:
that_keyword = getattr(task, category)
if hasattr(that_keyword, '__iter__') and keyword in that_keyword:
matching_tasks.append(task)
elif that_keyword == keyword:
matching_tasks.append(task)
# Group matching Tasks
groups = collections.defaultdict(list)
for task in matching_tasks:
group_value = getattr(task, grouping)
if hasattr(group_value, '__iter__'):
if len(group_value) == 0:
groups[None].append(task)
else:
[groups[g].append(task) for g in group_value]
else:
groups[group_value].append(task)
# Sort tasks in each group by 'sorting'
for group_tasks in groups.values():
group_tasks.sort(key=lambda t: getattr(t, sorting))
# Create a ListBox from groups
piles = []
for group in sorted(groups):
if group is None:
group_label = u'--none--'
else:
group_label = unicode(group)
pile = TaskPile(groups[group], group_label, None)
piles.append(pile)
# Add listbox to our set of ListBoxes
key = (category, keyword, grouping)
listbox = TaskListBox(piles, self, category, keyword, grouping)
self._listboxes[key] = listbox
# Ensure all piles have a reference to the listbox
for pile in piles:
pile.tasklistbox = listbox
# Create decorative widgets and initialize ourselves
self.padding_widget = urwid.Padding(urwid.SolidFill(u'x'), left=1, right=1)
self.border_widget = Border(self.padding_widget, 'Empty')
super(TaskPanel, self).__init__(self.border_widget)
self.category = ''
self.grouping = ''
self.sorting = ''
def _SetTitle(self):
title = 'Tasks by %s' % self.grouping.capitalize()
self.border_widget.set_title(title)
def DoTaskChangeWork(self, old_properties, new_properties):
########################
### Added task
if not old_properties:
return
########################
### Deleted task
elif not new_properties:
return
########################
### Modified task
else:
for listbox in self._listboxes.values():
listbox.DoTaskChangeWork(old_properties, new_properties)
def doViewChange(self, new_view, old_view):
category, grouping = new_view
keyword = self.app.keyword_panel.GetSelectedKeyword()
listbox = self._listboxes[(category, keyword, grouping)]
self.padding_widget.original_widget = listbox
# We sort by whatever is not the category or grouping dimension
sorting = set(DIMENSIONS).difference((category, grouping)).pop()
self.category = category
self.grouping = grouping
self.sorting = sorting
self._SetTitle()
def doKeywordChange(self, new_keyword, old_keyword):
listbox = self._listboxes[(self.category, new_keyword, self.grouping)]
self.padding_widget.original_widget = listbox
self._SetTitle()
class ViewPanel(Border):
"""Top panel with selectable 'views' on Task data.
The ViewPanel has a reference to the TaskPanel so that when the view is
changed, that event can be passed on to the TaskPanel to react to it.
"""
def __init__(self, app):
self.app = app
# Create urwid.Text widgets and save them in a mapping
text_widgets = {}
for label, category, grouping in VIEWS:
view = (category, grouping)
text_widgets[view] = urwid.Text(('normal', label))
self.text_widgets = text_widgets
# Place urwid.Text widgets in the UI
widget = urwid.Columns([(11, text_widgets[V[1:]]) for V in VIEWS])
widget = urwid.Padding(widget, left=1)
super(ViewPanel, self).__init__(widget)
# Select first view
# FIXME: this is already done in Application.__init__ no?
self.selected_view = VIEWS[1][1:]
self.doViewChange(VIEWS[0][1:], None)
def doViewChange(self, new_view, old_view):
"""Select a new view."""
if new_view == self.selected_view:
return
old_widget = self.text_widgets[self.selected_view]
new_widget = self.text_widgets[new_view]
old_widget.set_text(('normal', old_widget.text))
new_widget.set_text(('selected', new_widget.text))
self.selected_view = new_view
def doKeywordChange(self, new_keyword, old_keyword):
return
class TodoTxtFile(object):
"""Manages I/O for a todo.txt file.
"""
def __init__(self, filename):
self.filename = filename
self._lines = open(filename).read().splitlines()
self.tasks = []
# Create Tasks and insert them into our file representation, self._lines
# For empty lines or lines with only spaces, we ignore them. But for lines
# with content, we create a Task and keep that task's place in the file
# by puting it right back into our self._lines where we found it.
for i, line in enumerate(self._lines):
if line and not line.isspace():
task = Task(line, self)
self._lines[i] = task # replace text with a Task object
self.tasks.append(task)
def _RewriteFile(self):
"""Rewrite entire file, including any updated content.
"""
with open(self.filename, 'w') as f:
for line in self._lines:
f.write('%s\n' % line)
def RewriteTaskInFile(self, task, new_text):
self._RewriteFile()
def DeleteTaskFromFile(self, task):
index = self._lines.index(task)
self._lines.remove(task)
self._lines.insert(index, '')
self.tasks.remove(task)
self._RewriteFile()
def AppendTaskToFile(self, task):
with open(self.filename, 'a') as f:
f.write('%s\n' % task)
class Application(object):
"""Main application to handle run state and event propagation.
[Events]
Since this is quite a modest-sized program, I don't want to introduce a
message-passing framework or include a more robust/feature-rich one as a
dependency. However, the job still needs to get done for a few basic things
and the best way to handle that is for widgets "lower down" to tell the
application about the event and the application then alerts everyone else by
calling special functions. This is nothing fancy (nor should it be) and it is
not even async in any way. It's just dumb message passing.
Initially I did this by having widgets reference other widget if they needed
to communicate in any way. However, most widgets ended up needing a reference
to at least some other widget and I writing special code for each pair. This
got hard to keep up. So I went all the way up the chain and decided to start
over again with a fresh design pattern and some "standard" function calls. If
an event happens that something else needs to know about, it only tells the
application and the application can then run through and tell everybody else.
Those to whome it does not concern will ignore it. The others will do
something about it.
[Application Layout]
The application has a static top bar, the ViewPanel, from which a particular
view of the tasks can be chosen. Once a view is known, a set of keywords is
created in the KeywordPanel, which is always on the left of the screen. These
keywords determine what set of tasks get put in the TaskPanel. The TaskPanel
has a subset of the tasks, grouped by either their project, context or priority.
+----------------------------------------------+
| ViewPanel |
+---------+------------------------------------+
| | |
| | |
| Keyword | TaskPanel |
| Panel | |
| | |
| | |
| | |
+---------+------------------------------------+
"""
PALETTE = [('normal', '', ''),
('selected', '', 'dark blue'),
('prefix:normal', 'black', ''),
('prefix:selected', '', 'dark red'),
('editbox', 'light green,standout', ''),
('editbox:caption', '', 'dark red')]
def __init__(self, tasks):
# Create widgets
keywords = {'projects': sorted(set(p for t in tasks for p in t.projects)),
'contexts': sorted(set(c for t in tasks for c in t.contexts)),
'priority': sorted(set(t.priority for t in tasks))}
self.keyword_panel = KeywordPanel(self, keywords)
self.task_panel = TaskPanel(self, tasks)
self.view_panel = ViewPanel(self)
columns = urwid.Columns([(30, self.keyword_panel), self.task_panel], focus_column=0)
self.browser = urwid.Frame(columns, header=self.view_panel)
self.startViewChange(VIEWS[0][1:], None)
def _UnhandledInput(self, key):
# Exit program
if key == 'esc':
raise urwid.ExitMainLoop()
# Select view
elif key.isdigit():
index = int(key)
if index > 0 and index <= len(VIEWS):
new_view = VIEWS[index -1][1:]
old_view = self.view_panel.selected_view
self.startViewChange(new_view, old_view)
def Run(self):
self.main_loop = urwid.MainLoop(self.browser,
palette=Application.PALETTE,
unhandled_input=self._UnhandledInput)
self.main_loop.run()
def startViewChange(self, new_view, old_view):
"""Master doViewChange function which calls the others."""
self.view_panel.doViewChange(new_view, old_view)
self.keyword_panel.doViewChange(new_view, old_view)
self.task_panel.doViewChange(new_view, old_view)
def startKeywordChange(self, new_keyword, old_keyword):
"""Master doKeywordChange function which calls the others."""
self.view_panel.doKeywordChange(new_keyword, old_keyword)
self.keyword_panel.doKeywordChange(new_keyword, old_keyword)
self.task_panel.doKeywordChange(new_keyword, old_keyword)
def main():
if len(sys.argv) > 1:
filename = sys.argv[1]
else:
filename = TODO_TEXT_FILE
todotxtfile = TodoTxtFile(filename)
app = Application(todotxtfile.tasks)
app.Run()
if __name__ == '__main__':
main()
|
rishabhjainfinal/ASCII_video | video_to_ascii.py | from image_to_ascii import image_to_ascii
import cv2,os,numpy as np
import concurrent.futures
from threading import Thread
from time import perf_counter,sleep as nap
import argparse
# may add sound later .\
class ascii_video :
""" working of class
extract image and yield
convert into ascii image
save in the video
"""
ascii_range_dictCHARS = [
' ','.',
',',"'",
'"',':',
";",'-',
'*','~',
'+','=',
'?','/',
'|','#',
'%','₹',
'$','@']
def __init__(self,video,output_video,fps,pbs):
self.pbs = pbs
self.video_name = video
self.video_output_name = output_video
self.fps = fps
if not os.path.exists(self.video_name) : raise Exception("File not found!!!")
self.ascii_range_dictCHARS.reverse()
self.pixle_to_ascii_dict = {}
for index,key in enumerate(np.linspace(0,255,num=len(self.ascii_range_dictCHARS),endpoint=True)):
key = round(key)
if index == 0 :
last = index
continue
for px in range(last,key+1) :
self.pixle_to_ascii_dict[px] = self.ascii_range_dictCHARS[index]
last = key
self.pixle_count_in_block = self.pbs**2
self.frame_list = []
def __enter__(self):
# this will start reading and writting the frames
print("starting the functions ...")
# reading video stuff
self.vidcap = cv2.VideoCapture(self.video_name)
# fps set for reading and saving file
self.total_frames = int(self.vidcap.get(cv2.CAP_PROP_FRAME_COUNT))
print("Total frame count is --> ",self.total_frames)
default_fps = round(self.vidcap.get(cv2.CAP_PROP_FPS))
print("default fps of video is --> ",default_fps)
if self.fps < default_fps : self.steps = round(default_fps/self.fps)
else : self.steps = 1
self.fps =int(default_fps/self.steps)
print("new fps of video is --> ",self.fps)
self.reader_completed = False
# extracting first frame for the setup
success,frame = self.vidcap.read()
self.width,self.height = tuple(list(frame.shape)[0:2][::-1]) # for creating ascii from the image
# blank black image
self.blank_black = np.zeros((self.height,self.width,3), np.uint8)
# for ascii conversion
self.ascii_in_pixles = np.full([self.height//self.pbs,self.width//self.pbs], "", dtype=np.object)
# writting video stuff
self.writer = cv2.VideoWriter(self.video_output_name, cv2.VideoWriter_fourcc(*"mp4v"), self.fps,tuple(list(frame.shape)[0:2][::-1]) )
return self
def __exit__(self,a,b,c):
self.vidcap.release() # print(self.vidcap.isOpened())
print(f"\nSaving video as - { self.video_output_name }")
self.writer.release()
def iter_each_frame(self):
success = True
t1 = Thread(target = lambda : None )
t1.start()
while success:
count = int(self.vidcap.get(1))
success,frame = self.vidcap.read()
if count%self.steps == 0 and success :
if success and self.total_frames > count :
print(f"Working on frame -> '{str(count).zfill(5)}'")
t1.join()
t1 = Thread(target = lambda : self.frame_list.append(frame))
t1.start()
# make it save frames in thread in frame list
self.reader_completed = True
print("Just funishing up last -",len(self.frame_list),"process 😄😄")
def image_to_ascii_convertor(self,image):
# read the image in the b&w format transpose it and return the ascii nested list for that
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY).transpose()
ascii_in_pixles = np.copy(self.ascii_in_pixles)
# use numpy for fast working here
for index_h,h in enumerate(range(0,self.height,self.pbs)) :
for index_w,w in enumerate(range(0,self.width,self.pbs)) :
try :
sum_ = sum(image[w:w + self.pbs,h:h+self.pbs].flatten())
average = round(float(sum_)/self.pixle_count_in_block)
ascii_in_pixles[index_h][index_w] = self.pixle_to_ascii_dict[average]
except : pass # last some pixle less then pixle_count_in_block will be leaved because they may cause some irragularity in shades
return ascii_in_pixles
def frame_to_ascii_to_ascii_image(self,current_frame):
# take frame extract ascii data and return the ascii image
# print('converting to ASCII images' ,end = " - ")
ascii_data = self.image_to_ascii_convertor(current_frame)
# copy that blank image here black image
image = np.copy(self.blank_black)
# np.zeros((self.height,self.width,3), np.uint8)
# updating the text in it
for index_r,row in enumerate(ascii_data) :
for index_c,ascii_val in enumerate(row) :
if ascii_val.strip() != "" :
image = cv2.putText(image,ascii_val,(index_c*self.pbs,(index_r+1)*self.pbs),cv2.FONT_HERSHEY_PLAIN,0.9,(255,255,255),1)
return image
def add_ascii_frame(self,frame):
# convert the frame into ascii then convert the ascii to ascii frame
ascii_frame = self.frame_to_ascii_to_ascii_image(frame)
self.writer.write(ascii_frame) # save the frame
def frame_thread_superviser(self):
print("working on image computing")
while not self.reader_completed :
with concurrent.futures.ThreadPoolExecutor() as executor:
new_frames = executor.map(self.frame_to_ascii_to_ascii_image , self.frame_list )
for new_frame in new_frames:
Thread(target=lambda : self.frame_list.pop(0) ).start()
self.writer.write(new_frame) # save the frame
print("Just funishing up last -",len(self.frame_list),"process 😄😄")
with concurrent.futures.ThreadPoolExecutor() as executor:
new_frames = executor.map(self.frame_to_ascii_to_ascii_image , self.frame_list )
for new_frame in new_frames:
Thread(target=lambda : self.frame_list.pop(0) ).start()
self.writer.write(new_frame) # save the frame
print('Done. 😎')
@classmethod
def runner(cls,video,output_video,fps,pbs):
with cls(video,output_video,fps,pbs) as ascii_video :
reader = Thread(target= ascii_video.iter_each_frame )
reader.start()
# start the frame saving thread
saver = Thread(target = ascii_video.frame_thread_superviser)
saver.start()
# waiting for complete all the reading frames
reader.join()
print('waiting for the results...')
saver.join()
# example - args - inputVideo, outoutVideo,fps,pbs
# ascii_video.runner('ab.mp4',"Ascii_video2.mp4",30,10)
# ascii_video.runner('ab.mp4',"Ascii_video2.mp4",30,10)
if __name__ == "__main__" :
parser = argparse.ArgumentParser()
parser.add_argument('-f','--file' ,help = "name of the file you wanna use with extention !")
parser.add_argument('-o','--outfile',default = "Ascii_video.mp4" ,help = "name of the output file !")
parser.add_argument('--fps' ,default = 20,type = int,help = "fps of the output videos ! (default = 20)")
parser.add_argument('--pbs' ,default = 15,type = int,help = "pixle block size | smaller the number much fine result and but slow processing (default = 15 )")
args = parser.parse_args()
print(args)
if args.file:
start = perf_counter()
ascii_video.runner(args.file,args.outfile,args.fps,args.pbs)
finish = perf_counter()
print(f"Total time Taken {finish - start}s")
else :
raise Exception('file name is important for the program use -h for help')
|
rishabhjainfinal/ASCII_video | image_to_ascii.py | <reponame>rishabhjainfinal/ASCII_video<gh_stars>0
import cv2
import numpy as np
import os,argparse
from time import perf_counter
# when saving in the fiel replace . from space
class image_to_ascii(object):
def __init__(self,for_command_line = False,pbs=10):
# pbs = pixle_block_size
self.pbs = pbs # pixle_block_size
# all the ascii characters used are here in the order of the darkness
self.ascii_range_dictCHARS = [
' ',
'.',
',',
"'",
'"',
':',
";",
'-',
'*',
'~',
'+',
'=',
'?',
'/',
'|',
'#',
'%',
'₹',
'$',
'@'
]
# for the better visul of image use reverse
self.for_command_line = for_command_line
if not self.for_command_line :
self.ascii_range_dictCHARS.reverse()
self.pixle_to_ascii_dict = {}
# little help from https://github.com/sjqtentacles/Image-to-Ascii-Art-with-OpenCV/blob/master/image-to-ascii-art-a-demo-using-opencv.ipynb
for index,key in enumerate(np.linspace(0,255,num=len(self.ascii_range_dictCHARS),endpoint=True)):
key = round(key)
if index == 0 :
last = index
continue
for px in range(last,key+1) :
self.pixle_to_ascii_dict[px] = self.ascii_range_dictCHARS[index]
last = key
self.pixle_count_in_block = self.pbs**2
self.ascii_art = "ascii_art.txt"
self.img = []
def image(self,image):
# convert the image into black and white and read the pixles values
# also crate self.img for further processing with self.height and self.width for more computaion
# read image
if not os.path.exists(image) : raise FileNotFoundError("File not found!!.")
self.img = cv2.imread(image,0).transpose()
self.width,self.height = self.img.shape
def crate_ascii(self):
# resonsible for the creation of ascii art from image and return a 2d list as the result
self.ascii_in_pixles = np.full([self.height//self.pbs,self.width//self.pbs], "", dtype=np.object)
for index_h,h in enumerate(range(0,self.height,self.pbs)) :
for index_w,w in enumerate(range(0,self.width,self.pbs)) :
try :
sum_ = sum(self.img[w:w + self.pbs,h:h+self.pbs].flatten())
average = round(float(sum_)/self.pixle_count_in_block)
self.ascii_in_pixles[index_h][index_w] = self.pixle_to_ascii_dict[average]
except : pass # last some pixle less then pixle_count_in_block will be leaved because they may cause some irragularity in shades
return self.ascii_in_pixles
def save_in_file(self):
# this will wirte all ascii in the fiel and update if the file exist
af = open(self.ascii_art,mode= 'w',encoding='utf-8')
for a in self.ascii_in_pixles :
to_write = "".join(a)+'\n'
if self.for_command_line :
# print("".join(a))
to_write = to_write.replace(".",' ')
to_write = to_write.replace(",",' ')
af.writelines(to_write)
af.close()
print("file saved -> ",self.ascii_art)
@classmethod
def runner(cls,image,for_command_line,pbs = 10):
ascii_ = cls(for_command_line=for_command_line,pbs=pbs)
ascii_.image(image)
ascii_.crate_ascii()
ascii_.save_in_file()
# example
# image_to_ascii.runner('testing_data/abc.jpg',False,10)
# image_to_ascii.runner('Screenshot (228).png',False)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-f','--file' ,help = "name of the file you wanna use with extention !")
parser.add_argument('-c',"--commandLine",action="store_true",help = "this art will use in command line display")
parser.add_argument('--pbs' ,default = 15,type = int,help = "pixle block size | smaller the number much fine result and but slow processing (default = 15 )")
args = parser.parse_args()
if args.file :
start = perf_counter()
image_to_ascii.runner(args.file,args.commandLine,args.pbs)
finish = perf_counter()
print(f"Total time Taken {finish - start}s")
else :
raise Exception('file name is important for the program use -h for help') |
rmwthorne/covid-repr-seqs | get_representative.py | <gh_stars>0
"""Usage: get_representative.py <pangolin_output> <embl_seqs> [-o OUTFILE]
-o OUTFILE Output file name [default: repr_seqs.tsv]
"""
import csv
from docopt import docopt
import pandas as pd
def main(args):
pangolin_output = args.get('<pangolin_output>', 'lineages.csv')
embl_seqs = args.get('<embl_seqs>', 'seqs_embl_covid18.tsv')
inclusion_accessions = ['MT929124', 'MZ009837']
lineages = pd.read_csv(pangolin_output)
lineages = (
lineages
.assign(accession=lineages.taxon.map(extract_accession))
.set_index('accession')
)
require_cols(lineages, ['lineage'])
seqs = pd.read_table(
embl_seqs,
parse_dates=['collection_date'],
quoting=csv.QUOTE_ALL,
index_col='accession_id',
)
require_cols(seqs, ['collection_date'])
joined = seqs.join(lineages, how="inner")
joined = joined.assign(accession_id=joined.index)
rep_seqs = (joined
.pipe(create_date_col)
.pipe(include, inclusion_accessions)
.pipe(remove_failed)
.pipe(remove_older_than, 2019_12_20)
.pipe(exclude_ambiguous_dates)
.pipe(remove_coverage_under, 98.0)
.pipe(keep_most_supported_vocs)
.pipe(earliest_date_per_lineage)
.pipe(drop_lineage_none)
.pipe(lambda x: x.sort_values(['scorpio_call', 'lineage']))
)
# print(rep_seqs.columns)
# print(rep_seqs)
keep_cols = [
'accession_id',
'cross_references',
'date',
'country',
'lineage',
'ambiguity_score',
'scorpio_call',
'scorpio_support',
'scorpio_conflict',
'coverage',
'pangolin_version',
'note',
]
# import pdb; pdb.set_trace()
rep_seqs[keep_cols].to_csv(args.get('-o'), sep='\t', index=None)
def require_cols(df: pd.DataFrame, required_cols: list):
valid = all(col in df.columns for col in required_cols)
if not valid:
print(f"Error: Dataframe did not contain "
f"all required columns: {required_cols}")
exit(1)
def extract_accession(taxon: str) -> str:
return taxon.split('|')[1]
def create_date_col(df):
require_cols(df, ['collection_date'])
return df.copy().assign(
date=df.collection_date.map(format_date)
)
def remove_failed(df: pd.DataFrame):
require_cols(df, ['status'])
return df.copy()[df.status.str.contains('passed_qc', na=False)]
def remove_coverage_under(df: pd.DataFrame, cutoff: float) -> pd.DataFrame:
return df.copy()[df.coverage > cutoff]
def remove_older_than(df: pd.DataFrame, date: int):
# Remove sequences with a spurious collection date of before the outbreak
df2 = df.copy()[~df.collection_date.isna()]
return df2[df2.collection_date.astype(int) > date]
def keep_most_supported_vocs(df):
voc_rows = ~df.scorpio_support.isna()
vocs = df.copy()[voc_rows]
rest = df.copy()[~voc_rows]
top_vocs = vocs.sort_values('scorpio_support', ascending=False).groupby('lineage').head(1)
# top_rest = rest.sort_values('ambiguity_score', ascending=False).groupby('lineage').head(1)
return pd.concat([top_vocs, rest])
def include(df, accessions: list[str]):
inclusion_rows = df.accession_id.isin(accessions)
inclusion_df = df.copy()[inclusion_rows]
lineages_to_remove = df[inclusion_rows].lineage.tolist()
filtered_df = df.copy()[~df.lineage.isin(lineages_to_remove)]
return pd.concat([inclusion_df, filtered_df])
def exclude_ambiguous_dates(df):
return df.copy()[~df.date.str.endswith('XX')]
def earliest_date_per_lineage(df):
return df.copy().sort_values('date').groupby('lineage').head(1)
def drop_lineage_none(df):
return df.copy().query("lineage != 'None'")
def format_date(date: str) -> str:
"""
Accepts an EBI json date string and formats it for Nextstrain
e.g. 20210100 -> 2021-01-XX
"""
if date is None: return "?"
date = str(date)
year = date[:4]
month = date[4:6].replace("00", "XX")
day = date[6:].replace("00", "XX")
return f"{year}-{month}-{day}"
if __name__ == '__main__':
args = docopt(__doc__)
main(args)
|
ritaaylward/raec | plot_ctd_data_pm.py | <reponame>ritaaylward/raec
"""
Code to plot data from the Canadian CTD text file.
Goal is the make a plot of temperature vs. depth and save it as a png
in the output directory.
"""
# imports
import sys, os
sys.path.append(os.path.abspath('shared'))
import my_module as mymod
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
myplace = 'raec' # *** YOU NEED TO EDIT THIS ***
# input directory
in_dir = '../' + myplace + '_data/'
# make sure the output directory exists
out_dir = '../' + myplace + '_output/'
mymod.make_dir(out_dir)
# define the input filename
in_fn = in_dir + '2017-01-0118.ctd'
# this is some Canadian CTD data, formatted in a strict but
# difficult-to-use way
# define the output filenames
out_fn_1 = out_dir + 'out_test_1.png'
out_fn_2 = out_dir + 'out_test_2.png'
# ==========================================================================
# version 1: do it by hand
# go through the input file one line at a time, and start accumulating data
# when we are done with the header
f = open(in_fn, 'r', errors='ignore')
# typical real-world issue: the read operation throws an error
# around line 383 for unknown reasons - we ignore it.
get_data = False
# initialize data holder lists
depth_list = []
temp_list = []
for line in f:
if ('*END OF HEADER' in line) and get_data==False:
get_data = True
elif get_data == True:
line_list = line.split() # split items on line into strings
# and save selected items as floating point numbers in our lists
depth_list.append(float(line_list[1]))
temp_list.append(float(line_list[2]))
f.close()
# then turn the lists into numpy arrays (vectors in this case)
depth_vec = np.array(depth_list)
temp_vec = np.array(temp_list)
# you can actually plot from the lists of floats, but I want to plot
# "Z" which is minus the depth
# plotting
plt.close('all')
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(1,1,1)
ax.plot(temp_vec, -depth_vec, 'ob')
ax.grid(True)
ax.set_xlabel('Temperature [deg C]')
ax.set_ylabel('Z [m]')
ax.set_title(in_fn + ': From Scratch')
plt.show()
plt.savefig(out_fn_1)
# ==========================================================================
# version 2: use pandas "read_csv" method
vn_list = ['Pressure [dbar]', 'Depth [m]', 'Temperature [deg C]', 'Fluoresence', 'PAR',
'Salinity', 'DO [ml/L]', 'DO [uM]', 'nrec']
df = pd.read_csv(in_fn, skiprows=570, header=None, names=vn_list, delim_whitespace=True)
df['Z [m]'] = -df['Depth [m]'] # add a Z column
df.plot(x='Temperature [deg C]', y='Z [m]', style='og', legend=False, grid=True,
title=in_fn +': Using Pandas', figsize=(8,8))
plt.show()
plt.savefig(out_fn_2)
# ==========================================================================
|
ritaaylward/raec | test_my_module2.py | """
Code to test my_module.py.
Try dir(mymod) and help(mymod.make_dir) and see what you get. The results
are very much like regular module.
"""
#imports
import sys, os
# local imports
from shared import my_module as mymod
from importlib import reload
reload(mymod)
# use a method in the module
x = mymod.square_my_number()
print('The square of my number is: %d' % (x))
# get a variable defined in the module
y = mymod.my_secret_number # no () because this is not a function
print('\nMy secret number is: %d' % (y))
# try another method from the module - one that prompts for input
my_choice = mymod.choose_item('./')
print('\nMy choice was: ' + my_choice)
|
ritaaylward/raec | test_my_module.py | """
Code to test my_module.py.
Try dir(mymod) and help(mymod.make_dir) and see what you get. The results
are very much like regular module.
"""
#imports
import sys, os
# local imports
pth = os.path.abspath('shared') #this method returns the pathname to the path passed as a parameter to this function.
print('\nAdding the path:')
print(pth + '\n') # the \n adds a line feed
sys.path.append(pth)
import my_module as mymod
from importlib import reload
reload(mymod)
# use a method in the module
x = mymod.square_my_number()
print('The square of my number is: %d' % (x))
# get a variable defined in the module
y = mymod.my_secret_number # no () because this is not a function
print('\nMy secret number is: %d' % (y))
# try another method from the module - one that prompts for input
my_choice = mymod.choose_item('./')
print('\nMy choice was: ' + my_choice)
|
ritaaylward/raec | plot_ctd_data.py | <reponame>ritaaylward/raec
"""
Code to plot data from the Canadian CTD text file.
Goal is the make a plot of temperature vs. depth and save it as a png
in the output directory.
"""
# imports
import sys, os
sys.path.append(os.path.abspath('shared'))
import my_module as mymod
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
myplace = 'raec' # *** YOU NEED TO EDIT THIS ***
# input directory
in_dir = '../' + myplace + '_data/'
# make sure the output directory exists
out_dir = '../' + myplace + '_output/'
mymod.make_dir(out_dir)
# define the input filename
in_fn = in_dir + '2017-01-0118.ctd'
# this is some Canadian CTD data, formatted in a strict but
# difficult-to-use way
# define the output filenames
out_fn_1 = out_dir + 'out_test_1.png'
out_fn_2 = out_dir + 'out_test_2.png'
'--------------------------------------------------'
# version 1: do it by hand
# go through the input file one line at a time, and start accumulating data
# when we are done with the header
f = open(in_fn, 'r', errors='ignore')
# typical real-world issue: the read operation throws an error
# around line 383 for unknown reasons - we ignore it.
get_data = False # like a light switch. starts in off position
# initialize empty data holder arrays.
depth_arr = np.empty(0)
temp_arr = np.empty(0)
for line in f:
if '*END OF HEADER' in line:
get_data = True # toggel the switch to 'on' once you reach END OF HEADER
elif get_data == True: # the switch is now on, so it'll do the stuff in elif
line_list = line.split() # split items on line into strings
# and save selected items as floating point numbers in our lists
depth_arr = np.append(depth_arr, float(line_list[1]))
temp_arr = np.append(temp_arr, float(line_list[2]))
f.close()
# plot "Z" is minus the depth
# plotting
plt.close('all')
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(1,1,1)
ax.plot(temp_arr, -depth_arr, 'ob')
ax.grid(True)
ax.set_xlabel('Temperature [deg C]')
ax.set_ylabel('Z [m]')
ax.set_title(in_fn + ': From Scratch')
plt.show()
plt.savefig(out_fn_1)
|
ritaaylward/raec | python_basics.py | """
This is a typical way to format a program.
"""
# always do imports first
import numpy as np
import matplotlib.pyplot as plt
# now make some variable
x = np.linspace(0,10,100)
y = x**2
# plotting to the screen
# first get rid of old figures
#plot.close('all')
#initialize a figure object
fig = plt.figure(figsize=(8,8))
# initialize an axis object
ax = fig.add_subplot(111)
# use the 'plot' method of the ax object
ax.plot(x, y, '--g', linewidth=3)
# and make sure it shows up
plt.show()
|
ritaaylward/raec | test1.py | # experimenting with a variable and a list
a = [1 , 3 ,4 , 7]
print(a)
b = "string"
print(b)
d = "this is a sentence"
|
ritaaylward/raec | numpy_argparse_hw.py | <reponame>ritaaylward/raec
import sys, os
import numpy as np
import pickle
import argparse
# local imports
from shared import my_module as mymod
from importlib import reload
reload(mymod)
'-----------------------------------------------------------------------------------'
# Make some arrays
arr_1 = np.array([45, 6, 94, 11, 33, 79, 103, 62]) # 1D array. 8 elements.
arr_2 = np.array(np.arange(16)).reshape(8,2) # 2D array using arange. 16 integer elemets starting from 0: 8 rows, 2 columns
arr_3 = np.array(np.linspace(8, 23, 16)).reshape(2, 8) # 2D array using linspace. 14 float elements between 7 and 23 (inclusive): 2 rows, 8 columns.
arr_4 = np.zeros((4,4)) # a 2D array of 0s. 4 rows, 4 columns.
arr_5 = np.ones((2,3,4))# 3D array of ones. an array of 3 elements(?), each of which is a 4 x 5 array of 1s. 60 total elemts.
print("We made 5 arrays. Do you want to see them printed? (If so, type 'yes')")
if input('> ').lower() == 'yes':
print(f'\n1st array:\n {arr_1}, \n2nd array:\n {arr_2}, \n3rd array:\n {arr_3}, \n4th array:\n {arr_4}, \n5th array:\n {arr_5}')
else:
print("You said something other than 'Yes' so we won't print the arrays. :(")
'-----------------------------------------------------------------------------------'
# use argparse to add command-line arguments
# create the parser object
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--a_string', default='not "no"', type=str) # anything other than "no" (not case sensitive) will cause some info about the arrays to print
parser.add_argument('-b', '--b_integer', default=1, type=int) # must be an integer from from 0 to 7 because arr_3 has 8 columns
parser.add_argument('-c', '--c_float', default=900, type=float) # recommend an input such that 500 < c < 3000
# get the arguments
args = parser.parse_args()
'-----------------------------------------------------------------------------------'
# try some methods on the arrays (using the arguments from the command-line)
# Print some basic info about the arrays
if args.a_string.lower() != 'no':
print('\nYour string input for -a is', args.a_string, 'so we will print some basic info about the arrays\n',
'\tThe shape of arr_3 is:', arr_3.shape,
'\n\tThe size of arr_4 is:', arr_4.size,
'\n\tThe mean of arr_1 is:', (arr_1).mean(),
'\n\tThe minimum value in arr_2 is:', arr_2.min())
else:
print(f"\nYour string input for -a is '{args.a_string}' so we won't print the basic info about the arrays. :(")
# do some math with the arrays
# take a slice out of arr_2 (1st column) and a slice out of arr_3 ('bth' row) and add them to arr_1
arr_new = arr_1 + arr_2[:, 1] + arr_3[0, args.b_integer]
# re-shape the resulting list into an array of 4 rows, two columns, then multiply it by the transposition of arr_2
arr_new = np.reshape(arr_new, (4, 2)) @ (arr_2.T)
print(f'\nDo some math and get a new array (note you chose to use row {args.b_integer} of arr_3):\n', arr_new)
# make a new list out of the values greater than -c in array arr_new
arr_new_large_values = []
for i in range(len(arr_new)):
for j in range(len(arr_new[i])):
if arr_new[i,j] > args.c_float:
arr_new_large_values.append(arr_new[i,j])
print(f'The values in the new array that are > {args.c_float} are:\n', arr_new_large_values)
# change some of the values in arr_4
for i in range(len(arr_4)):
arr_4[i, i] = i
print('Change the values along the diagonal in arr_4:\n', arr_4)
# check if the values along the diagonal are less than 2
print('Are the values along the diagonal of arr_4 less than 2?')
for i in range(len(arr_4)):
if arr_4[i,i] < 2:
print('\tthe value at position', [i,i], 'is less than 2')
else:
print('\tthe value at position', [i,i], 'is not less than 2')
'-----------------------------------------------------------------------------------'
# save some output as a pickle file
# make an output directory if needed
this_dir = os.path.abspath('.').split('/')[-1] # path is split at each '/'. this_dir is assigned the last object [-1] in the path. not sure why the '.' is there in abspath.
print("This is the directory we're in now:", this_dir)
out_dir = '../' + this_dir + '_output/'
print(f'We create an output directory "{out_dir}" in line with "{this_dir}" if needed, then save arr_4 as a pickle file in that output directory')
mymod.make_dir(out_dir) # calling on function from mymod that creates a directory
# save it as a pickle file
out_fn = out_dir + 'pickled_output.p'
pickle.dump(arr_4, open(out_fn, 'wb')) # 'wb' is for write binary
# read the file back in
b = pickle.load(open(out_fn, 'rb')) # 'rb is for read binary
|
WulfH/Pattern | Test3.py | <reponame>WulfH/Pattern
from Pattern import Pattern
import numpy as np
import matplotlib.pyplot as plt
test=Pattern(5,5)
test.set(np.array([[0,0,0,5,0],[5,0,0,0,0],[5,5,0,5,5],[0,5,0,0,5],[0,5,0,5,0]]))
A=test.get()
B=test.autocor()
test.mirror(1)
C=test.get()
D=test.autocor()
test.evolve("mean")
E=test.get()
F=test.autocor()
plt.subplot(231)
plt.imshow(A, cmap='hot', interpolation='nearest')
plt.subplot(234)
plt.imshow(B, cmap='hot', interpolation='nearest')
plt.subplot(232)
plt.imshow(C, cmap='hot', interpolation='nearest')
plt.subplot(235)
plt.imshow(D, cmap='hot', interpolation='nearest')
plt.subplot(233)
plt.imshow(E, cmap='hot', interpolation='nearest')
plt.subplot(236)
plt.imshow(F, cmap='hot', interpolation='nearest')
plt.show()
|
WulfH/Pattern | Test1.py | from Pattern import Pattern
import matplotlib.pyplot as plt
test=Pattern(51,51)
test.create("rand",10)
test.mirror(0)
test.mirror(1)
A=test.get()
test.evolve("cluster")
B=test.get()
test.evolve("cluster")
C=test.get()
test.evolve("cluster")
D=test.get()
test.evolve("cluster")
E=test.get()
test.evolve("cluster")
F=test.get()
plt.subplot(231)
plt.imshow(A, cmap='hot', interpolation='nearest')
plt.subplot(232)
plt.imshow(B, cmap='hot', interpolation='nearest')
plt.subplot(233)
plt.imshow(C, cmap='hot', interpolation='nearest')
plt.subplot(234)
plt.imshow(D, cmap='hot', interpolation='nearest')
plt.subplot(235)
plt.imshow(E, cmap='hot', interpolation='nearest')
plt.subplot(236)
plt.imshow(F, cmap='hot', interpolation='nearest')
plt.show()
|
WulfH/Pattern | Test2.py | <reponame>WulfH/Pattern<gh_stars>0
from Pattern import Pattern
import matplotlib.pyplot as plt
test=Pattern(20,20)
test.create("chess",2)
A=test.get()
B=test.autocor()
test.create("rand",10)
C=test.get()
D=test.autocor()
test.evolve("cluster")
test.evolve("cluster")
test.evolve("cluster")
E=test.get()
F=test.autocor()
test.mirror(0)
test.mirror(1)
G=test.get()
H=test.autocor()
plt.subplot(241)
plt.imshow(A, cmap='hot', interpolation='nearest')
plt.subplot(245)
plt.imshow(B, cmap='hot', interpolation='nearest')
plt.subplot(242)
plt.imshow(C, cmap='hot', interpolation='nearest')
plt.subplot(246)
plt.imshow(D, cmap='hot', interpolation='nearest')
plt.subplot(243)
plt.imshow(E, cmap='hot', interpolation='nearest')
plt.subplot(247)
plt.imshow(F, cmap='hot', interpolation='nearest')
plt.subplot(244)
plt.imshow(G, cmap='hot', interpolation='nearest')
plt.subplot(248)
plt.imshow(H, cmap='hot', interpolation='nearest')
plt.show()
|
WulfH/Pattern | Pattern.py | <filename>Pattern.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import copy
class Pattern:
def __init__(self, x, y):
self.pat=np.zeros((x,y))
# self.x=x; self.y=y;
def get(self):
return copy.copy(self.pat)
def set(self, A):
self.pat=copy.copy(A)
def map(self):
plt.imshow(self.pat, cmap='hot', interpolation='nearest')
plt.show()
def create(self, pattern, n=2):
if pattern=="rand":
self.pat=np.random.randint(n, size=self.pat.shape)
elif pattern=="chess":
for (i,j) in np.ndindex(self.pat.shape):
self.pat[i,j]=(i+j)%n
def evolve(self, pattern):
if pattern=="cluster":
A=np.full(tuple(map(sum, zip(self.pat.shape,(2,2)))), np.nan)
A[1:-1,1:-1]=self.pat
for (i,j) in np.ndindex(self.pat.shape): #stats.mode works slow and strange
self.pat[i,j]=stats.mode(A[i:i+3,j:j+3], axis=None, nan_policy="omit")[0]
elif pattern=="mean":
A=np.full(tuple(map(sum, zip(self.pat.shape,(2,2)))), np.nan)
A[1:-1,1:-1]=self.pat
for (i,j) in np.ndindex(self.pat.shape):
self.pat[i,j]=int(np.nanmean(A[i:i+3,j:j+3]))
def mirror(self, ax):
x,y=self.pat.shape
x=int(x/2); y=int(y/2)
if ax==0:
self.pat[-x:,:]=self.pat[x-1::-1,:]
elif ax==1:
self.pat[:,-y:]=self.pat[:,y-1::-1]
def autocor(self):
A=np.zeros(self.pat.shape)
for (i,j) in np.ndindex(self.pat.shape):
B=np.roll(self.pat, i, axis=0)
B=np.roll(B, j, axis=1)
A[i,j]=np.sum(np.absolute(self.pat-B))
return A
|
dimitrip13/CVS_Vaccine_Finder | cvs_check.py | <filename>cvs_check.py
"""
Published on Mar 30, 2021
@authors: <NAME> and <NAME>
"""
# ----------------------------------------------------------------------------------------------------------------------
"""
_ _ _____ ______ _____ __ __ _____ _____ ____ _ ______ _____
| | | | / ____|| ____|| __ \ \ \ / //\ | __ \ |_ _| /\ | _ \ | | | ____| / ____|
| | | || (___ | |__ | |__) | \ \ / // \ | |__) | | | / \ | |_) || | | |__ | (___
| | | | \___ \ | __| | _ / \ \/ // /\ \ | _ / | | / /\ \ | _ < | | | __| \___ \
| |__| | ____) || |____ | | \ \ \ // ____ \ | | \ \ _| |_ / ____ \ | |_) || |____ | |____ ____) |
\____/ |_____/ |______||_| \_\ \//_/ \_\|_| \_\|_____|/_/ \_\|____/ |______||______||_____/
"""
# ----------------------------------------------------------------------------------------------------------------------
# User Variables to change
# Input the two-letter state abbreviation into the list; for example, if your state is New York, input 'NY'
STATES = []
# Input city with a CVS location. Check the cvs website for a list of acceptable cities with a vaccine cvs location
CITIES = []
# Type of email you are sending with (different email types require different protocols to send the email)
# Allowed types = 'gmail', 'outlook', 'yahoo', 'att', 'comcast', and 'verizon'
EMAIL_TYPE = 'gmail'
# Email address to send from ex: '<EMAIL>'
SENDER = '<EMAIL>'
# Password of the email address you're sending from ex: '<PASSWORD>'
PASSWORD = '<PASSWORD>'
# Email address to send to/receive from ex: '<EMAIL>'
RECEIVER = '<EMAIL>'
# How often to refresh the page, in seconds
UPDATE_TIME = 60
# USER INPUT EXAMPLES (everything case IN-sensitive)
# -----------------------
# Search statewide - Searches every city in the state(s) given
# STATES = ['ny', 'MA']
# CITIES = []
# -----------------------
# Search multiples cities in one state - Searches city/cities in a single state given
# STATES = ['cA']
# CITIES = ['Fresno', 'santa clarita', 'MADERA']
# -----------------------
# Search multiples cities in multiple states - Cities must match to states in a one to one fashion (can ignore spaces)
# STATES = [ 'CA', 'Ny', 'Ca', 'ma']
# CITIES = ['FRESNO', 'New York', 'Santa clarita', 'salem']
"""
Please don't change anything else below unless you know what you're doing.....thanks
"""
# ----------------------------------------------------------------------------------------------------------------------
"""
_____ __ __ _____ ____ _____ _______ _____ _____ _ __ _____ ______ _____
|_ _|| \/ || __ \ / __ \ | __ \|__ __| | __ \ /\ / ____|| |/ / /\ / ____|| ____| / ____|
| | | \ / || |__) || | | || |__) | | | | |__) |/ \ | | | ' / / \ | | __ | |__ | (___
| | | |\/| || ___/ | | | || _ / | | | ___// /\ \ | | | < / /\ \ | | |_ || __| \___ \
_| |_ | | | || | | |__| || | \ \ | | | | / ____ \| |____ | . \ / ____ \| |__| || |____ ____) |
|_____||_| |_||_| \____/ |_| \_\ |_| |_| /_/ \_\ _____||_|\_\/_/ \_\ _____||______||_____/
"""
# ----------------------------------------------------------------------------------------------------------------------
# Timing
import time
# Emailing
import smtplib
# Email message crafting
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Read dictionary from link
import json
# Used to make copies of the state when zipping cities ans states together
from itertools import cycle
# Page fetching from url
try:
# Works on python 3+ as of March 30, 2021
from urllib.request import urlopen
except ImportError:
# Works on python 2.7
from urllib2 import urlopen
# ----------------------------------------------------------------------------------------------------------------------
"""
_____ _ ____ ____ _ __ __ _____ _____ ____ _ ______ _____
/ ____|| | / __ \ | _ \ /\ | | \ \ / //\ | __ \ |_ _|| _ \ /\ | | | ____| / ____|
| | __ | | | | | || |_) | / \ | | \ \ / // \ | |__) | | | | |_) | / \ | | | |__ | (___
| | |_ || | | | | || _ < / /\ \ | | \ \/ // /\ \ | _ / | | | _ < / /\ \ | | | __| \___ \
| |__| || |____| |__| || |_) |/ ____ \ | |____ \ // ____ \ | | \ \ _| |_ | |_) |/ ____ \ | |____ | |____ ____) |
\_____||______|\____/ |____//_/ \_\|______| \//_/ \_\|_| \_\|_____||____//_/ \_\|______||______||_____/
"""
# ----------------------------------------------------------------------------------------------------------------------
# Link to all available appointments
LINK="https://www.cvs.com/immunizations/covid-19-vaccine/immunizations/covid-19-vaccine.vaccine-status.json?vaccineinfo"
# Converts user strings to make functions case insensitive
STATES = [state.upper() for state in STATES]
CITIES = [city.upper() for city in CITIES]
EMAIL_TYPE = EMAIL_TYPE.lower()
# If searching for multiple cities in one state
if CITIES and len(STATES) == 1:
# Zips the cites and states list to a list of tuples [(city1, state1), (city2, state2), ...]
# Used for verification and indexing into the dictionary of appointments
MY_CITY_STATES = list(zip(CITIES, cycle(STATES)))
# If the cities list is not empty, the user is searching for specific cities in specific states or
# multiple cities in one state
if CITIES:
SEARCHING_FOR_SPECIFIC_CITIES = True
# Otherwise searching statewide for availability in all cities, for the given states
else:
SEARCHING_FOR_SPECIFIC_CITIES = False
# Dictionary to get the server ID and port number for each email type
EMAIL_DICT = {'gmail' : ('smtp.gmail.com', 587),
'outlook': ('smtp-mail.outlook.com', 587),
'yahoo' : ('smtp.mail.yahoo.com', 587),
'att' : ('smpt.mail.att.net', 465),
'comcast': ('smtp.comcast.net', 587),
'verizon': ('smtp.verizon.net', 465)}
# ----------------------------------------------------------------------------------------------------------------------
"""
______ _ _ _ _ _____ _______ _____ ____ _ _ _____
| ____| | | | | | \ | | / ____| |__ __| |_ _| / __ \ | \ | | / ____|
| |__ | | | | | \| | | | | | | | | | | | | \| | | (___
| __| | | | | | . ` | | | | | | | | | | | | . ` | \___ \
| | | |__| | | |\ | | |____ | | _| |_ | |__| | | |\ | ____) |
|_| \____/ |_| \_| \_____| |_| |_____| \____/ |_| \_| |_____/
"""
# ----------------------------------------------------------------------------------------------------------------------
def get_dictionary_from_link():
"""
Given the cvs website link, returns a dictionary with all of the appointment information
"""
# Get appointments as a single text string from the given link
text = urlopen(LINK).read().decode("UTF-8")
# Convert the string into a dictionary to access the bookings
return json.loads(text)
# ----------------------------------------------------------------------------------------------------------------------
def get_states():
"""
Gets list of states from the cvs link
"""
dictionary = get_dictionary_from_link()
states = dictionary["responsePayloadData"]["data"].keys()
return sorted(states)
# ----------------------------------------------------------------------------------------------------------------------
def get_cities(list_of_states):
"""
Gets cities from the array of given states
"""
all_cities = []
dictionary = get_dictionary_from_link()
for state in list_of_states:
list_O_dicts = dictionary["responsePayloadData"]["data"][state]
for city_state_status in list_O_dicts:
all_cities.append(city_state_status["city"])
return sorted(all_cities)
# ----------------------------------------------------------------------------------------------------------------------
def user_input_verification():
"""
This function checks to confirm that the user input is of the correct form.
Raises and error exception upon bad input.
"""
all_states = get_states()
all_states_set = set(all_states)
all_cities = get_cities(all_states)
# If no state is entered
if not STATES:
raise ("\nYou must enter at least one state.\n")
# Checks if all the state inputs are correct
if not set(STATES).issubset(all_states_set):
raise ("\nOne or more state inputs are invalid.\n")
# Checks if all the city inputs are correct
if not all(city in all_cities for city in CITIES):
raise ("\nOne or more cities entered are not correct. Please go to "
"https://www.cvs.com/immunizations/covid-19-vaccine and click "
"your state to see a list of viable options.\n")
# In the case in which cities array is not empty, i.e. the search is NOT statewide, further checks are carried out.
if (CITIES):
num_cities = len(CITIES)
num_states = len(STATES)
# The cities list must either have exactly one state, indicating that all cities being checked are in the same state,
# OR each city must have a 1:1 match it its state if checking across multiple states.
if not (num_cities == num_states or num_states == 1):
raise ("\nCity entry error. If all appointments you are searching are in the same state, "
"only enter that one state. If you are checking in multiple stats, make sure you "
"enter the same number of states as you have cities \n")
if (num_cities == num_states):
# Confirm that each city is in the corresponding state listed
for i in range(num_cities):
if CITIES[i] not in get_cities(STATES):
raise ("\nCity entry error. At least 1 City/State pairing is incorrect \n")
if (num_states == 1):
# Confirm that each city is in the state listed
for i in range(num_cities):
if CITIES[i] not in get_cities(STATES):
raise ("\nCity entry error. At least 1 City listed is not in the specified state. \n")
if not isinstance(UPDATE_TIME, (float, int)):
raise ("\nUPDATE_TIME variable type must be a number.\n")
if not (isinstance(SENDER, str) and isinstance(PASSWORD, str) and isinstance(RECEIVER, str)):
raise ("\nThe sender, password, and receiver fields must all be strings.\n")
if not ('@' in RECEIVER and '.' in RECEIVER):
raise ("\nThe receiver must be a proper email containing an '@' character and a '.' character .\n")
# The sender email must have the same provider as the email_provider
at_index = SENDER.find('@')
dot_index = SENDER.find('.')
sender_suffix = SENDER[at_index + 1: dot_index]
if not sender_suffix == EMAIL_TYPE:
raise ("\nThe sender email must come from the same provider as the email_provider variable.\n")
# ----------------------------------------------------------------------------------------------------------------------
def get_available_appointments():
"""
Gets the set of user specified cities (either specific cities, or all cities given a list of states)
that have available appointments
Container type from website = Dict[Str: Dict[Str: Dict[Str: List[Dict[Str: Str]]]]]
Dict 1 keys = ["responsePayloadData", "responseMetaData"]
Dict 2 keys = ["currentTime", "data", "isBookingCompleted"]
Dict 3 keys = ["NY", "CA", "SC", "MA", "FL", ... all state abbreviations]
Dict 4 = {"city": "NEW YORK", "state": state abbreviation ex: "NY", "status": either "Available" or "Fully Booked"}
"""
# Get the dictionary of available appointments
dictionary = get_dictionary_from_link()
# Initialize appointments as an empty set
available_appointments = set()
# Loop over each user given state
for state in STATES:
# Get the list of dicts with city, state, and status
list_O_dicts = dictionary["responsePayloadData"]["data"][state]
# Index into the list and add to available appointments (nothing will happen if it's a duplicate)
for dict4 in list_O_dicts:
if SEARCHING_FOR_SPECIFIC_CITIES:
# Add to available appointments if appointment is available and it's the user specified (city, state)
if (dict4["city"], state) in MY_CITY_STATES and dict4["status"] == "Available":
available_appointments.add(dict4["city"])
# If searching statewide
else:
# Add to available appointments only if appointment is available
if dict4["status"] == "Available":
available_appointments.add(dict4["city"])
return available_appointments
# ----------------------------------------------------------------------------------------------------------------------
def send_email(message):
"""
Login via STMP and send email with the given message and with the given email type
"""
# Get SMTP server ID and port for the given email type
# SeverID sets which email type to sent from
# Port used for web protocols, 587 for default web (supports TLS) or 465 for SSL
serverID, port = EMAIL_DICT[EMAIL_TYPE]
# Establish SMTP Connection
s = smtplib.SMTP(host=serverID, port=port)
# Start SMTP session
s.starttls()
# Login using given email ID and password
s.login(SENDER, PASSWORD)
# Create email message in proper format
m = MIMEMultipart()
# Set email parameters
m['From'] = SENDER
m['To'] = RECEIVER
m['Subject'] = "New Appointment(s) Available! - Looking In: " + collection_2_sentence(set(STATES))
# Add message to email body (specifying an html string)
m.attach(MIMEText(message, 'html'))
# Send the email
s.sendmail(SENDER, RECEIVER, m.as_string())
# Terminate the SMTP session
s.quit()
# ----------------------------------------------------------------------------------------------------------------------
def build_email_message(new_appointments, all_appointments):
"""
Given the set of new and all appointments, builds an HTML string with the text that will be sent in the
"""
out = '' # Initialize empty string
out += ("<h3>New Appointments:</h3>") # Adds New Appointments header
out += collection_2_listed_string(new_appointments) + '\n\n' # Adds list of new appointments
out += '\n<br>Go to https://www.cvs.com/immunizations/covid-19-vaccine to book an appointment.' # Gives the link
out += ("<h3>All Available Appointments:</h3>") # Adds All Appointments header
out += collection_2_listed_string(all_appointments) + '\n\n' # Adds list of all appointments
return out # Returns final message
# ----------------------------------------------------------------------------------------------------------------------
def collection_2_listed_string(set_of_cities):
"""
Given a container of strings,
returns an HTML string where each city has its own line
This function will be used to help format and build the email text body in the build_email_message function
Note: returned cities should be in alphabetical order
"""
# Early exit if the set is empty
if not set_of_cities:
return 'None Available' + '<br>'
string = "" # Initialize empty string
sort = sorted(set_of_cities) # Sorts the set (converts to a list)
for city in sort: # Loop over each city in the set
string += city + '<br>' # Append the city to the string
return string # Returns the string
# ----------------------------------------------------------------------------------------------------------------------
def collection_2_sentence(list_str):
"""
Given a container (list or set) of strings with the names of cities, states or any string (elements),
returns a string where each element is listed in a sentence
Note: returned objects should be in alphabetical order
Ex1: {"LIVERPOOL"} -> LIVERPOOL
Ex2: ["LIVERPOOL", "KINGSTON"] -> KINGSTON and LIVERPOOL
Ex3: {"BROOKLYN", "LIVERPOOL", "KINGSTON"} -> BROOKLYN, LIVERPOOL, and KINGSTON
"""
# Sorts the set (converts to a list)
elements = sorted(list_str)
# Gets the number of cities in the set
num_elements = len(list_str)
# If the set is empty, return None
if not list_str:
return 'None Available'
# If the set has one cities, return the string of the one city
elif num_elements == 1:
return elements[0]
# If the set has two cities, return the two cities as "city1 and city2"
elif num_elements == 2:
return elements[0] + ' and ' + elements[1]
# If the set has three or more cities, return cities like saying a list in a sentence "cityA, ... cityY, and cityZ"
else:
string = "" # Initialize empty string
for i in range(num_elements - 1): # Loop over each city in the set except the last one
string += elements[i] + ', ' # Add the city to the string with a comma and space
return string + 'and ' + elements[-1] # Add the final city with an "and" and return string
# ----------------------------------------------------------------------------------------------------------------------
def calculate_appointments(new_set, old_set):
"""
Calculate different appointment types. Used for making useful distinctions in the email message
Ex1: Addition of HONEOYE
new_set = {'LIVERPOOL', 'BROOKLYN', 'HONEOYE', 'KINGSTON'}
old_set = {'LIVERPOOL', 'BROOKLYN', 'KINGSTON'}
returns ->->
new_appointments = {'HONEOYE'}
old_appointments = {'LIVERPOOL', 'BROOKLYN', 'KINGSTON'}
Ex2: No Changes
new_set = {'LIVERPOOL', 'BROOKLYN', 'HONEOYE', 'KINGSTON'}
old_set = {'LIVERPOOL', 'BROOKLYN', 'HONEOYE', 'KINGSTON'}
returns ->->
new_appointments = set() (empty set)
old_appointments = {'LIVERPOOL', 'BROOKLYN', 'HONEOYE', 'KINGSTON'}
"""
new_appointments = new_set.difference(old_set) # New minus Old
old_appointments = new_set.intersection(old_set) # New ∩ Old
return new_appointments, old_appointments # Return resulting sets
# ----------------------------------------------------------------------------------------------------------------------
"""
__ __ _____ _ _ ______ _ _ _ _ _____ _______ _____ ____ _ _
| \/ | /\ |_ _| | \ | | | ____| | | | | | \ | | / ____| |__ __| |_ _| / __ \ | \ | |
| \ / | / \ | | | \| | | |__ | | | | | \| | | | | | | | | | | | | \| |
| |\/| | / /\ \ | | | . ` | | __| | | | | | . ` | | | | | | | | | | | | . ` |
| | | | / ____ \ _| |_ | |\ | | | | |__| | | |\ | | |____ | | _| |_ | |__| | | |\ |
|_| |_| /_/ \_\ |_____| |_| \_| |_| \____/ |_| \_| \_____| |_| |_____| \____/ |_| \_|
"""
# ----------------------------------------------------------------------------------------------------------------------
def check_cvs(previous_appointments):
"""
This function repeatedly reads the CVS website, and if any appointments are available in your state, it emails you.
Terminology definitions:
previous_appointments = set of available cites from previous check / empty set (if first time running program)
fresh_appointments = set of available cities after checking the link
new_appointments = set of cities available that are available now but not in the previous check
old_appointments = set of cities available that are available now but were also available in the previous check
Note: old_appointments is currently not used in any meaningful way but is there for further customization
"""
# Useful information to print to the terminal for some visuals
print("Looking for appointments in " + collection_2_sentence(set(STATES))
+ " at " + str(time.strftime('%H:%M:%S', time.localtime())))
# Get all available appointments from the CVS website
fresh_appointments = get_available_appointments()
# Calculate different appointment types. Used for making useful distinctions in the email message
new_appointments, old_appointments = calculate_appointments(fresh_appointments, previous_appointments)
# Used for testing but also can print all cities on each check of the function if desired
print("New Appointments: " + collection_2_sentence(new_appointments))
# print("Old Appointments: " + collection_2_sentence(old_appointments))
print("All Available Appointments: " + collection_2_sentence(fresh_appointments) + '\n')
# Sets the email as an HTML string to sent to the user
email_message = build_email_message(new_appointments, fresh_appointments)
# If there is a new city with appointments available that wasn't available in the last check, sends an email
if new_appointments:
print("Found an appointment!!! \n") # Pretty visual for the terminal
# Send email to user with given message
send_email(email_message)
# Returns updated set of appointments to be inputted as previous_appointments in the next function run
return fresh_appointments
# ----------------------------------------------------------------------------------------------------------------------
"""
_____ _ _ _ _ ______ _ _ _ _ _____ _______ _____ ____ _ _
| __ \ | | | | | \ | | | ____| | | | | | \ | | / ____| |__ __| |_ _| / __ \ | \ | |
| |__) | | | | | | \| | | |__ | | | | | \| | | | | | | | | | | | | \| |
| _ / | | | | | . ` | | __| | | | | | . ` | | | | | | | | | | | | . ` |
| | \ \ | |__| | | |\ | | | | |__| | | |\ | | |____ | | _| |_ | |__| | | |\ |
|_| \_\ \____/ |_| \_| |_| \____/ |_| \_| \_____| |_| |_____| \____/ |_| \_|
"""
# ----------------------------------------------------------------------------------------------------------------------
def main():
# Verifies the user's inputs
user_input_verification()
# Make the initial set of available appointments an empty set
previous_appointments = set()
# Runs Forever
while True:
try:
# Repeatedly checks CVS every minute or amount of time specified
previous_appointments = check_cvs(previous_appointments)
time.sleep(UPDATE_TIME)
# Quits the program if you click Control/Command C
except KeyboardInterrupt:
break
# ----------------------------------------------------------------------------------------------------------------------
# Actually runs the function when called
if __name__ == '__main__':
main() |
ZweiChen0328/weiqi | client.py | import socket
HOST = '127.0.0.1'
PORT = 8000
clientMessage = 'Hello!'
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST, PORT))
client.sendall(clientMessage.encode())
serverMessage = str(client.recv(1024), encoding='utf-8')
print('Server:', serverMessage)
client.close() |
ZweiChen0328/weiqi | db.py | <filename>db.py<gh_stars>1-10
import sqlite3 #匯入sqlite3
cx = sqlite3.connect('./train.db') #建立資料庫,如果資料庫已經存在,則連結資料庫;如果資料庫不存在,則先建立資料庫,再連結該資料庫。
cu = cx.cursor() #定義一個遊標,以便獲得查詢物件。
cu.execute('create table if not exists train4 (Chinese text,English text)') #建立表
fr = open('food.txt',encoding="utf-8") #開啟要讀取的txt檔案
i = 0
for line in fr.readlines(): #將資料按行插入資料庫的表train4中。
line2 = line.split('\t')
print(line2[0])
print(line2[1])
cu.execute('insert into train4 (Chinese,English) values(?,?)',(line2[0],line2[1]))
i=i+1
cu.close() #關閉遊標
cx.commit() #事務提交
cx.close() #關閉資料庫 |
ZweiChen0328/weiqi | weiqi_online_2.py | <gh_stars>1-10
#!/usr/bin/python3
# 使用Python内建GUI模組tkinter
from tkinter import *
# ttk覆寫tkinter部分物件,ttk對tkinter進行了優化
from tkinter.ttk import *
# deepcopy需要用到copy模組
from MyOwnPeer2PeerNode import MyOwnPeer2PeerNode
import copy
import tkinter.messagebox
import sys
import time
import threading
sys.path.insert(0, '..') # Import the files where the modules are located
# 围棋應用物件定義
class model(Tk):
def __init__(self, my_mode_num=19):
Tk.__init__(self)
# 連接端口
global Node
self.node = Node
# 主導權限
self.dominance = Dominance
# 模式,九路棋:9,十三路棋:13,十九路棋:19
self.mode_num = my_mode_num
# 棋盤尺寸設置基準值,預設:1.6
self.size = 1.6
# 棋盤每格的邊長
self.dd = 360 * self.size / (self.mode_num - 1)
# 相對於九路棋盤的校正比例
self.p = 1 if self.mode_num == 9 else (2 / 3 if self.mode_num == 13 else 4 / 9)
# 定義棋盤陣列,超過邊界:-1,無子:0,黑棋:1,白棋:2
self.positions = [[0 for i in range(self.mode_num + 2)] for i in range(self.mode_num + 2)]
# 初始化棋盤,所有超過邊界的值設為-1
for m in range(self.mode_num + 2):
for n in range(self.mode_num + 2):
if m * n == 0 or m == self.mode_num + 1 or n == self.mode_num + 1:
self.positions[m][n] = -1
# 拷貝三份棋盤“快照”,悔棋和判斷“打劫”時需要参考
self.last_3_positions = copy.deepcopy(self.positions)
self.last_2_positions = copy.deepcopy(self.positions)
self.last_1_positions = copy.deepcopy(self.positions)
# 紀錄每一手的落子點,作為棋譜紀錄
self.record = []
self.record_take = []
# 記錄滑鼠經過的地方,用於顯示打算落子的棋子shadow
self.cross_last = None
# 當前輪到的玩家,黑:0,白:1,執黑先行
self.present = 0
# 初始時停止運行,點擊“開始對局”才開始運行
self.stop = True
# 悔棋次数,次数大於0才可悔棋,初始設為0(初始不能悔棋),悔棋後重置0,下棋或虛手pass時恢復為1,以禁止連續悔棋
# 圖片來源,存放在當前目錄下的/Pictures/中
self.photoW = PhotoImage(file="./Pictures/W.png")
self.photoB = PhotoImage(file="./Pictures/B.png")
self.photoBD = PhotoImage(file="./Pictures/" + "BD" + "-" + str(self.mode_num) + ".png")
self.photoWD = PhotoImage(file="./Pictures/" + "WD" + "-" + str(self.mode_num) + ".png")
self.photoBU = PhotoImage(file="./Pictures/" + "BU" + "-" + str(self.mode_num) + ".png")
self.photoWU = PhotoImage(file="./Pictures/" + "WU" + "-" + str(self.mode_num) + ".png")
# 用於黑白棋子圖片切换的列表
self.photoWBU_list = [self.photoBU, self.photoWU]
self.photoWBD_list = [self.photoBD, self.photoWD]
# 視窗大小
self.geometry(str(int(600 * self.size)) + 'x' + str(int(400 * self.size)))
# 畫布控制物件,作爲容器
self.canvas_bottom = Canvas(self, bg='#369', bd=0, width=600 * self.size, height=400 * self.size)
self.canvas_bottom.place(x=0, y=0)
# 畫棋盤,填充顏色
self.canvas_bottom.create_rectangle(0 * self.size, 0 * self.size, 400 * self.size, 400 * self.size,
fill='#FFD700')
# 刻畫棋盤線及九個點
# 先畫外框粗線
self.canvas_bottom.create_rectangle(20 * self.size, 20 * self.size, 380 * self.size, 380 * self.size, width=3)
# 棋盤上的九個定位點,以中點為模型,移動位置以作出其餘八個點
for m in ([-1, 1] if self.mode_num == 9 else ([-1, 1] if self.mode_num == 13 else [-1, 0, 1])):
for n in ([-1, 1] if self.mode_num == 9 else ([-1, 1] if self.mode_num == 13 else [-1, 0, 1])):
self.oringinal = self.canvas_bottom.create_oval(200 * self.size - self.size * 2,
200 * self.size - self.size * 2,
200 * self.size + self.size * 2,
200 * self.size + self.size * 2, fill='#000')
self.canvas_bottom.move(self.oringinal,
m * self.dd * (2 if self.mode_num == 9 else (3 if self.mode_num == 13 else 6)),
n * self.dd * (2 if self.mode_num == 9 else (3 if self.mode_num == 13 else 6)))
if self.mode_num == 13:
self.oringinal = self.canvas_bottom.create_oval(200 * self.size - self.size * 2,
200 * self.size - self.size * 2,
200 * self.size + self.size * 2,
200 * self.size + self.size * 2, fill='#000')
# 畫中間的線條
for i in range(1, self.mode_num - 1):
self.canvas_bottom.create_line(20 * self.size, 20 * self.size + i * self.dd, 380 * self.size,
20 * self.size + i * self.dd, width=2)
self.canvas_bottom.create_line(20 * self.size + i * self.dd, 20 * self.size, 20 * self.size + i * self.dd,
380 * self.size, width=2)
# 放置右側初始圖片
self.pW = self.canvas_bottom.create_image(500 * self.size + 11, 65 * self.size, image=self.photoW)
self.pB = self.canvas_bottom.create_image(500 * self.size - 11, 65 * self.size, image=self.photoB)
# 每張圖片都添加image標籤,方便reload函式删除圖片
self.canvas_bottom.addtag_withtag('image', self.pW)
self.canvas_bottom.addtag_withtag('image', self.pB)
def recover(self, list_to_recover, b_or_w):
if len(list_to_recover) > 0:
for i in range(len(list_to_recover)):
self.positions[list_to_recover[i][1]][list_to_recover[i][0]] = b_or_w + 1
self.image_added = self.canvas_bottom.create_image(
20 * self.size + (list_to_recover[i][0] - 1) * self.dd + 4 * self.p,
20 * self.size + (list_to_recover[i][1] - 1) * self.dd - 5 * self.p,
image=self.photoWBD_list[b_or_w])
self.canvas_bottom.addtag_withtag('image', self.image_added)
self.canvas_bottom.addtag_withtag('position' + str(list_to_recover[i][0]) + str(list_to_recover[i][1]),
self.image_added)
def get_deadlist(self, x, y):
deadlist = []
for i in [-1, 1]:
if self.positions[y][x + i] == (2 if self.present == 0 else 1) and ([x + i, y] not in deadlist):
killList = self.if_dead([[x + i, y]], (2 if self.present == 0 else 1), [x + i, y])
if not killList == False:
deadlist += copy.deepcopy(killList)
if self.positions[y + i][x] == (2 if self.present == 0 else 1) and ([x, y + i] not in deadlist):
killList = self.if_dead([[x, y + i]], (2 if self.present == 0 else 1), [x, y + i])
if not killList == False:
deadlist += copy.deepcopy(killList)
return deadlist
def if_dead(self, deadList, yourChessman, yourPosition):
for i in [-1, 1]:
if [yourPosition[0] + i, yourPosition[1]] not in deadList:
if self.positions[yourPosition[1]][yourPosition[0] + i] == 0:
return False
if [yourPosition[0], yourPosition[1] + i] not in deadList:
if self.positions[yourPosition[1] + i][yourPosition[0]] == 0:
return False
if ([yourPosition[0] + 1, yourPosition[1]] not in deadList) and (
self.positions[yourPosition[1]][yourPosition[0] + 1] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0] + 1, yourPosition[1]]], yourChessman,
[yourPosition[0] + 1, yourPosition[1]])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
if ([yourPosition[0] - 1, yourPosition[1]] not in deadList) and (
self.positions[yourPosition[1]][yourPosition[0] - 1] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0] - 1, yourPosition[1]]], yourChessman,
[yourPosition[0] - 1, yourPosition[1]])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
if ([yourPosition[0], yourPosition[1] + 1] not in deadList) and (
self.positions[yourPosition[1] + 1][yourPosition[0]] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0], yourPosition[1] + 1]], yourChessman,
[yourPosition[0], yourPosition[1] + 1])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
if ([yourPosition[0], yourPosition[1] - 1] not in deadList) and (
self.positions[yourPosition[1] - 1][yourPosition[0]] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0], yourPosition[1] - 1]], yourChessman,
[yourPosition[0], yourPosition[1] - 1])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
return deadList
def kill(self, killList):
if len(killList) > 0:
for i in range(len(killList)):
self.positions[killList[i][1]][killList[i][0]] = 0
self.canvas_bottom.delete('position' + str(killList[i][0]) + str(killList[i][1]))
def getDown(self, x, y):
self.positions[y][x] = self.present + 1
ex = 30 + self.dd * (x - 1)
ey = 30 + self.dd * (y - 1)
dx = (ex - 20 * self.size) % self.dd
dy = (ey - 20 * self.size) % self.dd
self.image_added = self.canvas_bottom.create_image(
ex - dx + round(dx / self.dd) * self.dd + 4 * self.p,
ey - dy + round(dy / self.dd) * self.dd - 5 * self.p,
image=self.photoWBD_list[self.present])
self.canvas_bottom.addtag_withtag('image', self.image_added)
# 棋子與位置標籤绑定,方便“殺死”
self.canvas_bottom.addtag_withtag('position' + str(x) + str(y), self.image_added)
deadlist = self.get_deadlist(x, y)
self.kill(deadlist)
if len(deadlist) > 0:
temp = []
for d in deadlist:
temp.append([d[0], d[1]])
self.record_take.append(temp)
else:
self.record_take.append([])
self.last_3_positions = copy.deepcopy(self.last_2_positions)
self.last_2_positions = copy.deepcopy(self.last_1_positions)
self.last_1_positions = copy.deepcopy(self.positions)
# 删除上次的標記,重新創建標記
self.canvas_bottom.delete('image_added_sign')
self.image_added_sign = self.canvas_bottom.create_oval(
ex - dx + round(dx / self.dd) * self.dd + 0.5 * self.dd,
ey - dy + round(dy / self.dd) * self.dd + 0.5 * self.dd,
ex - dx + round(dx / self.dd) * self.dd - 0.5 * self.dd,
ey - dy + round(dy / self.dd) * self.dd - 0.5 * self.dd, width=3, outline='#3ae')
self.canvas_bottom.addtag_withtag('image', self.image_added_sign)
self.canvas_bottom.addtag_withtag('image_added_sign', self.image_added_sign)
if self.present == 0:
self.create_pW()
self.del_pB()
self.present = 1
else:
self.create_pB()
self.del_pW()
self.present = 0
def create_pW(self):
self.pW = self.canvas_bottom.create_image(500 * self.size + 11, 65 * self.size, image=self.photoW)
self.canvas_bottom.addtag_withtag('image', self.pW)
def create_pB(self):
self.pB = self.canvas_bottom.create_image(500 * self.size - 11, 65 * self.size, image=self.photoB)
self.canvas_bottom.addtag_withtag('image', self.pB)
def del_pW(self):
self.canvas_bottom.delete(self.pW)
def del_pB(self):
self.canvas_bottom.delete(self.pB)
class model2(Toplevel):
def __init__(self,main=None, my_mode_num=19):
Toplevel.__init__(self, main)
# 連接端口
global Node
self.node = Node
# 主導權限
self.dominance = Dominance
# 模式,九路棋:9,十三路棋:13,十九路棋:19
self.mode_num = my_mode_num
# 棋盤尺寸設置基準值,預設:1.6
self.size = 1.6
# 棋盤每格的邊長
self.dd = 360 * self.size / (self.mode_num - 1)
# 相對於九路棋盤的校正比例
self.p = 1 if self.mode_num == 9 else (2 / 3 if self.mode_num == 13 else 4 / 9)
# 定義棋盤陣列,超過邊界:-1,無子:0,黑棋:1,白棋:2
self.positions = [[0 for i in range(self.mode_num + 2)] for i in range(self.mode_num + 2)]
# 初始化棋盤,所有超過邊界的值設為-1
for m in range(self.mode_num + 2):
for n in range(self.mode_num + 2):
if m * n == 0 or m == self.mode_num + 1 or n == self.mode_num + 1:
self.positions[m][n] = -1
# 拷貝三份棋盤“快照”,悔棋和判斷“打劫”時需要参考
self.last_3_positions = copy.deepcopy(self.positions)
self.last_2_positions = copy.deepcopy(self.positions)
self.last_1_positions = copy.deepcopy(self.positions)
# 紀錄每一手的落子點,作為棋譜紀錄
self.record = []
self.record_take = []
# 記錄滑鼠經過的地方,用於顯示打算落子的棋子shadow
self.cross_last = None
# 當前輪到的玩家,黑:0,白:1,執黑先行
self.present = 0
# 初始時停止運行,點擊“開始對局”才開始運行
self.stop = True
# 悔棋次数,次数大於0才可悔棋,初始設為0(初始不能悔棋),悔棋後重置0,下棋或虛手pass時恢復為1,以禁止連續悔棋
# 圖片來源,存放在當前目錄下的/Pictures/中
self.photoW = PhotoImage(file="./Pictures/W.png")
self.photoB = PhotoImage(file="./Pictures/B.png")
self.photoBD = PhotoImage(file="./Pictures/" + "BD" + "-" + str(self.mode_num) + ".png")
self.photoWD = PhotoImage(file="./Pictures/" + "WD" + "-" + str(self.mode_num) + ".png")
self.photoBU = PhotoImage(file="./Pictures/" + "BU" + "-" + str(self.mode_num) + ".png")
self.photoWU = PhotoImage(file="./Pictures/" + "WU" + "-" + str(self.mode_num) + ".png")
# 用於黑白棋子圖片切换的列表
self.photoWBU_list = [self.photoBU, self.photoWU]
self.photoWBD_list = [self.photoBD, self.photoWD]
# 視窗大小
self.geometry(str(int(600 * self.size)) + 'x' + str(int(400 * self.size)))
# 畫布控制物件,作爲容器
self.canvas_bottom = Canvas(self, bg='#369', bd=0, width=600 * self.size, height=400 * self.size)
self.canvas_bottom.place(x=0, y=0)
# 畫棋盤,填充顏色
self.canvas_bottom.create_rectangle(0 * self.size, 0 * self.size, 400 * self.size, 400 * self.size,
fill='#FFD700')
# 刻畫棋盤線及九個點
# 先畫外框粗線
self.canvas_bottom.create_rectangle(20 * self.size, 20 * self.size, 380 * self.size, 380 * self.size, width=3)
# 棋盤上的九個定位點,以中點為模型,移動位置以作出其餘八個點
for m in ([-1, 1] if self.mode_num == 9 else ([-1, 1] if self.mode_num == 13 else [-1, 0, 1])):
for n in ([-1, 1] if self.mode_num == 9 else ([-1, 1] if self.mode_num == 13 else [-1, 0, 1])):
self.oringinal = self.canvas_bottom.create_oval(200 * self.size - self.size * 2,
200 * self.size - self.size * 2,
200 * self.size + self.size * 2,
200 * self.size + self.size * 2, fill='#000')
self.canvas_bottom.move(self.oringinal,
m * self.dd * (2 if self.mode_num == 9 else (3 if self.mode_num == 13 else 6)),
n * self.dd * (2 if self.mode_num == 9 else (3 if self.mode_num == 13 else 6)))
if self.mode_num == 13:
self.oringinal = self.canvas_bottom.create_oval(200 * self.size - self.size * 2,
200 * self.size - self.size * 2,
200 * self.size + self.size * 2,
200 * self.size + self.size * 2, fill='#000')
# 畫中間的線條
for i in range(1, self.mode_num - 1):
self.canvas_bottom.create_line(20 * self.size, 20 * self.size + i * self.dd, 380 * self.size,
20 * self.size + i * self.dd, width=2)
self.canvas_bottom.create_line(20 * self.size + i * self.dd, 20 * self.size, 20 * self.size + i * self.dd,
380 * self.size, width=2)
# 放置右側初始圖片
self.pW = self.canvas_bottom.create_image(500 * self.size + 11, 65 * self.size, image=self.photoW)
self.pB = self.canvas_bottom.create_image(500 * self.size - 11, 65 * self.size, image=self.photoB)
# 每張圖片都添加image標籤,方便reload函式删除圖片
self.canvas_bottom.addtag_withtag('image', self.pW)
self.canvas_bottom.addtag_withtag('image', self.pB)
def recover(self, list_to_recover, b_or_w):
if len(list_to_recover) > 0:
for i in range(len(list_to_recover)):
self.positions[list_to_recover[i][1]][list_to_recover[i][0]] = b_or_w + 1
self.image_added = self.canvas_bottom.create_image(
20 * self.size + (list_to_recover[i][0] - 1) * self.dd + 4 * self.p,
20 * self.size + (list_to_recover[i][1] - 1) * self.dd - 5 * self.p,
image=self.photoWBD_list[b_or_w])
self.canvas_bottom.addtag_withtag('image', self.image_added)
self.canvas_bottom.addtag_withtag('position' + str(list_to_recover[i][0]) + str(list_to_recover[i][1]),
self.image_added)
def get_deadlist(self, x, y):
deadlist = []
for i in [-1, 1]:
if self.positions[y][x + i] == (2 if self.present == 0 else 1) and ([x + i, y] not in deadlist):
killList = self.if_dead([[x + i, y]], (2 if self.present == 0 else 1), [x + i, y])
if not killList == False:
deadlist += copy.deepcopy(killList)
if self.positions[y + i][x] == (2 if self.present == 0 else 1) and ([x, y + i] not in deadlist):
killList = self.if_dead([[x, y + i]], (2 if self.present == 0 else 1), [x, y + i])
if not killList == False:
deadlist += copy.deepcopy(killList)
return deadlist
def if_dead(self, deadList, yourChessman, yourPosition):
for i in [-1, 1]:
if [yourPosition[0] + i, yourPosition[1]] not in deadList:
if self.positions[yourPosition[1]][yourPosition[0] + i] == 0:
return False
if [yourPosition[0], yourPosition[1] + i] not in deadList:
if self.positions[yourPosition[1] + i][yourPosition[0]] == 0:
return False
if ([yourPosition[0] + 1, yourPosition[1]] not in deadList) and (
self.positions[yourPosition[1]][yourPosition[0] + 1] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0] + 1, yourPosition[1]]], yourChessman,
[yourPosition[0] + 1, yourPosition[1]])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
if ([yourPosition[0] - 1, yourPosition[1]] not in deadList) and (
self.positions[yourPosition[1]][yourPosition[0] - 1] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0] - 1, yourPosition[1]]], yourChessman,
[yourPosition[0] - 1, yourPosition[1]])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
if ([yourPosition[0], yourPosition[1] + 1] not in deadList) and (
self.positions[yourPosition[1] + 1][yourPosition[0]] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0], yourPosition[1] + 1]], yourChessman,
[yourPosition[0], yourPosition[1] + 1])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
if ([yourPosition[0], yourPosition[1] - 1] not in deadList) and (
self.positions[yourPosition[1] - 1][yourPosition[0]] == yourChessman):
midvar = self.if_dead(deadList + [[yourPosition[0], yourPosition[1] - 1]], yourChessman,
[yourPosition[0], yourPosition[1] - 1])
if not midvar:
return False
else:
deadList += copy.deepcopy(midvar)
return deadList
def kill(self, killList):
if len(killList) > 0:
for i in range(len(killList)):
self.positions[killList[i][1]][killList[i][0]] = 0
self.canvas_bottom.delete('position' + str(killList[i][0]) + str(killList[i][1]))
def getDown(self, x, y):
self.positions[y][x] = self.present + 1
ex = 30 + self.dd * (x - 1)
ey = 30 + self.dd * (y - 1)
dx = (ex - 20 * self.size) % self.dd
dy = (ey - 20 * self.size) % self.dd
self.image_added = self.canvas_bottom.create_image(
ex - dx + round(dx / self.dd) * self.dd + 4 * self.p,
ey - dy + round(dy / self.dd) * self.dd - 5 * self.p,
image=self.photoWBD_list[self.present])
self.canvas_bottom.addtag_withtag('image', self.image_added)
# 棋子與位置標籤绑定,方便“殺死”
self.canvas_bottom.addtag_withtag('position' + str(x) + str(y), self.image_added)
deadlist = self.get_deadlist(x, y)
self.kill(deadlist)
if len(deadlist) > 0:
temp = []
for d in deadlist:
temp.append([d[0], d[1]])
self.record_take.append(temp)
else:
self.record_take.append([])
self.last_3_positions = copy.deepcopy(self.last_2_positions)
self.last_2_positions = copy.deepcopy(self.last_1_positions)
self.last_1_positions = copy.deepcopy(self.positions)
# 删除上次的標記,重新創建標記
self.canvas_bottom.delete('image_added_sign')
self.image_added_sign = self.canvas_bottom.create_oval(
ex - dx + round(dx / self.dd) * self.dd + 0.5 * self.dd,
ey - dy + round(dy / self.dd) * self.dd + 0.5 * self.dd,
ex - dx + round(dx / self.dd) * self.dd - 0.5 * self.dd,
ey - dy + round(dy / self.dd) * self.dd - 0.5 * self.dd, width=3, outline='#3ae')
self.canvas_bottom.addtag_withtag('image', self.image_added_sign)
self.canvas_bottom.addtag_withtag('image_added_sign', self.image_added_sign)
if self.present == 0:
self.create_pW()
self.del_pB()
self.present = 1
else:
self.create_pB()
self.del_pW()
self.present = 0
def create_pW(self):
self.pW = self.canvas_bottom.create_image(500 * self.size + 11, 65 * self.size, image=self.photoW)
self.canvas_bottom.addtag_withtag('image', self.pW)
def create_pB(self):
self.pB = self.canvas_bottom.create_image(500 * self.size - 11, 65 * self.size, image=self.photoB)
self.canvas_bottom.addtag_withtag('image', self.pB)
def del_pW(self):
self.canvas_bottom.delete(self.pW)
def del_pB(self):
self.canvas_bottom.delete(self.pB)
class Application(model):
# 初始化棋盤,預設十九路棋盤
def __init__(self):
model.__init__(self, mode_num)
# 幾個功能按钮
self.startButton = Button(self, text='開始對局', command=self.start)
self.startButton.place(x=420 * self.size, y=200 * self.size)
self.passmeButton = Button(self, text='停一手', command=self.passme)
self.passmeButton.place(x=420 * self.size, y=225 * self.size)
self.regretButton = Button(self, text='悔棋', command=self.regret)
self.regretButton.place(x=420 * self.size, y=250 * self.size)
self.replayButton = Button(self, text='重新開始', command=self.reload)
self.replayButton.place(x=420 * self.size, y=275 * self.size)
self.newGameButton1 = Button(self, text=('十三' if self.mode_num == 9 else '九') + '路棋', command=self.newGame1)
self.newGameButton1.place(x=420 * self.size, y=300 * self.size)
self.newGameButton2 = Button(self, text=('十三' if self.mode_num == 19 else '十九') + '路棋', command=self.newGame2)
self.newGameButton2.place(x=420 * self.size, y=325 * self.size)
self.quitButton = Button(self, text='退出棋局', command=self.quit)
self.quitButton.place(x=420 * self.size, y=350 * self.size)
self.territoryButton = Button(self, text='算地', command=self.territory)
self.territoryButton.place(x=500 * self.size, y=200 * self.size)
self.recordButton1 = Button(self, text='棋譜匯出', command=self.save_record)
self.recordButton1.place(x=500 * self.size, y=225 * self.size)
self.recordButton2 = Button(self, text='棋譜匯入', command=self.load_record)
self.recordButton2.place(x=500 * self.size, y=250 * self.size)
# 初始悔棋、停手按钮禁用
self.startButton['state'] = DISABLED
self.newGameButton1['state'] = DISABLED
self.newGameButton2['state'] = DISABLED
self.passmeButton['state'] = DISABLED
self.regretButton['state'] = DISABLED
self.replayButton['state'] = DISABLED
self.territoryButton['state'] = DISABLED
self.recordButton2['state'] = DISABLED
# 滑鼠移动時,呼叫shadow函式,显示随滑鼠移动的棋子
self.canvas_bottom.bind('<Motion>', self.shadow)
# 滑鼠左键单击時,呼叫getdown函式,放下棋子
self.canvas_bottom.bind('<Button-1>', self.getDown)
# 设置退出快捷键<Ctrl>+<D>,快速退出遊戲
self.bind('<Control-KeyPress-d>', self.keyboardQuit)
self.t = threading.Thread(target=self.connect)
self.t.start()
# 開始對局函式,點擊“開始對局”時呼叫
def start(self):
# 按鈕解除
self.newGameButton1['state'] = DISABLED
self.newGameButton2['state'] = DISABLED
self.startButton['state'] = DISABLED
self.territoryButton['state'] = NORMAL
# 删除右側太極圖
self.canvas_bottom.delete(self.pW)
self.canvas_bottom.delete(self.pB)
# 利用右側圖案提示開始時誰先落子
if self.present == 0:
self.create_pB()
self.del_pW()
self.stop = False
self.passmeButton['state'] = NORMAL
self.node.myNode.send_to_nodes({"Start": True})
else:
self.create_pW()
self.del_pB()
# 開始標誌,解除stop
# 放棄一手函式,跳過落子環節
def passme(self):
# 悔棋恢復
# 拷貝棋盤狀態,記錄前三次棋局
self.last_3_positions = copy.deepcopy(self.last_2_positions)
self.last_2_positions = copy.deepcopy(self.last_1_positions)
self.last_1_positions = copy.deepcopy(self.positions)
self.canvas_bottom.delete('image_added_sign')
# 輪到下一玩家
if self.present == 0:
self.create_pW()
self.del_pB()
self.present = 1
else:
self.create_pB()
self.del_pW()
self.present = 0
if not self.stop:
self.node.myNode.send_to_nodes({"pass": True})
self.stop = True
else:
self.stop = False
# 悔棋函式,可悔棋一回合,下两回合不可悔棋
def regret(self):
# 判定是否可以悔棋,以前第三盤棋局復原棋盤
list_of_b = []
list_of_w = []
self.canvas_bottom.delete('image')
if self.present == 0:
self.create_pB()
else:
self.create_pW()
for m in range(1, self.mode_num + 1):
for n in range(1, self.mode_num + 1):
self.positions[m][n] = 0
for m in range(len(self.last_3_positions)):
for n in range(len(self.last_3_positions[m])):
if self.last_3_positions[m][n] == 1:
list_of_b += [[n, m]]
elif self.last_3_positions[m][n] == 2:
list_of_w += [[n, m]]
self.recover(list_of_b, 0)
self.recover(list_of_w, 1)
self.last_1_positions = copy.deepcopy(self.last_3_positions)
self.record = copy.deepcopy(self.record[:-2])
self.record_take = copy.deepcopy(self.record_take[:-2])
# 判斷是否還能悔棋
if len(self.record) < 2:
self.regretButton['state'] = DISABLED
# 重建last_2_positions、last_3_positions
for m in range(1, self.mode_num + 1):
for n in range(1, self.mode_num + 1):
self.last_2_positions[m][n] = 0
self.last_3_positions[m][n] = 0
# 根據record恢復棋盤
for r in self.record[:-2]:
if r[2] == 1:
self.last_3_positions[r[1]][r[0]] = 1
elif r[2] == 2:
self.last_3_positions[r[1]][r[0]] = 2
for r in self.record[:-1]:
if r[2] == 1:
self.last_2_positions[r[1]][r[0]] = 1
elif r[2] == 2:
self.last_2_positions[r[1]][r[0]] = 2
# 判斷是否為死棋
if len(self.record_take) > 2:
for t in self.record_take[-3]:
self.last_3_positions[t[1]][t[0]] = 0
if len(self.record_take) > 1:
for t in self.record_take[-2]:
self.last_2_positions[t[1]][t[0]] = 0
# 判斷是否為被吃子
if len(self.record_take) > 1:
for t in self.record_take[-2]:
if self.present == 1:
self.last_3_positions[t[1]][t[0]] = 1
else:
self.last_3_positions[t[1]][t[0]] = 2
if len(self.record_take) > 0:
for t in self.record_take[-1]:
if self.present == 1:
self.last_2_positions[t[1]][t[0]] = 2
else:
self.last_2_positions[t[1]][t[0]] = 1
if not self.stop:
self.node.myNode.send_to_nodes({"regret": True})
# 點擊“重新開始”時呼叫重新加載函式,删除圖片,序列歸零,設置一些初始参數
def reload(self):
self.stop = True
self.regretButton['state'] = DISABLED
self.passmeButton['state'] = DISABLED
self.territoryButton['state'] = DISABLED
self.canvas_bottom.delete('image')
self.present = 0
self.create_pB()
self.create_pW()
self.record = []
self.record_take = []
for m in range(1, self.mode_num + 1):
for n in range(1, self.mode_num + 1):
self.positions[m][n] = 0
self.last_3_positions[m][n] = 0
self.last_2_positions[m][n] = 0
self.last_1_positions[m][n] = 0
if self.dominance:
self.node.myNode.send_to_nodes({"reload": True})
self.startButton['state'] = NORMAL
self.newGameButton1['state'] = NORMAL
self.newGameButton2['state'] = NORMAL
# 顯示滑鼠移動下預定落子的位置
def shadow(self, event):
if not self.stop:
# 找到最近格點,在當前位置靠近格點的可落子處顯示棋子圖片,並删除上一位置的棋子圖片
if (20 * self.size < event.x < 380 * self.size) and (20 * self.size < event.y < 380 * self.size):
dx = (event.x - 20 * self.size) % self.dd
dy = (event.y - 20 * self.size) % self.dd
x = int((event.x - 20 * self.size - dx) / self.dd + round(dx / self.dd) + 1)
y = int((event.y - 20 * self.size - dy) / self.dd + round(dy / self.dd) + 1)
# 判断該位置是否已有棋子
if self.positions[y][x] == 0:
self.cross = self.canvas_bottom.create_image(
event.x - dx + round(dx / self.dd) * self.dd + 22 * self.p,
event.y - dy + round(dy / self.dd) * self.dd - 27 * self.p,
image=self.photoWBU_list[self.present])
self.canvas_bottom.addtag_withtag('image', self.cross)
if self.cross_last is not None:
self.canvas_bottom.delete(self.cross_last)
self.cross_last = self.cross
else:
if self.cross_last is not None:
self.canvas_bottom.delete(self.cross_last)
def territory(self):
if not self.stop:
for y in range(self.mode_num):
print()
for x in range(self.mode_num):
count = 0
mag = 1
for i in [-1, 3]:
if not (y + i == -1 or y + i == 21):
if self.getTerritory(self.positions[y + i][x + 1]) is not None:
count += self.getTerritory(self.positions[y + i][x + 1])
if not (x + i == -1 or x + i == 21):
if self.getTerritory(self.positions[y + 1][x + i]) is not None:
count += self.getTerritory(self.positions[y + 1][x + i])
for m in [0, 2]:
for n in [0, 2]:
if self.getTerritory(self.positions[y + m][x + n]) is not None:
count += self.getTerritory(self.positions[y + m][x + n])
if self.getTerritory(self.positions[y + m][x + 1]) is not None:
count += self.getTerritory(self.positions[y + m][x + 1]) * 2
else:
mag += 0.25
if self.getTerritory(self.positions[y + 1][x + m]) is not None:
count += self.getTerritory(self.positions[y + 1][x + m]) * 2
else:
mag += 0.25
count += self.getTerritory(self.positions[y + 1][x + 1]) * 3
# if count!=0:
# print(x+1, y+1, count, mag, end=' ')
print(count, end=' ')
def save_record(self):
s = ''
print('數字位置:', self.record)
print('陣列位置:')
for p in self.positions[1:-1]:
print(p[1:-1])
for r in self.record:
if r[2] == 1:
s += ';' + 'B[' + chr(r[0] + 96) + chr(r[1] + 96) + ']'
else:
s += ';' + 'W[' + chr(r[0] + 96) + chr(r[1] + 96) + ']'
f = open('test.sgf', 'w')
f.write('(')
count = 0
for i in s:
f.write(i)
if i == ']':
count += 1
if count == 10:
f.write('\n')
count = 0
f.write(')')
f.close()
def load_record(self):
f = open('test.sgf', 'r')
print(f.read())
record = Application2(self)
record.mainloop()
record.destroy()
def getTerritory(self, clr):
if clr == -1:
return None
elif clr == 0:
return 0
elif clr == 1:
return 1
else:
return -1
# 落子,並驅動玩家的輪流下棋行為
def getDown(self, event):
if not self.stop:
# 先找到最近格點
if (20 * self.size - self.dd * 0.4 < event.x < self.dd * 0.4 + 380 * self.size) and (
20 * self.size - self.dd * 0.4 < event.y < self.dd * 0.4 + 380 * self.size):
dx = (event.x - 20 * self.size) % self.dd
dy = (event.y - 20 * self.size) % self.dd
x = int((event.x - 20 * self.size - dx) / self.dd + round(dx / self.dd) + 1)
y = int((event.y - 20 * self.size - dy) / self.dd + round(dy / self.dd) + 1)
# 判斷位置是否已經被占據
if self.positions[y][x] == 0:
# 未被占據,則嘗試占據,獲得占據後能殺死的棋子列表
self.positions[y][x] = self.present + 1
self.image_added = self.canvas_bottom.create_image(
event.x - dx + round(dx / self.dd) * self.dd + 4 * self.p,
event.y - dy + round(dy / self.dd) * self.dd - 5 * self.p,
image=self.photoWBD_list[self.present])
self.canvas_bottom.addtag_withtag('image', self.image_added)
# 棋子與位置標籤绑定,方便“殺死”
self.canvas_bottom.addtag_withtag('position' + str(x) + str(y), self.image_added)
deadlist = self.get_deadlist(x, y)
self.kill(deadlist)
# 判断是否重複棋局(打劫)
if not self.last_2_positions == self.positions:
# 判断是否有氣(避免不入子)或行棋後可殺棋提子
if len(deadlist) > 0 or self.if_dead([[x, y]], self.present + 1, [x, y]) == False:
# 當不重複棋局且並非不入子狀況下,即落子有效,並紀錄棋步
self.record.append([x, y, self.positions[y][x]])
if len(deadlist) > 0:
temp = []
for d in deadlist:
temp.append([d[0], d[1]])
self.record_take.append(temp)
else:
self.record_take.append([])
self.last_3_positions = copy.deepcopy(self.last_2_positions)
self.last_2_positions = copy.deepcopy(self.last_1_positions)
self.last_1_positions = copy.deepcopy(self.positions)
# 删除上次的標記,重新創建標記
self.canvas_bottom.delete('image_added_sign')
self.image_added_sign = self.canvas_bottom.create_oval(
event.x - dx + round(dx / self.dd) * self.dd + 0.5 * self.dd,
event.y - dy + round(dy / self.dd) * self.dd + 0.5 * self.dd,
event.x - dx + round(dx / self.dd) * self.dd - 0.5 * self.dd,
event.y - dy + round(dy / self.dd) * self.dd - 0.5 * self.dd, width=3, outline='#3ae')
self.canvas_bottom.addtag_withtag('image', self.image_added_sign)
self.canvas_bottom.addtag_withtag('image_added_sign', self.image_added_sign)
if len(self.record) > 1:
self.regretButton['state'] = NORMAL
# 切換是否可以下子
if self.stop:
self.stop = False
else:
self.stop = True
# 傳遞棋子位置給對方
if self.present == 0:
self.node.myNode.send_to_nodes({"player": "black", "positionX": x, "positionY": y})
else:
self.node.myNode.send_to_nodes({"player": "white", "positionX": x, "positionY": y})
self.regretButton['state'] = DISABLED
self.passmeButton['state'] = DISABLED
if self.present == 0:
self.create_pW()
self.del_pB()
self.present = 1
else:
self.create_pB()
self.del_pW()
self.present = 0
else:
# 不屬於殺死對方或有氣,則判断為無氣,警告並彈出警告訊息盒
self.positions[y][x] = 0
self.canvas_bottom.delete('position' + str(x) + str(y))
self.bell()
self.showwarningbox('沒氣了', "禁著點!")
else:
# 重複棋局,警告打劫
self.positions[y][x] = 0
self.canvas_bottom.delete('position' + str(x) + str(y))
self.recover(deadlist, (1 if self.present == 0 else 0))
self.bell()
self.showwarningbox("打劫", "不可提熱子!")
else:
# 落子重疊,聲音警告
self.bell()
else:
# 超出邊界,聲音警告
self.bell()
# 判断棋子(yourChessman:棋子種類係黑棋或白棋,yourPosition:棋子位置)是否無氣(死亡),有氣则返回False,無氣则返回無氣棋子的列表
# 本函式是對弈规则的關鍵,初始deadlist只包含了自己的位置,每次執行時,函式嘗試尋找yourPosition周圍有没有空的位置,有則结束並返回False代表有氣;
# 若找不到,則找自己四周的同類(不在deadlist中的)是否有氣(即遞回呼叫本函式),無氣,则把該同類加入到deadlist,然候找下一個鄰居,只要有一個有氣,則返回False代表有氣;
# 若四周没有一個有氣的同類,返回deadlist,至此结束遞回
# def if_dead(self,deadlist,yourChessman,yourPosition):
# 警告訊息顯示盒,接受標题和警告訊息
def showwarningbox(self, title, message):
self.canvas_bottom.delete(self.cross)
tkinter.messagebox.showwarning(title, message)
def connect(self):
t = threading.currentThread()
while getattr(t, "do_run", True):
if self.node.remote_id is None:
print('Waiting for other player...')
time.sleep(5)
else:
if self.node.myNode.connect_with_node(self.node.remote_id['ip'], self.node.remote_id['port']) is None:
print('Connecting...')
time.sleep(5)
else:
print('Connect Successfully')
t.do_run = False
if self.dominance:
self.startButton['state'] = NORMAL
self.newGameButton1['state'] = NORMAL
self.newGameButton2['state'] = NORMAL
self.replayButton['state'] = NORMAL
self.recordButton2['state'] = NORMAL
self.t = threading.Thread(target=self.handle)
self.t.start()
def handle(self):
t = threading.currentThread()
while getattr(t, "do_run", True):
if self.node.myNode.data is None:
print('test')
time.sleep(1)
else:
print(self.node.myNode.data)
key = list(self.node.myNode.data.keys())
data = list(self.node.myNode.data.values())
print(key)
print(data)
self.node.myNode.data = None
if key[0] == 'Start':
self.territoryButton['state'] = NORMAL
self.canvas_bottom.delete(self.pW)
self.canvas_bottom.delete(self.pB)
self.create_pB()
self.del_pW()
elif key[0] == 'player':
x = data[1]
y = data[2]
super(Application, self).getDown(x, y)
self.record.append([x, y, self.positions[y][x]])
self.stop = False
self.regretButton['state'] = NORMAL
self.passmeButton['state'] = NORMAL
elif key[0] == 'regret':
self.regret()
elif key[0] == 'pass':
self.passme()
elif key[0] == 'reload':
self.reload()
elif key[0] == 'mode':
if data[0] == 1:
self.newGame1()
if data[0] == 2:
self.newGame2()
else:
self.quit()
# 键盤快捷键退出遊戲
def keyboardQuit(self, event):
global Node
Node.node_.stop()
print('end test')
self.quit()
# 以下两個函式修改全局變量值,newApp使主函式循環,以建立不同参数的對象
def newGame1(self):
global mode_num, newApp
mode_num = (13 if self.mode_num == 9 else 9)
newApp = True
if self.dominance:
self.node.myNode.send_to_nodes({"mode": 1})
self.quit()
def newGame2(self):
global mode_num, newApp
mode_num = (13 if self.mode_num == 19 else 19)
newApp = True
if self.dominance:
self.node.myNode.send_to_nodes({"mode": 2})
self.quit()
def quit(self):
self.t.do_run = False
self.tk.quit()
class Application2(model2):
# 初始化棋盤,預設十九路棋盤
def __init__(self,main):
model2.__init__(self,main,mode_num)
self.record = self.load_record()
self.record_take = []
self.record_next = []
self.previousButton = Button(self, text='上一手', command=self.previousMove)
self.previousButton.place(x=420 * self.size, y=200 * self.size)
self.nextButton = Button(self, text='下一手', command=self.nextMove)
self.nextButton.place(x=420 * self.size, y=225 * self.size)
self.previousButton['state'] = DISABLED
self.nextButton['state'] = DISABLED
self.backButton = Button(self, text='返回', command=self.back)
self.backButton.place(x=420 * self.size, y=250 * self.size)
for r in self.record:
self.getDown(r[0], r[1])
if not self.record == []:
self.previousButton['state'] = NORMAL
def previousMove(self):
# for i in range(time):
list_of_b = []
list_of_w = []
self.canvas_bottom.delete('image')
if self.present == 1:
self.create_pB()
self.del_pW()
self.present = 0
else:
self.create_pW()
self.del_pB()
self.present = 1
for m in range(len(self.last_2_positions)):
for n in range(len(self.last_2_positions[m])):
if self.last_2_positions[m][n] == 1:
list_of_b += [[n, m]]
elif self.last_2_positions[m][n] == 2:
list_of_w += [[n, m]]
self.recover(list_of_b, 0)
self.recover(list_of_w, 1)
self.last_1_positions = copy.deepcopy(self.last_2_positions)
self.last_2_positions = copy.deepcopy(self.last_3_positions)
self.positions = copy.deepcopy(self.last_1_positions)
self.record_next.append(self.record[-1])
self.record = copy.deepcopy(self.record[:-1])
self.record_take = copy.deepcopy(self.record_take[:-1])
print(self.record)
# 判斷是否還有上一手
if len(self.record) < 1:
self.previousButton['state'] = DISABLED
if len(self.record_next) > 0:
self.nextButton['state'] = NORMAL
# 重建last_2_positions、last_3_positions
for m in range(1, self.mode_num + 1):
for n in range(1, self.mode_num + 1):
self.last_3_positions[m][n] = 0
# 根據record恢復棋盤
for r in self.record[:-2]:
if r[2] == 1:
self.last_3_positions[r[1]][r[0]] = 1
elif r[2] == 2:
self.last_3_positions[r[1]][r[0]] = 2
# 判斷是否為死棋
if len(self.record_take) > 3:
for t in self.record_take[-4]:
self.last_3_positions[t[1]][t[0]] = 0
for t in self.record_take[-3]:
self.last_3_positions[t[1]][t[0]] = 0
# 判斷是否為被吃子
if len(self.record_take) > 1:
for t in self.record_take[-2]:
if self.present == 1:
self.last_3_positions[t[1]][t[0]] = 1
else:
self.last_3_positions[t[1]][t[0]] = 2
def nextMove(self):
if len(self.record_next) > 0:
self.record.append(self.record_next[-1])
self.getDown(self.record_next[-1][0], self.record_next[-1][1])
print(self.record)
self.record_next = copy.deepcopy(self.record_next[:-1])
if len(self.record_next) <= 0:
self.nextButton['state'] = DISABLED
if len(self.record) > 0:
self.previousButton['state'] = NORMAL
def load_record(self):
f = open('test.sgf', 'r')
a = re.sub(r'[\':\s ,(;\[\])]*', '', f.read())
r = []
for i in range(int(len(a) / 3)):
if a[i * 3] == 'B':
r.append([ord(a[i * 3 + 1]) - 96, ord(a[i * 3 + 2]) - 96, 1])
else:
r.append([ord(a[i * 3 + 1]) - 96, ord(a[i * 3 + 2]) - 96, 2])
f.close()
return r
def back(self):
self.quit()
class Node_connection():
connected = False
remote_id = {"ip": "127.0.0.1", "port": 8001}
myNode = MyOwnPeer2PeerNode("127.0.0.1", 8002)
myNode.start()
# 聲明全局變量,用於新建Application對象時切换成不同模式的遊戲
global mode_num, newApp, newApp2, Dominance, Node
mode_num = 19
newApp = False
Dominance = False
if __name__ == '__main__':
# 循環,直到不切换遊戲模式
while True:
newApp = False
Dominance = False
Node = Node_connection()
app = Application()
app.title('圍棋')
app.mainloop()
if newApp:
app.destroy()
else:
Node.myNode.stop()
break
|
ZweiChen0328/weiqi | server.py | # -*- coding: utf-8 -*-
import socket
HOST = '127.0.0.1'
PORT = 8000
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((HOST, PORT))
server.listen(10)
while True:
conn, addr = server.accept()
clientMessage = str(conn.recv(1024), encoding='utf-8')
print('Client message is:', clientMessage)
serverMessage = 'I\'m here!'
conn.sendall(serverMessage.encode())
conn.close() |
visor2020/ssd.pytorch | demo/video.py | <reponame>visor2020/ssd.pytorch
from __future__ import print_function
import torch
from torch.autograd import Variable
import numpy as np
import cv2
import time
from imutils.video import FPS, WebcamVideoStream
import os
import argparse
parser = argparse.ArgumentParser(description='Single Shot MultiBox Detection')
parser.add_argument('--weights', default='weights/v2.pth',
type=str, help='Trained state_dict file path')
parser.add_argument('--cuda', default=False, type=bool,
help='Use cuda to train model')
parser.add_argument('--video', default='data/celeb.mp4',
type=str, help='Test image')
parser.add_argument('--live', default=False, type=bool,
help='use live camera')
args = parser.parse_args()
COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
FONT = cv2.FONT_HERSHEY_PLAIN
def cv2_demo(net, transform, input_video, live):
def predict(frame):
height, width = frame.shape[:2]
x = torch.from_numpy(transform(frame)[0]).permute(2, 0, 1)
x = Variable(x.unsqueeze(0))
y = net(x) # forward pass
detections = y.data
# scale each detection back up to the image
scale = torch.Tensor([width, height, width, height])
for i in range(detections.size(1)):
j = 0
while detections[0, i, j, 0] >= 0.6:
score = detections[0, i, j, 0]
pt = (detections[0, i, j, 1:] * scale).cpu().numpy()
label_name = labelmap[i - 1]
display_txt = '%s: %.2f' % (label_name, score) # % 디버깅용
# print('i :', i, 'pt :', pt, 'name :', display_txt)
if label_name == 'person':
cv2.rectangle(frame, (int(pt[0]), int(pt[1])), (int(pt[2]),
int(pt[3])), COLORS[i % 3], 2)
cv2.putText(frame, display_txt, (int(pt[0]), int(pt[1])), FONT,
2, (255, 255, 255), 2, cv2.LINE_AA)
else:
pass
# print(i, j)
# j+1 은 총 detecting 개수를 뜻함
j += 1
return frame
# start video stream thread, allow buffer to fill
print("[INFO] starting threaded video stream...")
# stream = WebcamVideoStream(src=0).start() # default camera
if live:
video = cv2.VideoCapture(0)
else:
video = cv2.VideoCapture(input_video)
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
vw = cv2.VideoWriter("./test12311.mp4", fourcc, 30.0, (640, 360))
idx = 0
while video.isOpened():
ret, bgr_image = video.read()
frame = predict(bgr_image)
vw.write(frame)
# print(frame.shape)
idx +=1
if idx%50 == 0:
print(idx)
if cv2.waitKey(1) & 0xFF == ord('p'):
break
if __name__ == '__main__':
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from data import BaseTransform, VOC_CLASSES as labelmap
from ssd import build_ssd
net = build_ssd('test', 300, 21) # initialize SSD
net.load_state_dict(torch.load(args.weights, map_location=lambda storage, loc: storage))
transform = BaseTransform(net.size, (104/256.0, 117/256.0, 123/256.0))
input_video = args.video
# print(input_video)
fps = FPS().start()
live = args.live
# stop the timer and display FPS information
cv2_demo(net.eval(), transform, input_video, live)
fps.stop()
print("[INFO] elasped time: {:.2f}".format(fps.elapsed()))
print("[INFO] approx. FPS: {:.2f}".format(fps.fps()))
# cleanup
cv2.destroyAllWindows()
# stream.stop()
|
KFlaga/Match4 | Match4Client/Main.py | <gh_stars>0
import sys, random
from PyQt5.QtWidgets import QMainWindow, QFrame, QApplication, QDialog
from PyQt5.QtCore import Qt, QBasicTimer, pyqtSignal, pyqtSlot
from PyQt5 import QtCore
import ui.MainWindow
from MenuScreen import MenuScreen
from GameSettings import GameSettings, Player, PlayerType
from GameSettingsDialog import GameSettingsDialog
from GameScreen import GameScreen
class Main(QMainWindow, ui.MainWindow.Ui_MainWindow):
globalMainInstance = None
def __init__(self):
super(Main, self).__init__()
Main.globalMainInstance = self
self.__menuScreen = MenuScreen(self)
self.__gameScreen = None
self.setupUi(self)
def run(self):
self.__menuScreen.endProgram.connect(self.endProgram)
self.__menuScreen.startGame.connect(self.prepareGame)
self.setCentralWidget(self.__menuScreen)
self.show()
@pyqtSlot(GameSettings)
def prepareGame(self, gameSettings):
# Show dialog
game_setting_dialog = GameSettingsDialog(gameSettings, self)
game_setting_dialog.settingsAccepted.connect(self.startGame)
game_setting_dialog.show()
@pyqtSlot()
def endProgram(self):
self.close()
return
@pyqtSlot(GameSettings)
def startGame(self, gameSettings):
# Create game screen and game server
# Register message sender/receiver to server and game screen
self.__gameScreen = GameScreen(self)
self.__gameScreen.endGame.connect(self.endGame)
self.__menuScreen.hide()
self.setCentralWidget(self.__gameScreen)
self.__gameScreen.startGame(gameSettings)
return
@pyqtSlot()
def endGame(self):
self.__gameScreen.hide()
self.__menuScreen = MenuScreen(self)
self.__menuScreen.endProgram.connect(self.endProgram)
self.__menuScreen.startGame.connect(self.prepareGame)
self.setCentralWidget(self.__menuScreen)
return
if __name__ == '__main__':
app = QApplication([])
game = Main()
game.run()
sys.exit(app.exec_())
|
KFlaga/Match4 | Match4Client/MenuScreen.py | <filename>Match4Client/MenuScreen.py
from PyQt5.QtWidgets import QFrame, QWidget
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot
from GameSettings import GameSettings, PlayerColor, PlayerType, Player
import ui.MenuFrame
class MenuScreen(QWidget, ui.MenuFrame.Ui_mainFrame):
startGame = pyqtSignal(GameSettings)
endProgram = pyqtSignal()
def __init__(self, parent=None):
super(MenuScreen, self).__init__(parent)
self.setupUi(self)
def humanVsHumanClicked(self):
game_settings = GameSettings()
game_settings.player_1 = Player(0, PlayerType.Human, PlayerColor.Red)
game_settings.player_2 = Player(1, PlayerType.Human, PlayerColor.Yellow)
self.startGame.emit(game_settings)
return
def humanVsCpuClicked(self):
game_settings = GameSettings()
game_settings.player_1 = Player(0, PlayerType.Human, PlayerColor.Red)
game_settings.player_2 = Player(1, PlayerType.Cpu, PlayerColor.Yellow)
self.startGame.emit(game_settings)
return
def cpuVsCpuClicked(self):
game_settings = GameSettings()
game_settings.player_1 = Player(0, PlayerType.Cpu, PlayerColor.Red)
game_settings.player_2 = Player(1, PlayerType.Cpu, PlayerColor.Yellow)
self.startGame.emit(game_settings)
return
def endClicked(self):
self.endProgram.emit()
return
|
KFlaga/Match4 | Match4Client/GameSettingsDialog.py | from PyQt5.QtWidgets import QFrame, QWidget, QDialog
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot
from GameSettings import GameSettings, PlayerColor, PlayerType, Player
import ui.GameSettingsDialog
class GameSettingsDialog(QDialog, ui.GameSettingsDialog.Ui_Dialog):
settingsAccepted = pyqtSignal(GameSettings)
def __init__(self, gameSettings, parent=None):
super(QDialog, self).__init__(parent)
self.gameSettings = gameSettings
addDiffPanel_1 = gameSettings.player_1.type == PlayerType.Cpu
addDiffPanel_2 = gameSettings.player_2.type == PlayerType.Cpu
self.setupUi(self, addDiffPanel_1, addDiffPanel_2)
if addDiffPanel_1:
self.gameSettings.player_1.difficulty = 0
if addDiffPanel_2:
self.gameSettings.player_2.difficulty = 0
self.accepted.connect(self.startGame)
def show(self):
if (self.gameSettings.player_1.type == PlayerType.Human and
self.gameSettings.player_2.type == PlayerType.Human):
self.accept()
return
super(QDialog, self).show()
return
@pyqtSlot()
def startGame(self):
self.settingsAccepted.emit(self.gameSettings)
return
@pyqtSlot(int)
def difficulty_cpu_1_changed(self, newDiff):
self.gameSettings.player_1.difficulty = newDiff
return
@pyqtSlot(int)
def difficulty_cpu_2_changed(self, newDiff):
self.gameSettings.player_2.difficulty = newDiff
return
|
KFlaga/Match4 | Match4Client/ui/GameSettingsDialog.py | <gh_stars>0
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GameSettingsDialog.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog, addDiff_1, addDiff_2):
Dialog.setObjectName("Dialog")
Dialog.setWindowModality(QtCore.Qt.ApplicationModal)
Dialog.resize(203, 185)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
Dialog.setSizePolicy(sizePolicy)
Dialog.setModal(True)
self.gridLayout = QtWidgets.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout")
spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 3, 0, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 1, 2, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem2, 0, 0, 1, 1)
if (addDiff_1 is True):
self.frame_1 = QtWidgets.QFrame(Dialog)
self.frame_1.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_1.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_1.setObjectName("frame_1")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_1)
self.horizontalLayout.setObjectName("horizontalLayout")
self.difficultyLabel_1 = QtWidgets.QLabel(self.frame_1)
self.difficultyLabel_1.setLayoutDirection(QtCore.Qt.LeftToRight)
self.difficultyLabel_1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.difficultyLabel_1.setObjectName("difficultyLabel_1")
self.horizontalLayout.addWidget(self.difficultyLabel_1)
self.difficultySettingBox_1 = QtWidgets.QSpinBox(self.frame_1)
self.difficultySettingBox_1.setObjectName("difficultySettingBox_1")
self.horizontalLayout.addWidget(self.difficultySettingBox_1)
self.gridLayout.addWidget(self.frame_1, 1, 0, 1, 2)
self.difficultySettingBox_1.valueChanged['int'].connect(Dialog.difficulty_cpu_1_changed)
self.difficultyLabel_1.setBuddy(self.difficultySettingBox_1)
if addDiff_2 is True:
self.frame_2 = QtWidgets.QFrame(Dialog)
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_2)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.difficultyLabel_2 = QtWidgets.QLabel(self.frame_2)
self.difficultyLabel_2.setLayoutDirection(QtCore.Qt.LeftToRight)
self.difficultyLabel_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.difficultyLabel_2.setObjectName("difficultyLabel_2")
self.horizontalLayout_2.addWidget(self.difficultyLabel_2)
self.difficultySettingBox_2 = QtWidgets.QSpinBox(self.frame_2)
self.difficultySettingBox_2.setObjectName("difficultySettingBox_2")
self.horizontalLayout_2.addWidget(self.difficultySettingBox_2)
self.gridLayout.addWidget(self.frame_2, 2, 0, 1, 2)
self.difficultySettingBox_2.valueChanged['int'].connect(Dialog.difficulty_cpu_2_changed)
self.difficultyLabel_2.setBuddy(self.difficultySettingBox_2)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem3, 2, 2, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 3)
self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
if hasattr(self, 'difficultyLabel_2') is True:
self.difficultyLabel_2.setText(_translate("Dialog", "Cpu_2 Difficulty"))
if hasattr(self, 'difficultyLabel_1') is True:
self.difficultyLabel_1.setText(_translate("Dialog", "Cpu_1 Difficulty"))
|
KFlaga/Match4 | Match4Client/ui/GameFrame.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GameFrame.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_GameFrame(object):
def setupUi(self, game_frame, board_frame):
game_frame.setObjectName("game_frame")
game_frame.resize(437, 327)
game_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
game_frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.gridLayout = QtWidgets.QGridLayout(game_frame)
self.gridLayout.setObjectName("gridLayout")
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 0, 2, 1, 1)
self.gridLayout.addWidget(board_frame, 2, 1, 1, 3)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 2, 0, 1, 1)
self.statusText = QtWidgets.QLineEdit(game_frame)
self.statusText.setMouseTracking(False)
self.statusText.setAcceptDrops(False)
self.statusText.setReadOnly(True)
self.statusText.setObjectName("statusText")
self.gridLayout.addWidget(self.statusText, 6, 1, 1, 3)
self.endButton = QtWidgets.QPushButton(game_frame)
self.endButton.setObjectName("endButton")
self.gridLayout.addWidget(self.endButton, 7, 3, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem2, 2, 4, 1, 1)
self.playerPanel = QtWidgets.QWidget(game_frame)
self.playerPanel.setObjectName("playerPanel")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.playerPanel)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.currentPlayerLabel = QtWidgets.QLineEdit(self.playerPanel)
self.currentPlayerLabel.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.currentPlayerLabel.sizePolicy().hasHeightForWidth())
self.currentPlayerLabel.setSizePolicy(sizePolicy)
self.currentPlayerLabel.setMaximumSize(QtCore.QSize(80, 16777215))
self.currentPlayerLabel.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.currentPlayerLabel.setMouseTracking(False)
self.currentPlayerLabel.setAcceptDrops(False)
self.currentPlayerLabel.setFrame(True)
self.currentPlayerLabel.setEchoMode(QtWidgets.QLineEdit.Normal)
self.currentPlayerLabel.setDragEnabled(False)
self.currentPlayerLabel.setReadOnly(True)
self.currentPlayerLabel.setObjectName("currentPlayerLabel")
self.horizontalLayout.addWidget(self.currentPlayerLabel)
self.currentPlayerColor = QtWidgets.QPushButton(self.playerPanel)
self.currentPlayerColor.setEnabled(False)
self.currentPlayerColor.setMaximumSize(QtCore.QSize(20, 20))
self.currentPlayerColor.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/fields/color_red.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off)
self.currentPlayerColor.setIcon(icon)
self.currentPlayerColor.setIconSize(QtCore.QSize(20, 20))
self.currentPlayerColor.setDefault(False)
self.currentPlayerColor.setFlat(False)
self.currentPlayerColor.setObjectName("currentPlayerColor")
self.horizontalLayout.addWidget(self.currentPlayerColor)
self.currentPlayerType = QtWidgets.QLineEdit(self.playerPanel)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.currentPlayerType.sizePolicy().hasHeightForWidth())
self.currentPlayerType.setSizePolicy(sizePolicy)
self.currentPlayerType.setMaximumSize(QtCore.QSize(45, 16777215))
self.currentPlayerType.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.currentPlayerType.setMouseTracking(False)
self.currentPlayerType.setAcceptDrops(False)
self.currentPlayerType.setReadOnly(True)
self.currentPlayerType.setObjectName("currentPlayerType")
self.horizontalLayout.addWidget(self.currentPlayerType)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem3)
self.gridLayout.addWidget(self.playerPanel, 3, 1, 1, 3)
self.retranslateUi(game_frame)
self.endButton.clicked.connect(game_frame.endClicked)
QtCore.QMetaObject.connectSlotsByName(game_frame)
def retranslateUi(self, game_frame):
_translate = QtCore.QCoreApplication.translate
game_frame.setWindowTitle(_translate("game_frame", "game_frame"))
self.statusText.setText(_translate("game_frame", "STATUS"))
self.endButton.setText(_translate("game_frame", "End"))
self.currentPlayerLabel.setText(_translate("game_frame", "Current Player:"))
self.currentPlayerType.setText(_translate("game_frame", "Human"))
|
KFlaga/Match4 | Match4Client/BoardColumn.py | <gh_stars>0
from BoardField import BoardField
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject
from ui.BoardColumn import Ui_BoardColumn
class BoardColumn(QtWidgets.QPushButton, Ui_BoardColumn):
mouseEnter = pyqtSignal(int)
mouseLeave = pyqtSignal(int)
mouseClicked = pyqtSignal(int)
def __init__(self, parent, column_number):
super(BoardColumn, self).__init__(parent)
self.number = column_number
self.setupUi(self, self.number)
self.fields = [BoardField(self.field_column, i, column_number) for i in range(5)]
for field in self.fields:
self.verticalLayout.addWidget(field)
field.mouseEnter.connect(self.fieldEnter)
field.mouseLeave.connect(self.fieldLeave)
field.mousePressed.connect(self.fieldPressed)
field.mouseReleased.connect(self.fieldReleased)
self.is_mouse_above = False
@pyqtSlot(int)
def fieldEnter(self, field_number):
if not self.is_mouse_above:
self.enterEvent(QtCore.QEvent(QtCore.QEvent.Enter))
return
@pyqtSlot(int)
def fieldLeave(self, field_number):
if not self.underMouse():
self.leaveEvent(QtCore.QEvent(QtCore.QEvent.Leave))
return
@pyqtSlot(int)
def fieldPressed(self, field_number):
self.mousePressEvent(QtCore.QEvent(QtCore.QEvent.MouseButtonPress))
return
@pyqtSlot(int)
def fieldReleased(self, field_number):
if self.underMouse():
self.mouseReleaseEvent(QtCore.QEvent(QtCore.QEvent.MouseButtonRelease))
return
def enterEvent(self, event):
self.is_mouse_above = True
self.mouseEnter.emit(self.number)
return
def leaveEvent(self, event):
self.is_mouse_above = False
self.mouseLeave.emit(self.number)
return
def mousePressEvent(self, mouseEvent):
return
def mouseReleaseEvent(self, mouseEvent):
#if self.is_mouse_above:
self.mouseClicked.emit(self.number)
return
def highlightNormal(self):
self.setStyleSheet("background-image: url(:/fields/empty_column.png);")
return
def highlightHover(self):
self.setStyleSheet("background-image: url(:/fields/empty_column_hover.png);")
return
def highlightBad(self):
self.setStyleSheet("background-image: url(:/fields/empty_column_bad.png);")
return
def highlightGood(self):
self.setStyleSheet("background-image: url(:/fields/empty_column_good.png);")
return
def setFieldColor(self, field_number, player_color):
self.fields[field_number].setColor(player_color)
return
|
KFlaga/Match4 | Match4Client/GameBoard.py | from BoardColumn import BoardColumn
from ui.GameBoard import Ui_GameBoard
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject
from PyQt5.QtWidgets import QFrame
class GameBoard(QFrame, Ui_GameBoard):
columnHover = pyqtSignal(int)
columnClicked = pyqtSignal(int)
def __init__(self, parent):
super(GameBoard, self).__init__(parent)
self.columns = [BoardColumn(self, i) for i in range(5)]
self.setupUi(self)
for column in self.columns:
column.mouseEnter.connect(self.onColumnHoverEnter)
column.mouseLeave.connect(self.onColumnHoverLeave)
column.mouseClicked.connect(self.onColumnClicked)
@pyqtSlot(int)
def onColumnHoverEnter(self, column_number):
self.columnHover.emit(column_number)
return
@pyqtSlot(int)
def onColumnHoverLeave(self, column_number):
self.columns[column_number].highlightNormal()
return
@pyqtSlot(int)
def onColumnClicked(self, column_number):
self.columnClicked.emit(column_number)
return
@pyqtSlot()
def resetHover(self):
for column in self.columns:
column.highlightNormal()
return
@pyqtSlot(int)
def setHoverNormal(self, column_number):
self.columns[column_number].highlightNormal()
return
@pyqtSlot(int)
def setHoverGood(self, column_number):
self.resetHover()
self.columns[column_number].highlightGood()
return
@pyqtSlot(int)
def setHoverBad(self, column_number):
self.resetHover()
self.columns[column_number].highlightBad()
return
@pyqtSlot(int, int, int)
def setFieldColor(self, column_number, field_number, player_color):
self.columns[column_number].setFieldColor(field_number, player_color)
return
|
KFlaga/Match4 | Match4Client/ui/MenuFrame.py | <reponame>KFlaga/Match4
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MenuFrame.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_mainFrame(object):
def setupUi(self, mainFrame):
mainFrame.setObjectName("mainFrame")
mainFrame.resize(348, 365)
self.gridLayout = QtWidgets.QGridLayout(mainFrame)
self.gridLayout.setObjectName("gridLayout")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 1, 0, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem1, 0, 1, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem2, 1, 2, 1, 1)
self.menuFrame = QtWidgets.QFrame(mainFrame)
self.menuFrame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.menuFrame.setFrameShadow(QtWidgets.QFrame.Raised)
self.menuFrame.setObjectName("menuFrame")
self.verticalLayout = QtWidgets.QVBoxLayout(self.menuFrame)
self.verticalLayout.setObjectName("verticalLayout")
self.humanVsHumanButton = QtWidgets.QPushButton(self.menuFrame)
self.humanVsHumanButton.setObjectName("humanVsHumanButton")
self.verticalLayout.addWidget(self.humanVsHumanButton)
self.humanVsCpuButton = QtWidgets.QPushButton(self.menuFrame)
self.humanVsCpuButton.setObjectName("humanVsCpuButton")
self.verticalLayout.addWidget(self.humanVsCpuButton)
self.cpuVsCpuButton = QtWidgets.QPushButton(self.menuFrame)
self.cpuVsCpuButton.setObjectName("cpuVsCpuButton")
self.verticalLayout.addWidget(self.cpuVsCpuButton)
self.exitButton = QtWidgets.QPushButton(self.menuFrame)
self.exitButton.setObjectName("exitButton")
self.verticalLayout.addWidget(self.exitButton)
self.gridLayout.addWidget(self.menuFrame, 1, 1, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem3, 2, 1, 1, 1)
self.retranslateUi(mainFrame)
self.humanVsHumanButton.clicked.connect(mainFrame.humanVsHumanClicked)
self.humanVsCpuButton.clicked.connect(mainFrame.humanVsCpuClicked)
self.cpuVsCpuButton.clicked.connect(mainFrame.cpuVsCpuClicked)
self.exitButton.clicked.connect(mainFrame.endClicked)
QtCore.QMetaObject.connectSlotsByName(mainFrame)
def retranslateUi(self, mainFrame):
_translate = QtCore.QCoreApplication.translate
mainFrame.setWindowTitle(_translate("mainFrame", "Frame"))
self.humanVsHumanButton.setText(_translate("mainFrame", "Human vs Human"))
self.humanVsCpuButton.setText(_translate("mainFrame", "Human vs Cpu"))
self.cpuVsCpuButton.setText(_translate("mainFrame", "Cpu vs Cpu"))
self.exitButton.setText(_translate("mainFrame", "Exit"))
|
KFlaga/Match4 | Match4Client/ServerConnector.py | <filename>Match4Client/ServerConnector.py
import match4server
from Messages import Message, MessageType
import Messages
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, QTimer
class ServerConnector(QObject):
messageReceived = pyqtSignal(Message)
def __init__(self):
super(ServerConnector, self).__init__()
self.createMessageTypeMap()
self.serverHandle = 0
self.messageAwaitTimer = QTimer()
self.messageAwaitTimer.timeout.connect(self.__checkMessages)
def createMessageTypeMap(self):
self.msgClientToServerMap = {}
self.msgServerToClientMap = {}
for clientType in MessageType:
typeName = str(clientType.value)
serverType = match4server.getMessageType(typeName)
self.msgClientToServerMap.update([(clientType, serverType)])
self.msgServerToClientMap.update([(serverType, clientType)])
return
def createServer(self):
self.serverHandle = match4server.createServer()
self.messageAwaitTimer.start(100)
return
def destroyServer(self):
self.messageAwaitTimer.stop()
match4server.destroyServer(self.serverHandle)
self.serverHandle = 0
return
def receive(self, msg):
self.sendToServer(msg)
return
@pyqtSlot(Message)
def sendToServer(self, msg):
match4server.sendMessage(self.serverHandle,
self.msgClientToServerMap[msg.msgType],
msg.data[0], msg.data[1], msg.data[2])
return
def __checkMessages(self):
response = match4server.checkResponse(self.serverHandle)
if response is None:
return
self.__receiveFromServer(response)
return
def __receiveFromServer(self, serverMsg):
clientMsg = Messages.createMessage(
self.msgServerToClientMap[serverMsg[0]], [serverMsg[1], serverMsg[2], serverMsg[3]])
self.messageReceived.emit(clientMsg)
return
|
KFlaga/Match4 | Match4Client/BoardField.py | from ui.BoardField import Ui_BoardField
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject
from GameSettings import PlayerColor
class BoardField(QtWidgets.QPushButton, Ui_BoardField):
mouseEnter = pyqtSignal(int)
mouseLeave = pyqtSignal(int)
mousePressed = pyqtSignal(int)
mouseReleased = pyqtSignal(int)
def __init__(self, parent, field_number, column_number):
super(BoardField, self).__init__(parent)
self.field_number = field_number
self.column_number = column_number
self.setupUi(self, field_number, column_number)
self.color = PlayerColor.NoPlayer
def enterEvent(self, event):
self.mouseEnter.emit(self.field_number)
return
def leaveEvent(self, event):
self.mouseLeave.emit(self.field_number)
return
def mousePressEvent(self, mouseEvent):
self.mousePressed.emit(self.field_number)
return
def mouseReleaseEvent(self, mouseEvent):
self.mouseReleased.emit(self.field_number)
return
def setColor(self, color):
if color == PlayerColor.Red:
self.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"background-image: url(:/fields/red_field_1.png);")
elif color == PlayerColor.Yellow:
self.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"background-image: url(:/fields/yellow_field_1.png);")
else:
self.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"background-image: url(:/fields/empty_field_1.png);")
self.color = color
return
def getColor(self):
return self.color
|
KFlaga/Match4 | Match4Client/ui/GameBoard.py | <reponame>KFlaga/Match4
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GameBoard.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_GameBoard(object):
def setupUi(self, board_frame):
board_frame.setObjectName("board_frame")
board_frame.resize(320, 304)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(board_frame.sizePolicy().hasHeightForWidth())
board_frame.setSizePolicy(sizePolicy)
board_frame.setMinimumSize(QtCore.QSize(320, 304))
board_frame.setMaximumSize(QtCore.QSize(320, 304))
board_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
board_frame.setFrameShadow(QtWidgets.QFrame.Raised)
for i in range(5):
column = self.columns[i]
column.setGeometry(QtCore.QRect(i * 64, 0, 64, 302))
QtCore.QMetaObject.connectSlotsByName(board_frame)
|
KFlaga/Match4 | Match4Server/build_python.py | <gh_stars>0
from distutils.core import setup, Extension
import fnmatch
import os
source_files = [];
for file in os.listdir('.'):
if fnmatch.fnmatch(file, '*.cpp'):
source_files.append(file)
module1 = Extension('match4server',
sources = source_files)
setup (name = 'Match4ServerModule',
version = '1.0',
description = 'Match4Server',
ext_modules = [module1]) |
KFlaga/Match4 | Match4Client/GameSettings.py | <gh_stars>0
from enum import Enum
class PlayerColor(Enum):
Red = 1
Yellow = 2
NoPlayer = 0
class PlayerType(Enum):
Human = 0
Cpu = 1
class Player:
def __init__(self, number, type, color):
self.number = number
self.type = type
self.color = color
self.difficulty = -1
class GameSettings:
def __init__(self):
self.player_1 = Player(0, PlayerType.Human, PlayerColor.Red)
self.player_2 = Player(1, PlayerType.Human, PlayerColor.Yellow)
def getPlayer(self, num):
if num == 0:
return self.player_1
return self.player_2
|
KFlaga/Match4 | Match4Client/Messages.py | <filename>Match4Client/Messages.py
from enum import Enum
from PyQt5.QtCore import QObject, pyqtSlot, pyqtSignal
class MessageType(Enum):
Unknown = 'Unknown'
NoMessage = 'NoMessage'
ReqHover = 'ReqHover'
ReqSelect = 'ReqSelect'
ReqSettings = 'ReqSetGameSettings'
ReqEndGame = 'ReqEndGame'
RespConfirm = 'RespConfirm'
RespGoodMove = 'RespGoodMove'
RespBadMove = 'RespBadMove'
RespNextPlayer_Human = 'RespNextPlayer_Human'
RespNextPlayer_Cpu = 'RespNextPlayer_Cpu'
RespWinMove = 'RespWinMove'
RespDraw = 'RespDraw'
RespField = 'RespField'
class Message:
def __init__(self, msgType=MessageType.Unknown):
self.msgType = msgType
self.data = [int(0), int(0), int(0)]
return
def createMessage(msgType, msgData):
msg = Message(msgType)
dataLen = max([3, len(msgData)])
for i in range(dataLen):
msg.data[i] = msgData[i]
return msg
|
KFlaga/Match4 | Match4Client/ui/BoardField.py | from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_BoardField(object):
def setupUi(self, field_button, field_number, column_number):
field_button.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(field_button.sizePolicy().hasHeightForWidth())
field_button.setSizePolicy(sizePolicy)
field_button.setMinimumSize(QtCore.QSize(64, 63))
field_button.setMaximumSize(QtCore.QSize(64, 63))
field_button.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"background-image: url(:/fields/empty_field_1.png);")
field_button.setText("")
field_button.setFlat(False)
field_button.setObjectName('field_{0}_{1}'.format(column_number, field_number))
QtCore.QMetaObject.connectSlotsByName(field_button)
|
KFlaga/Match4 | Match4Client/ui/BoardColumn.py | from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_BoardColumn(object):
def setupUi(self, column_button, column_number):
column_button.setObjectName('column_{0}'.format(column_number))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(column_button.sizePolicy().hasHeightForWidth())
column_button.setSizePolicy(sizePolicy)
column_button.setFocusPolicy(QtCore.Qt.NoFocus)
column_button.setStyleSheet("background-image: url(:/fields/empty_column.png);")
column_button.setText("")
column_button.setFlat(False)
self.field_column = QtWidgets.QFrame(column_button)
self.field_column.setGeometry(QtCore.QRect(0, 0, 64, 302))
self.field_column.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.field_column.setFrameShadow(QtWidgets.QFrame.Raised)
self.field_column.setObjectName("field_column_{0}".format(column_number))
self.verticalLayout = QtWidgets.QVBoxLayout(self.field_column)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName("field_column_layout{0}".format(column_number))
QtCore.QMetaObject.connectSlotsByName(column_button)
|
KFlaga/Match4 | Match4Client/ui/resources.py | <filename>Match4Client/ui/resources.py
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.6.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x05\xd4\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x00\x3c\x08\x06\x00\x00\x00\x3a\xfc\xd9\x72\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x05\x89\x49\x44\x41\x54\x68\xde\xed\x9b\x6d\x48\
\x5b\x57\x18\xc7\xff\xe7\x26\xe4\xe5\x5e\x02\xc3\xca\x36\xa4\xdb\
\x8a\x33\x26\xb6\x6c\x9a\x58\xa8\x05\xc7\x95\xaa\x20\xd9\x1c\x08\
\xa5\x1d\x44\xd0\x51\x18\x43\x06\x03\xbb\x75\xa3\xdb\xb4\xcd\xda\
\x7d\x58\xe9\xc6\x60\x4a\xe9\x97\x59\x30\x32\xc7\xc0\xa2\x23\x74\
\x68\x69\xef\x10\xd6\xd2\x36\xa9\x03\x31\x31\xa1\x14\x1c\x61\x63\
\xed\x28\x64\x79\xa5\xb9\x77\x1f\x92\x9b\xe6\x45\xcd\xcb\x35\x21\
\x57\x7d\x40\x08\x26\x39\x9c\x5f\xfe\xe7\xf9\x9f\x73\x9e\x7b\x0e\
\xb0\xc3\x82\x88\x2f\xde\xff\xea\x26\xe2\x4f\x09\x08\xd9\xba\xc6\
\x05\x10\xf0\x84\x82\x00\x52\x64\xa7\x04\x50\x02\x0f\x02\x41\x7a\
\x1f\x04\x40\xa1\x14\x70\xe9\x74\x47\x26\x70\xdf\x89\xdf\xb1\xe6\
\xbd\x8f\xda\x17\xcd\x5b\x02\x4d\x20\xc0\x6a\x71\xb0\xd6\x01\x1b\
\x57\xca\xf7\x3f\xfc\xe0\x28\xeb\xfd\xe7\x23\xae\xd8\x1f\x2b\x1b\
\xf6\xd1\x5f\x4e\xbc\xa4\x6f\xc1\x0b\xaf\x46\x71\xe9\x74\x07\x94\
\xe2\x9b\x6b\xde\xfb\x08\x3d\x51\xe0\xda\x6f\x87\xb6\x44\xdd\xba\
\xfa\x21\x38\xa6\xc7\xb9\xe3\xed\x73\x60\xe2\xc1\x82\x94\x16\x95\
\x0d\x2a\x18\x7c\xf7\x7d\x2f\x57\x57\xff\x3c\xbe\xfc\xb4\x86\x3d\
\xf1\xde\x39\xae\xd4\x7e\xec\x7f\xfd\x72\x42\xc8\x57\xf6\x67\x2a\
\xdc\x73\xec\x36\xae\xfd\x54\x3a\xac\xe1\xd0\x04\xe8\x3d\x87\x01\
\x41\x40\x9c\x28\x11\xa5\x54\x68\x0a\x79\x30\x73\xbd\xab\xa4\x71\
\xd9\xd7\xb9\x40\x56\x68\x23\x54\x7c\x14\xb1\xc7\x8b\xf0\xdc\x1e\
\x2c\xb9\x6f\x3d\xc7\x6e\xe3\xe5\xd7\x22\xb8\xfc\x05\xfb\x4c\x61\
\xa9\xc3\xb8\x95\xae\x01\xf3\x9f\x13\x3c\xa1\xf0\x94\x28\x11\xa5\
\xd4\x68\x0a\xba\x01\x74\x95\xd4\x9e\x29\xb8\x04\x2d\x22\xd0\xc6\
\x23\x88\xd0\x35\xf0\x48\x49\xaf\x34\x36\xa5\xd4\xa1\x7b\xa0\xf7\
\x21\x1a\xc3\x5e\xd8\xe7\xd7\x53\xf2\xcd\x92\xdb\x1d\xb9\x75\x32\
\xa3\xbd\x70\xf7\x3c\x59\xd5\xea\xb1\x3c\xb7\x4f\x52\x7f\x29\xa9\
\xc0\xfa\xb0\x0f\xad\x01\x57\xd9\xa7\x93\xd6\x80\x0b\xfa\xb0\x4f\
\x72\x3b\x45\x2b\x5c\xa7\x1f\x42\xad\x61\x18\x31\x4a\x05\x63\xc8\
\x83\x99\xf9\x4e\x01\xe8\x2c\x3b\xf0\x67\xb7\x3e\x16\x00\xa0\xaf\
\x7b\x9e\xb8\x69\x03\x54\x7c\x0c\x8f\x3c\xdf\xc0\xef\x1d\x2f\x2f\
\x70\xc7\xde\x1e\x68\x02\x2e\x84\x15\x1a\x18\x83\x9e\x92\x73\xb4\
\xd4\x30\x05\x96\xa0\xe5\x93\xb9\xbd\xb7\x07\x53\xe5\x02\x5e\x3f\
\x57\xdf\xaa\xf8\x4a\x49\x6a\x6e\x17\x9c\xc3\x8d\x61\x2f\xcc\x15\
\xc8\xd5\x62\xc3\x1c\x70\xa1\x31\xec\xdd\x3a\x85\xeb\xf4\x43\xe8\
\xd8\xdb\x93\x54\xb6\xab\xea\x80\x3f\x4f\xe6\xb6\xf5\xc8\x2c\xb9\
\xf9\xe7\xb5\xbc\x39\x9d\x57\xe1\x5a\xc3\x30\x34\x7c\xb4\xea\x37\
\x05\x1a\x3e\x8a\x5a\xc3\xb0\xf4\x21\x1d\xa3\x54\x08\x2b\x34\x55\
\x0f\x1c\x56\x68\x10\xa3\x54\xd2\x81\x8d\x21\x4f\xd2\x8d\xab\x3b\
\x8c\x41\x0f\x8c\x21\x4f\xe9\x39\x7c\xa0\xf7\x21\xf4\x61\x5f\x72\
\x9e\xed\xaa\x7a\x60\xd1\xbd\xfb\xba\x17\x88\x57\xdb\xb0\xa1\x6b\
\x53\x9b\xb9\xf2\xc1\x80\x53\x76\x1b\xfc\x83\x01\xe7\xa6\xae\xad\
\x5c\x6f\xd7\xd3\x4a\xd7\x54\xad\x2b\x17\xba\x22\xb3\x1e\x99\x25\
\xf7\x42\xff\xe6\xec\xb2\x72\x14\xa6\xf7\x1c\x06\x13\x0f\xca\xbe\
\x94\xa3\xe1\xa3\x50\xed\x69\xc7\xe4\xc4\x59\x76\xf3\x21\x2d\x08\
\xe0\x09\x25\x7b\xe0\x84\x6b\xab\x71\xca\xf6\x37\x97\x5e\x2a\xca\
\x21\x8b\x13\x25\x9e\x12\xa5\xec\x81\x8d\x41\x0f\x9a\x42\x6e\xf8\
\x1f\x8c\xc3\x6a\x71\xb0\x62\xb5\x85\x4a\x2f\xaf\xd4\xd5\x0f\x21\
\x4a\xa9\x10\xa5\xd4\xb2\x07\x1e\xb9\x75\x52\x98\xb9\xde\x65\x3e\
\xde\x3e\x07\xeb\x80\x8d\x13\x47\x6d\x0a\xd8\x6a\x71\xb0\xfe\x07\
\xe3\x68\x0a\x79\x92\x95\x8a\xed\x11\xa2\x1f\x89\x0a\xa7\xc6\xae\
\x75\xc0\xc6\x1d\x6f\x9f\xc3\x8f\xd7\xe5\xe9\xce\x1b\x84\x33\xdb\
\x8f\xa8\xf5\x7e\x8d\xed\x14\xd9\x95\xd2\x0c\xe0\xed\xe0\xce\x45\
\xad\xa5\xa5\x14\xbd\x65\x09\xbc\x13\x62\x17\x78\x17\x78\x17\x78\
\x17\x78\x17\x58\x36\xc0\x5b\xf1\xc4\xbd\xda\x22\x9b\x29\x03\x98\
\x12\xf8\xed\xa7\x68\x16\x53\x06\x70\x50\xc1\x6c\x3b\x60\x91\x49\
\x54\x3a\x05\x6c\xbf\x32\xc2\x4e\x2f\xf6\xa2\xaf\x73\x81\xd8\xda\
\x2e\xca\x7e\x8d\x69\x6b\xbb\x48\xfa\x3a\x17\x30\xbd\xd8\x0b\xfb\
\x95\x11\x56\x54\xfa\x19\xb0\xc3\xc2\x4d\x4e\x9c\x65\x57\x68\x23\
\xdc\x8c\x41\xf6\xca\xba\x19\x03\x56\x68\x63\x8a\x2d\x47\x61\x01\
\x04\xfd\x83\xa3\x9c\x8a\x8f\x42\x1b\x8f\xc8\x1e\x58\x1b\x8f\x40\
\x95\x7c\x44\x94\xbe\x29\xca\x99\x96\x1e\xaf\x7e\x8b\xc8\x36\x28\
\xf1\x44\x28\x35\x3e\x39\x66\x67\xb3\xff\x9f\x53\xad\xf3\xfb\xc6\
\x30\xe5\x1b\x43\xb8\x7b\x9e\xb4\x06\x5c\xa9\x3a\xaf\x5c\xe2\x7c\
\xdb\x05\x72\x4f\x67\xc2\xcc\x8d\xb7\x31\x75\x03\x5c\x5e\x60\x31\
\x56\xb5\x7a\x59\xee\x8f\xef\xea\xcc\xf0\x6a\x1b\x36\x7c\x7f\x43\
\xe0\xe5\xb9\x7d\x58\x46\xe2\x4c\x85\x29\xb0\x94\xf3\xe4\xbd\x1a\
\x5d\xd9\xa5\x6b\xc6\xd5\x85\xee\x4d\x3f\x97\xb7\x00\xed\xa6\x0d\
\xd0\xf2\xd5\x6f\x62\x6e\xc6\x00\x37\x9d\x7f\x76\xc9\xbb\x96\x56\
\xf1\x31\x59\xb8\x76\xc2\x95\x63\xd2\x81\x4f\x1d\xb5\xb3\x72\x70\
\xed\x08\xa5\xc6\x1f\xbf\x34\xe4\xfd\x5c\xde\x21\xdd\x3f\x38\xca\
\x01\x89\xd3\x32\xe6\x80\x2b\x75\xa6\xa2\x5a\xe2\x5c\xdb\x05\xe2\
\x4c\xba\x72\x21\x51\xf0\x43\xa4\x55\xad\xbe\x2a\x95\x75\xea\x4c\
\x45\xf5\xad\x60\x60\xd1\xb5\xad\x47\x66\x89\x86\x8f\xa6\x0e\xa6\
\x55\xda\xbd\x6d\x6d\x17\x89\x9b\x31\x24\x0e\xa6\x51\xea\x82\x95\
\x2d\x1a\x58\x0c\xcb\x80\x8b\xfd\xfa\x67\x2b\x17\xa3\x54\x08\x53\
\x95\x3f\xec\xe2\xd2\x35\x43\x3c\x7a\x58\x48\xce\x4a\x06\x4e\xe4\
\xf4\x68\x62\x2a\x40\xe2\x4c\xc5\xc1\x80\xb3\xec\x2b\xb2\xf3\x6d\
\x17\xc8\x5d\x9d\x39\xef\x3c\xbb\xe5\xc0\xd9\xe1\xd5\x36\x54\xa4\
\x52\x72\x4f\x67\xda\x74\x05\x55\x31\xe0\x72\xe5\xb6\xd4\x5c\xcd\
\x3b\x0f\x0b\x12\x45\xba\xb9\xf6\x2b\xee\x30\x26\x38\xe9\x16\xb8\
\x98\xe6\x44\x91\x41\xc2\x9f\x8b\x69\x86\x93\x6e\xc1\x1d\xc6\x04\
\xcb\x80\x8b\x95\xd2\xb7\x74\xb6\x94\xc2\x7c\x9c\x60\xf2\x87\x33\
\x6c\xff\xbb\x67\x4a\xba\x50\xe1\xf7\x8d\xc1\xef\x1b\xc3\xe4\xc4\
\x59\xb6\x7f\x70\x94\x7b\xe7\x8d\xc2\x2f\x77\x88\x91\x7e\xc9\xe3\
\xea\x62\xef\x33\xdf\x70\x80\x93\x02\xcc\xc7\x49\x0a\x3a\xe3\x1a\
\x4f\xf0\x89\x02\x94\x42\x90\x74\xff\x41\xea\xf5\x9d\xf4\x92\x93\
\xdd\x61\x91\x7c\x8d\x87\x8f\x13\x30\xcf\xc5\x53\xd7\x78\xca\x72\
\x51\xab\xd4\x0b\x5a\xd9\x4a\x97\xe3\xa2\xd6\x8e\x8b\xff\x01\xb4\
\x96\x44\xd0\x4f\x34\x89\xaa\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x04\x30\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x01\x2c\x08\x06\x00\x00\x00\x9f\x5d\xd0\x5d\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc2\x00\x00\x0e\xc2\x01\x15\x28\
\x4a\x80\x00\x00\x03\xc5\x49\x44\x41\x54\x78\x5e\xed\x9b\xcb\x8d\
\xdc\x30\x10\x05\xc7\x4e\xc1\x49\x6c\x6a\xbe\xd9\x19\x6c\x06\x06\
\xf6\xe2\x6c\x1c\x87\x93\x70\x0c\x6b\x48\x18\xf0\x20\x81\x68\x7e\
\x9a\x3d\xe4\x63\xd5\x65\x0d\x5f\xd4\x0f\xa5\xc7\x91\x86\x9c\x2f\
\x3f\x3e\xfe\x7c\x3e\x36\xe2\xeb\xf3\xef\x36\x24\xc3\xbf\xfe\x7d\
\x3f\xff\x43\x95\x9f\xdf\x7e\x9f\x7f\x31\xec\xce\xfb\xdf\xe7\x3f\
\x2a\x79\x7f\x7b\xfe\xc3\x07\x0c\x77\x1b\x6e\x35\x59\x4a\xa7\xf1\
\x6d\x0d\xf7\x07\x3e\xcc\x8e\xb6\x7b\xe0\x74\x1d\x3a\x6c\x12\x61\
\xb3\x86\xc2\x6e\xd3\x61\x93\xa8\xae\xd6\x52\x39\x17\x86\xd5\x21\
\xf0\x8d\x59\xbb\x7b\xa5\x70\x4e\x0c\x27\x56\x31\x7b\xc5\x98\x1b\
\xc3\xea\x10\x58\x86\x4c\x97\x31\x6c\xad\x72\xab\x83\x61\x75\x08\
\xac\x0e\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\xf8\xdc\xab\
\x71\xde\x7d\x7f\x09\x99\x1c\x18\x56\x87\xc0\x89\x55\xbb\x6c\xcc\
\x8d\xe1\x1b\xab\x98\x2e\x9c\x13\xc3\xea\x10\x38\xcb\xac\x5d\xae\
\x9c\x6b\x3b\xc3\xfd\x67\x2d\xa3\x77\x29\x1a\xef\x32\xce\x69\x35\
\x13\xd5\x6d\xa7\xeb\xd0\x61\x37\x7a\xbb\xed\x7c\xd7\x70\x22\x7e\
\xd8\x6f\x1e\x26\x01\xc3\xbb\xc0\xe7\xb0\x3a\xac\xd2\xaa\xb0\x4a\
\x0f\x33\xdc\xfa\xc4\xc5\x93\x96\x0f\x7e\x86\x47\xbf\x17\x77\x1a\
\xe7\x7d\xb8\x99\xc3\x6c\xc4\xb7\x1e\x4e\xd7\xa1\xc3\x26\x11\x36\
\x6b\x28\xec\x36\x1d\x36\x89\xea\x6a\x2d\x95\x73\x61\x58\x1d\x02\
\xdf\x98\xb5\xbb\x57\x0a\xe7\xc4\x70\x62\x15\xb3\x57\x8c\xb9\x31\
\xac\x0e\x81\x65\xc8\x74\x19\xc3\xd6\x2a\xb7\x3a\x18\x56\x87\xc0\
\xea\x10\x58\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\x81\xcf\xbd\x1a\
\xe7\xdd\xf7\x97\x90\xc9\x81\x61\x75\x08\x9c\x58\xb5\xcb\xc6\xdc\
\x18\xbe\xb1\x8a\xe9\xc2\x39\x31\xac\x0e\x81\xb3\xcc\xda\xe5\xca\
\xb9\xb6\x33\xdc\x7f\xd6\x32\x7a\x97\xa2\xf1\x2e\xe3\x9c\x56\x33\
\x51\xdd\x76\xba\x0e\x1d\x76\xa3\xb7\xdb\xce\x77\x0d\x27\xe2\x87\
\xfd\xe6\x61\x12\x30\xbc\x0b\x7c\x0e\xab\xc3\x2a\xad\x0a\xab\xf4\
\x30\xc3\xad\x4f\x5c\x3c\x69\xf9\xe0\x67\x78\xf4\x7b\x71\xa7\x71\
\xde\x87\x9b\x39\xcc\x46\x7c\xeb\xe1\x74\x1d\x3a\x6c\x12\x61\xb3\
\x86\xc2\x6e\xd3\x61\x93\xa8\xae\xd6\x52\x39\x17\x86\xd5\x21\xf0\
\x8d\x59\xbb\x7b\xa5\x70\x4e\x0c\x27\x56\x31\x7b\xc5\x98\x1b\xc3\
\xea\x10\x58\x86\x4c\x97\x31\x6c\xad\x72\xab\x83\x61\x75\x08\xac\
\x0e\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\xf8\xdc\xab\x71\
\xde\x7d\x7f\x09\x99\x1c\x18\x56\x87\xc0\x89\x55\xbb\x6c\xcc\x8d\
\xe1\x1b\xab\x98\x2e\x9c\x13\xc3\xea\x10\x38\xcb\xac\x5d\xae\x9c\
\x6b\x3b\xc3\xfd\x67\x2d\xa3\x77\x29\x1a\xef\x32\xce\x69\x35\x13\
\xd5\x6d\xa7\xeb\xd0\x61\x37\x7a\xbb\xed\x7c\xd7\x70\x22\x7e\xd8\
\x6f\x1e\x26\x01\xc3\xbb\xc0\xe7\xb0\x3a\xac\xd2\xaa\xb0\x4a\x0f\
\x33\xdc\xfa\xc4\xc5\x93\x96\x0f\x7e\x86\x47\xbf\x17\x77\x1a\xe7\
\x7d\xb8\x99\xc3\x6c\xc4\xb7\x1e\x4e\xd7\xa1\xc3\x26\x11\x36\x6b\
\x28\xec\x36\x1d\x36\x89\xea\x6a\x2d\x95\x73\x61\x58\x1d\x02\xdf\
\x98\xb5\xbb\x57\x0a\xe7\xc4\x70\x62\x15\xb3\x57\x8c\xb9\x31\xac\
\x0e\x81\x65\xc8\x74\x19\xc3\xd6\x2a\xb7\x3a\x18\x56\x87\xc0\xea\
\x10\x58\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\x81\xcf\xbd\x1a\xe7\
\xdd\xf7\x97\x90\xc9\x81\x61\x75\x08\x9c\x58\xb5\xcb\xc6\xdc\x18\
\xbe\xb1\x8a\xe9\xc2\x39\x31\xac\x0e\x81\xb3\xcc\xda\xe5\xca\xb9\
\xb6\x33\xdc\x7f\xd6\x32\x7a\x97\xa2\xf1\x2e\xe3\x9c\x56\x33\x51\
\xdd\x76\xba\x0e\x1d\x76\xa3\xb7\xdb\xce\x77\x0d\x27\xe2\x87\xfd\
\xe6\x61\x12\x30\xbc\x0b\x7c\x0e\xab\xc3\x2a\xad\x0a\xab\xf4\x30\
\xc3\xad\x4f\x5c\x3c\x69\xf9\xe0\x67\x78\xf4\x7b\x71\xa7\x71\xde\
\x87\x9b\x39\xcc\x46\x7c\xeb\xe1\x74\x1d\x3a\x6c\x12\x61\xb3\x86\
\xc2\x6e\xd3\x61\x93\xa8\xae\xd6\x52\x39\x17\x86\xd5\x21\xf0\x8d\
\x59\xbb\x7b\xa5\x70\x4e\x0c\x27\x56\x31\x7b\xc5\x98\x1b\xc3\xea\
\x10\x58\x86\x4c\x97\x31\x6c\xad\x72\xab\x83\x61\x75\x08\xac\x0e\
\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\xf8\xdc\xab\x71\xde\
\x7d\x7f\x09\x99\x1c\x18\x56\x87\xc0\x89\x55\xbb\x6c\xcc\x8d\xe1\
\x1b\xab\x98\x2e\x9c\x13\xc3\xea\x10\x38\xcb\xac\x5d\xae\x9c\x6b\
\x3b\xc3\xfd\x67\x2d\xa3\x77\x29\x1a\xef\x32\xce\x69\x35\x13\xd5\
\x6d\xa7\xeb\xd0\x61\x37\x7a\xbb\xed\x7c\xd7\x70\x22\x7e\xd8\x6f\
\x1e\x26\x01\xc3\xbb\xb0\x99\xe1\xc7\xe3\x3f\xa9\x16\xd5\xd6\x83\
\xde\x4e\x24\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x07\xae\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x00\x3c\x08\x06\x00\x00\x00\x3a\xfc\xd9\x72\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x07\x63\x49\x44\x41\x54\x68\xde\xed\x5b\x5f\x68\
\x5c\x55\x1e\xfe\xce\xb9\x77\xee\xcc\x9d\x6b\xb6\xb6\x4d\x55\x9a\
\xd8\x0d\x31\x99\x99\x98\x92\x6e\x12\x17\x51\x84\xe9\x83\x81\xbe\
\x8c\x6c\x41\xaa\xe0\x8b\xe0\xb2\x2c\x7d\xb3\xd4\xa2\x96\xea\x83\
\xe0\x2e\x2a\xfa\xd4\x22\x3e\xc9\x82\x42\x83\x60\x31\xbb\xe0\x92\
\xc2\xf6\x2e\x61\x17\xc1\x66\x6c\x71\x9c\x99\x24\x66\x43\xff\x04\
\x89\xad\x35\x8c\xf3\xe7\xde\xdc\x7b\xce\x3e\xdc\x3f\x73\x67\x92\
\xc9\x4c\x72\x67\xea\x8c\xe6\xf7\x14\x32\xf7\xcf\xf9\xee\x77\xbe\
\xef\x77\xce\xef\x9c\x03\xfc\xca\x82\x38\x7f\xfc\xf9\xcd\x4b\x30\
\x0d\x02\x42\x9a\xf7\x70\x0e\x02\x46\x28\x38\xc8\x16\x1b\xc5\x41\
\x39\x03\x01\xf7\xdf\x06\x0e\x08\x22\xc7\xfb\xaf\x1e\xae\x04\x7c\
\xf4\x85\xff\xe2\xfa\xfc\x57\xe8\x7e\x60\xac\x29\xa0\x09\x38\x6e\
\xa4\x12\xf1\xab\x5f\x7f\xaf\x6e\xe7\xfe\x91\x83\xfb\xe2\xbd\xc3\
\x53\xea\x56\x3f\x56\x35\xd8\x5b\xdf\xcd\xe2\xc1\xc1\xdf\xe1\xfe\
\x87\x34\xbc\xff\xea\x61\x88\xce\x8f\xd7\xe7\xbf\x42\xe1\x47\x01\
\x9f\xff\xfb\xd1\xa6\xb0\xbb\xbf\xff\x38\x96\x17\xbf\x57\x9f\x79\
\x62\x0a\x8a\x99\x6f\x88\x69\x87\xd9\xbc\xa0\xe0\xfc\x4c\x42\xbd\
\x55\xf8\x1b\x76\x07\x3f\x89\xa7\xd2\x2b\xea\x76\xdb\xf1\xf0\xc8\
\x07\x16\x91\xbf\x7d\x18\x00\xca\x80\xbb\x1f\x18\xf3\x05\x36\xfa\
\xe8\x87\x08\xef\x7d\x0c\xe0\x1c\x26\x11\xa1\x51\x09\x7f\xe8\x3b\
\x8a\xd7\xcf\x4c\xf0\x03\x3d\x80\xbe\x06\x30\xb6\xf9\x33\x28\x05\
\xa4\x00\x70\xed\x26\xa0\xbd\x31\x4d\xd2\xe1\x18\x28\x3b\xa1\x46\
\x7f\x33\x83\xec\x17\xcf\x6f\xab\x5d\xdf\x5c\xfd\x13\x8e\x1c\xfb\
\x02\x84\x94\x2a\x01\xfb\xed\xc6\xe3\xe1\x3d\x50\x7e\x9a\x05\x23\
\x14\x06\x11\xa1\xd1\x20\x86\xf2\x19\x44\xfa\x01\x21\xb0\x0b\x4a\
\xf9\x55\x75\xc2\x40\xa4\x7f\x15\xa3\xf9\x2b\x90\x51\x82\x6c\x96\
\x50\x0a\xef\x41\xd6\x8f\xbc\x3c\xd8\x44\xbf\x5d\x77\x38\xb1\x84\
\x48\x71\x1e\xaf\xd9\x4c\x1a\x06\x60\x98\xd6\x6f\xa1\x20\x20\x88\
\x41\x17\x08\x78\x1d\x8a\x09\x05\x60\xdd\xf3\xd2\x47\x27\xb9\xbe\
\x56\x66\xbc\x28\x4c\x93\x39\x79\x10\xa9\xa9\x3e\x5f\xed\xf5\x0d\
\x78\xb0\xb8\x80\xf1\x5c\x12\x03\x7d\x16\x93\xeb\x1e\xc9\x4b\x00\
\xd7\x01\xd0\x06\x5c\x86\x01\x60\x00\x44\xc8\xe1\x7b\x20\xdb\x1f\
\x6a\xa0\x6f\x15\xe3\xb9\x24\x38\x08\x52\x3e\xdb\xbb\x65\xc0\xfb\
\x07\x8f\xa3\x3b\x7a\x02\x3a\x95\x10\x2b\x64\xf1\xe6\xe9\x27\x79\
\xa4\x1f\x10\x44\x65\x13\x26\xe9\x16\xde\x60\x5f\xcb\x75\x0f\xe3\
\x0a\x5e\x9e\x3c\xc5\xe7\x16\x01\x60\x9a\x64\xc2\x51\x48\x4c\xc7\
\xad\xec\xbb\x58\x9e\x3f\xd7\x5a\xc0\x87\x7b\x8f\x20\x94\x4b\xa2\
\x28\x84\x10\xcb\x67\x6d\x8d\xee\xb6\x98\x69\x94\xc9\x86\x82\x95\
\x19\x27\x12\x84\xc0\x6e\x44\xfa\xef\x60\x34\x77\x05\x32\xb3\xb5\
\xdd\x7b\x04\x1f\xb7\x0a\x70\xb5\x56\x1d\x7d\x59\x1a\x75\x1a\xd7\
\x2c\xb0\x55\x8c\x73\x06\x90\xe6\x68\xbb\x61\xc0\x91\xe2\x3c\xc6\
\x3c\x5a\x95\x9d\x5b\xb7\xa2\x51\x5f\x6c\x1b\x1b\x6a\x7b\x2c\x97\
\x04\x80\x86\xb5\x2d\x36\xa2\xd9\xc3\xbd\x47\xf0\xda\x99\x09\x3e\
\xd0\x07\x08\xa2\xbc\x81\x56\x5b\x09\x76\x33\x6d\xcb\x78\x65\xf2\
\x14\x5f\x58\x02\x64\xf3\x33\x72\xe9\xc6\xe7\x75\x35\x5d\xb7\xa5\
\xdd\xd1\x13\x08\x31\x0d\x07\x7a\x6c\x17\x26\x92\xf5\x52\x6e\xd8\
\x8e\x7a\xb7\xc3\x66\x9b\xeb\xb6\xb6\x77\xe1\x40\x0f\x10\x62\x1a\
\xba\xa3\x27\x1a\xfd\x6c\xb5\x43\xa7\x12\x8a\x42\x08\xfa\x9a\xb7\
\x43\x50\xfc\xfc\x41\xdd\x4e\xaa\xaf\xc1\x6a\x23\x95\xfc\x77\xe9\
\x58\x21\x8b\x58\x3e\x0b\x29\xe0\xcd\x95\x6d\x12\xb6\x99\x49\x01\
\x20\x96\xcf\xa2\x48\x43\xc8\x6c\x17\xf0\x70\x62\x09\x83\xc5\x05\
\x4f\x9e\x0d\x5a\x06\xd5\x56\xc1\x00\x5e\x82\x2c\x07\x71\x7a\xf2\
\xa4\x9d\xa7\x2f\x92\x79\x79\xa0\xa6\x6b\x8b\x9b\xb9\xf2\x78\x2e\
\xd9\xc2\x3c\xdb\x44\xd0\x24\x04\x21\x10\x46\xa4\xff\x0e\x1e\xc9\
\xcd\x82\x80\xd7\x74\x6d\x71\xa3\x59\xcf\x78\x78\x8f\xc7\x95\x95\
\x16\xe7\xd9\x66\xe6\x69\x6b\x44\xe6\xb8\xf6\xe5\xc2\x0f\xeb\x66\
\x59\xeb\x10\x84\xf7\x3e\x06\xc5\xcc\x7b\x5c\x59\xb4\x99\x65\x68\
\xdf\xb0\x7b\x1f\x11\x2b\x5c\x5b\xda\xfb\x04\x86\x87\xee\x8b\x6f\
\xee\xd2\x9c\x5b\x53\x3c\xa3\xdd\x5c\x79\x3b\xae\x1d\xc4\x1d\xed\
\x69\xd5\x5b\x2a\x5a\x87\xc4\x24\x22\x0c\x22\xba\x53\xbc\xb6\x72\
\xe5\x86\x66\x5b\x65\xd7\x1e\x2a\x64\xb0\xbc\x78\x0e\x37\x52\x89\
\xb8\x53\x6d\x11\xbd\xe5\x95\xfd\xfd\xc7\xa1\x51\x09\x1a\x0d\x76\
\x68\x4d\x72\x9d\x6b\x93\xa0\x3e\x85\xf3\x33\x09\xf5\xf7\xcf\xd2\
\x4a\x86\x6f\xa4\x12\xf1\xe5\xc5\x73\x18\x2a\x64\x31\x94\xcf\x20\
\xd4\xa9\x98\x5d\xd7\xb6\xb4\xac\x98\x79\xb7\x82\x5a\xc1\xf0\xd5\
\xaf\xad\x82\xdb\xeb\x67\x26\xda\x38\xef\x6e\x5d\xcb\x8c\xd0\xda\
\x69\xa9\xc2\x9d\x9d\x81\x7a\x47\x18\xd6\xc6\x23\x30\xc6\xb0\xae\
\x52\x5a\x81\x86\x11\xda\x86\x63\xe6\xd6\xf0\xef\xf6\x73\xb7\x94\
\xda\x49\xee\x5c\x3b\xc6\xb6\x3c\x5b\xfa\x45\x33\xbc\x03\x78\x07\
\xf0\x0e\xe0\x1d\xc0\x3b\x80\xdb\x19\x30\x01\x07\x75\xfe\x43\x3a\
\xf8\x5b\xd8\x6d\xa7\x14\xeb\x76\x11\x54\xa0\xa2\x9c\xd9\xc5\x3a\
\xa3\x3c\x10\xef\xc4\xc9\x03\x2c\x0c\x52\xc0\xc2\x54\x13\x70\x5e\
\x50\x70\xed\x26\x60\xae\xad\xda\x13\x07\xda\x99\x9d\x96\x97\x60\
\xae\xad\xe2\xda\x4d\x2c\xe5\x05\xc5\xed\xbd\x15\x93\x87\x91\x83\
\xfb\xe2\xe7\x67\x12\xaa\xf6\xc6\x34\x19\xcd\x5f\xc1\x4b\x1f\x9d\
\xe4\x72\xf8\x9e\x0e\x28\xef\x54\x81\x25\x12\x8a\x85\xdb\x78\xfb\
\xb9\x77\x48\x52\x39\x84\x0b\x33\x13\x18\x39\xb8\x2f\x4e\x39\x53\
\x2b\x00\xf7\x0e\x4f\xa9\xa6\xf9\x54\x3c\x1d\x8e\xa9\x32\x4a\xd0\
\xd7\x60\xad\xe1\x10\xda\x39\xe3\x6a\x5b\xbb\xfa\x1a\x90\x51\xa2\
\x48\x87\x63\x2e\x36\x02\xad\xb2\x4b\x73\x10\xa4\xd2\x2b\xaa\xc4\
\x34\xc8\x66\xa9\x03\xb5\x5c\xa9\x5d\xd9\x2c\x41\x62\x5a\xc5\xe4\
\x7f\xc3\xb4\x74\x7b\xee\x3d\x94\x68\xd0\xa3\x65\xc3\x5a\x4f\x6a\
\x6b\x3d\x53\x7b\xcd\xcb\x70\xb4\x8b\x12\x0d\x82\xfd\xef\xf1\x78\
\xf5\x95\xeb\xea\xd2\xcb\x0b\x67\xf1\xf1\xc2\x59\x14\x85\x69\x32\
\x9e\x4b\xe2\xe5\xc9\x53\x5c\x08\xec\xb6\x76\x74\x71\x03\xed\x59\
\x88\x17\x01\x50\x98\x46\x1e\x7f\x3d\xf6\x16\xb9\xdc\x35\x8a\x4f\
\xff\x35\x01\x00\x6a\x5d\xc0\x4e\xcc\xc9\x83\xe0\x20\x98\x5b\x04\
\x22\xfd\x77\xec\x85\x6f\xb1\x3d\xd9\xe5\x25\x98\x86\x86\xb9\x45\
\xe0\xcb\xae\x31\xcc\xcb\x03\x35\xaf\xae\x89\x20\x35\xd5\x67\x2f\
\x57\x4c\x93\xd1\x5c\xbb\xba\x76\x95\x2b\x77\x1d\xc2\x85\x8b\x4f\
\x6e\x7a\x47\x5d\xca\x32\xe1\x28\x64\xd6\xa6\xae\x5d\xe5\xca\x99\
\x70\xd4\xff\x58\x5a\x62\x7a\x9b\xba\xf6\x46\xae\xac\xfb\x07\x6c\
\x7e\xfb\x78\xbc\xd2\xb5\xad\x95\x77\xc7\x28\x7e\x9e\x6e\x2c\xba\
\x3b\x11\xbc\xae\x7c\xf5\xef\x03\x75\xef\xae\xdb\xa5\x53\xe9\x15\
\x35\x95\x7e\x0a\x45\x61\x9a\x8c\xe5\x92\x78\x65\xf2\x14\x17\x02\
\x92\x75\x2b\x81\x3d\x04\xbd\x1b\x2b\x8b\xac\x9c\x7e\x6c\x66\x4d\
\xa3\x88\xbf\x1c\x7b\x8b\xcc\x96\x5d\xd9\x3f\x60\xaf\x6b\x03\xc0\
\xc2\x12\x70\xa0\x67\xd5\xdd\xb6\x24\xcb\x41\x80\x84\x3c\xbb\xe8\
\x5a\xc8\x2a\x2f\xa1\x58\xb8\x0d\xef\xb6\xa5\xd9\xae\x51\xb7\x6d\
\x4d\x05\xec\xb8\xb6\x6c\x7e\x46\x42\x4c\x73\x37\xa6\x9d\x9e\x3c\
\xc9\x85\x40\xb8\x85\x79\xda\x9b\x67\x35\xbc\xfd\xdc\x3b\x24\xa3\
\x44\xad\x8d\x69\x34\xd8\x30\xb3\x5b\x06\xec\xc4\x95\xef\xfe\x18\
\x17\x1e\xfa\x8f\xaa\x53\x09\x45\x1a\xf2\xe4\x69\xa5\xdc\xdd\x9a\
\xc2\x36\x2d\xcf\xc9\xb9\x01\xd3\xc8\x63\x6e\x11\x48\x76\x1d\x82\
\xb3\xf5\xb0\x11\xcd\xfa\x06\x9c\x4a\xaf\xa8\x48\x5b\x2f\xb2\x36\
\x90\x5c\x24\x8f\xe4\x66\xed\x11\xd9\xae\x26\x68\x7b\x23\xad\x5a\
\x23\xa8\x2f\xbb\xc6\xea\xe6\xd9\xa6\x03\xae\x8e\x79\x79\x00\x04\
\xbc\xb6\xb6\x5d\xc6\x1b\xcf\xab\x1b\x69\xf5\x72\xd7\xe8\xa6\x23\
\xa8\xbb\x06\x78\x73\x6d\x87\xca\x8c\x37\x1c\x46\x53\xb4\x5a\x17\
\x30\xf7\x79\x80\xe4\xd2\xf5\x7f\x62\x6f\xe4\x45\xe8\x34\x88\x22\
\x42\x98\x5b\x04\x71\x18\x67\x0d\x12\xec\x3d\x02\x90\x54\x0e\x21\
\x1d\x8e\x41\x62\x9a\x33\xeb\xd9\xf6\xb9\x07\x2f\x36\x17\x30\x33\
\x09\x86\x63\xfb\xe2\xa9\xcc\xf6\x4e\xa1\x2c\x2f\x9c\xc5\xf2\xc2\
\x59\x0c\x0f\xdd\x17\xbf\x90\x5e\x51\x83\x7a\xe3\x87\x3b\x2a\x8a\
\x88\xf6\x21\x8f\x0b\x33\x15\x8c\xaa\x7e\xc8\x60\x26\x71\x41\xbb\
\x80\x95\x7b\x4d\xf4\x0c\xff\x43\x7d\x70\x84\xfb\x3a\xff\x40\xc0\
\x55\x41\x48\xc4\xcf\xcf\x24\x7c\x35\xb2\x59\xc7\x78\x98\x49\xa0\
\xdc\x6b\x42\x10\xb9\xdd\x3e\x3b\x9a\x79\x50\x6b\xbb\x07\xb4\xaa\
\x99\x6e\xc5\x41\xad\x5f\x5d\xfc\x1f\x2c\xce\x86\x53\xbc\xc2\xd4\
\x6e\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x08\xa2\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x00\x3c\x08\x06\x00\x00\x00\x3a\xfc\xd9\x72\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\
\xbb\x7f\x00\x00\x08\x57\x49\x44\x41\x54\x68\xde\xed\x5b\x4f\x68\
\x1b\xd9\x1d\xfe\xde\x9b\xc9\xcc\x68\x54\x69\x57\xb1\x91\xb3\x21\
\xa5\xe9\x5a\xb6\xa4\x5d\x68\x62\x3b\x74\x9b\x12\x50\x52\x5c\xc8\
\xc5\xa1\x66\x49\xe2\x2c\x3d\x14\x0a\xa5\xf8\xd6\x1c\xf7\x5a\xe8\
\xb1\x3d\x25\x5d\x7a\x2a\x3d\xb8\x91\x73\xc8\x12\xf7\xb0\x25\xa1\
\x89\x8a\xa9\x77\x1b\xff\x49\x02\xa9\x47\xb6\xbc\x0d\xa4\x38\x96\
\xc9\xc6\x59\xcb\x33\x9a\x19\x6b\xde\xeb\x41\x1a\x45\xb2\x65\xeb\
\xaf\x8d\x45\xf2\xc0\x58\x30\x9a\xd1\xef\x7b\xdf\xfb\xbe\xdf\x9b\
\xf7\x7e\x0f\x78\xc3\x1a\x71\x3f\xfc\xfa\x77\xf7\xe1\xe4\x08\x08\
\x69\xdd\xc3\x39\x08\x18\xa1\xe0\x20\x75\x06\xc5\x41\x39\x03\x01\
\x6f\x3e\x06\x0e\x08\x22\xc7\x67\x9f\x9e\x2d\x07\x3c\xfc\xcb\x29\
\x3c\x5b\x7c\x88\xce\x23\xfd\x2d\x01\x4d\xc0\x31\x75\x6f\x34\xb6\
\xb6\x3a\x9b\x68\xe4\xfe\x40\xb0\x3f\x76\xfa\xdc\xf5\x44\xbd\x9d\
\xb5\x15\xec\x8b\x95\x59\x7c\xb7\xe7\x24\xba\xba\x2d\x7c\xf6\xe9\
\x59\x88\xee\xc5\x67\x8b\x0f\x61\xbc\x12\xf0\xc5\x3f\x3f\x6a\x09\
\xbb\x47\xdf\x1f\xc5\xda\xea\x6c\xe2\xf2\x99\x09\x78\x1d\xbd\x26\
\xa6\x5d\x66\x75\xc1\x8b\xf8\xe4\x50\xe2\xe1\x83\xbf\x20\xb3\xf6\
\xef\x58\x66\x6d\x3a\xd1\x68\x1c\x1f\xfc\xe0\x4f\x79\x22\xbf\xf7\
\x01\x00\xbc\x06\xdc\x79\xa4\xbf\x29\xb0\xe1\x8f\xfe\x0c\xb5\xe3\
\x34\xc0\x39\x1c\x22\xc2\xa2\x12\x7e\x76\x7c\x18\x1f\xa7\xe3\x3c\
\x6a\x68\xb0\x88\x0c\x87\x08\xbb\x3e\x43\xe0\x0e\x64\x6e\x61\x5e\
\x8d\xc0\xfa\xc9\x1d\x32\xaf\x46\xd0\xc1\xac\x84\xfd\xcd\x24\x92\
\x5f\xfd\xa2\xa1\xb8\xfe\xf3\xf8\x57\x38\x7f\xe9\x2b\x10\x62\x96\
\x03\x6e\x76\x18\x0f\xa8\x87\xe1\xdd\x98\x05\x23\x14\x39\x22\xc2\
\xa2\x32\xa2\xba\x86\x3e\xe3\x31\x42\xba\x06\x46\x65\xe4\xaa\x00\
\x16\xb9\x03\xca\x2c\x28\xb0\x31\xaf\x47\xe0\x81\x09\x8f\x63\xc2\
\x54\x0f\x23\xd9\x8c\xbc\x4a\xb0\x89\xcd\x0e\xdd\x0f\x87\x9e\xa2\
\x37\xbb\x88\xe1\x74\x9c\x47\x75\x0d\x16\x95\x91\x23\x22\x18\xa1\
\xf0\x3a\x3a\xfc\xb9\x75\xe8\xe2\x3b\xb5\x0f\x69\xaa\xc0\x9f\x5b\
\xc7\xf0\x8b\xdb\xdc\x7c\x29\xc3\xe3\x98\xd0\xbc\x61\x64\x07\xef\
\x90\x05\x4f\x0f\x9e\x4c\x1c\x6f\x2a\xde\xa6\x01\xf7\x64\x53\x18\
\xc8\xcc\xa1\x2f\xf3\x08\xdd\x46\x12\x8c\xba\x43\x37\x3f\xb4\x4d\
\x22\xc3\xa4\x4a\xcd\x8e\xcb\x09\x81\xc4\x6c\xf4\x64\x97\x20\x33\
\x0b\x84\xd9\xf0\x30\x13\x49\xb5\x17\x1c\x04\x4f\x9a\x8c\xb7\x6e\
\xc0\x47\x7b\x46\xd1\x19\xbe\x0a\x9b\x4a\x88\x18\x49\x8c\xa4\xc7\
\xf9\xa9\xcc\x2c\x02\xb9\x57\xdb\x98\xe4\x20\xe0\x84\xd4\x95\x5e\
\x08\x38\x38\x21\xb0\x20\x61\x53\x10\x41\xa9\x07\x81\xdc\x1a\x46\
\xd2\xe3\x3c\x64\xa4\x80\xc1\x3b\x44\x53\xc3\x90\x98\x8d\x17\xc9\
\xdf\x63\x79\xf1\xfa\xde\x02\x3e\x7b\xec\x3c\x94\xcc\x1c\xb2\x82\
\x82\x88\x9e\xc4\x40\x66\x0e\xdd\xd9\x14\x36\x04\x7f\x5d\x4c\x56\
\xcb\xdf\x0e\x11\xe0\x40\x00\x27\x04\x32\xb3\xd0\x9d\x4d\x81\x83\
\x20\xa9\xf6\xc2\xc3\x0a\xda\x3e\x76\x1e\x63\x7b\x05\xb8\x54\xab\
\x11\x3d\x89\xac\xa0\x40\x61\x16\xfc\x4e\x06\x1b\x82\x1f\x39\x2a\
\xb6\x04\x6c\x25\xc6\x73\x54\xc4\x06\xfc\xf0\x3b\x99\xa6\xb5\x5d\
\x33\xe0\xde\xec\x22\xfa\x33\x73\x38\x99\x79\x84\x90\x91\x04\xa7\
\x12\x2c\x2a\xc3\x24\x32\x2c\x2a\xef\x09\x58\xb7\x31\x50\x58\x54\
\xde\xa6\x6d\x85\x99\xd0\xd4\x5e\x00\xa8\x59\xdb\x62\x2d\x9a\x3d\
\x7b\xec\x3c\x86\xd3\x71\x7e\x32\xf3\xa8\x4c\xab\x0c\xb4\x6e\x8d\
\x36\xc3\xf4\x76\x6d\xbf\xc2\x48\xfa\x26\x8f\x18\x0b\xf0\x9c\xbb\
\x4d\xee\xff\xef\x8b\xaa\x9a\xa6\xd5\x7e\xa8\x33\x7c\x15\x0a\xb3\
\x10\xd1\x93\x08\x19\x49\x28\xcc\x84\x49\x15\x6c\x92\x43\x70\x88\
\x80\x66\xa6\x7e\x8d\x6a\x7b\x93\x1c\x82\x49\x15\x28\xcc\x44\xc8\
\x48\x22\xa2\x27\xa1\x30\x0b\x9d\xe1\xab\x55\x9f\x51\x15\xb0\x4d\
\x25\x64\x05\x05\x59\x41\x01\xa7\x12\x18\xa1\xfb\xc2\x68\x2d\x8c\
\x33\x42\xc1\x4b\xe2\xb3\xa9\xd4\xfc\x90\x8e\x94\xf4\xa0\x45\x65\
\xb0\xea\x7d\xb4\x6f\xcd\xd5\xb6\x3b\x02\xb3\x54\x81\xd6\x28\xe0\
\x0f\x87\x9e\xa2\x27\x9b\xc2\x48\x7a\x9c\x0f\x64\xe6\xe0\x77\x32\
\x30\x89\x0c\x4e\xc8\xc1\x01\x4c\x28\x4c\xc8\xe8\xb2\x57\xf1\x49\
\x3a\xce\xc3\xc6\x02\x30\x78\x97\x2c\x7a\x42\x3b\xba\xb6\xb8\x9b\
\x2b\x0f\x64\xe6\x70\x2a\x33\x5b\xcc\xb3\x7b\xed\xc6\x8d\xbe\x6f\
\xab\x8e\x81\xa0\xbd\x02\x02\x8e\x94\x1a\x02\x01\xdf\xd1\xb5\xc5\
\x4a\x6f\x3d\x03\xea\x61\x0c\xa7\xe3\xbc\xaf\xe0\xca\x7b\x99\x67\
\x5b\x99\xa7\x5d\xd7\x0e\x17\x5c\x7b\xc6\x78\xb9\xed\x2d\x6b\x9b\
\x20\xd5\x8e\xd3\xf0\x3a\x3a\xa2\xba\x86\x6e\x23\x09\xf9\x00\x6a\
\x77\x27\x2d\xcb\xcc\x42\x77\x89\xe7\x48\x1d\x67\xe0\x0b\x9c\x1a\
\xd8\xdd\xa5\x79\xde\xfd\x2c\x2a\x83\x51\xf9\xc0\xb8\x72\x63\xae\
\x2d\xc3\x17\xf8\xe1\x4c\x69\xfc\xdb\x00\x3b\x44\x44\xae\xf0\xb7\
\xdf\x79\xb6\xd5\xae\x1d\x35\x34\x2c\x7f\x7d\x1d\x53\xf7\x46\x63\
\x2e\x0e\xb1\xb4\x87\x8e\xbe\x3f\x0a\xab\x30\x65\x64\x84\x02\x6d\
\xc0\xec\x8e\xae\xbd\x3a\xce\xa3\xaa\x36\x20\x9f\x99\x98\x8d\x4f\
\x0e\x25\xf2\x78\x4a\x18\x9e\xba\x37\x1a\x5b\xfe\xfa\x3a\xa2\x46\
\x12\x51\x5d\x83\xd7\xd1\xe1\x10\xb1\xad\x18\x76\x67\x62\x5e\x47\
\x47\x48\xd7\x10\x35\x34\xc3\xeb\xe8\xc5\x6b\x65\x0c\xbb\x0b\x6e\
\x1f\xa7\xe3\xbc\xcf\x78\x0c\x7f\x6e\xfd\xc0\xe5\xdd\x7a\xb4\xcc\
\xa8\x0c\x8b\xc8\x9a\xcb\x6c\x45\x0d\x7b\x1d\x1d\x51\x43\x43\xa8\
\xc8\x70\x7b\x69\xb8\x94\xe9\x1c\x11\x2a\xc6\x4f\xb7\x6a\xc0\x22\
\xed\xe5\xce\xf5\x36\x5a\x49\x03\xb9\x36\x65\xb6\x6e\xc0\x6f\x42\
\x7b\x0b\xf8\x2d\xe0\xb7\x80\xdf\x02\x7e\x0b\xb8\x6d\x00\x13\x70\
\x08\xdc\x81\xc8\x9d\xb6\x9e\x74\x10\x70\x88\xdc\x81\x50\x01\x47\
\x19\x60\xca\x19\x64\x6e\x81\x32\x0b\x94\xb3\xb6\x9d\x56\x52\xce\
\x40\x99\x95\xc7\xc2\xd9\xce\x4b\x3c\xba\xe0\xc5\xbc\x1a\x81\x02\
\x1b\xfe\xdc\x3a\x24\x66\x83\x13\xd2\x36\xc0\x4b\x2b\x08\x9e\xcb\
\xef\x61\x5e\x8d\x40\x17\xbc\xc5\x6b\x65\x0c\x07\x82\xfd\xb1\xf8\
\xe4\x10\xc6\xba\x2e\x93\xb1\xe0\x25\x92\x96\x82\x50\x2a\xf4\xd0\
\x81\xd6\x27\x67\x50\xb8\x85\xb4\x14\xc4\x58\xf0\x12\x19\xeb\xba\
\x8c\xf8\xe4\x10\x02\xc1\xfe\x98\x8b\xa3\x08\xf8\xf4\xb9\xeb\x09\
\x5f\xe0\x54\x6c\x5e\x8d\x40\xf3\x86\x61\x16\xd6\x88\x28\xda\x08\
\x30\x18\x64\x66\xc1\xa4\x32\x34\x6f\x18\xf3\x6a\xa4\x88\x6d\x1b\
\xc3\x1c\x04\x99\xb5\xe9\x84\xc4\x2c\x78\x9c\xfc\x76\x24\x61\x76\
\xdb\x68\xd9\xd5\x2e\x61\x76\x31\x7e\x89\x59\x65\x2f\xff\x15\xd3\
\xd2\x37\x0b\x7f\x28\xf6\xd0\x92\x1a\x2e\xae\x06\x1e\x64\xa6\x5d\
\x66\x2d\x2a\x63\x49\x0d\x17\x47\xe8\xd3\x2f\xaf\x6c\xfb\xee\xb6\
\x75\xe9\xe5\xd4\x35\x8c\xa5\xae\x21\x3b\x78\x87\x24\xd5\x5e\x8c\
\xa4\xc7\x79\x77\x36\x85\x0d\x1c\xbc\x85\x78\x97\x3d\x91\xe5\xf0\
\x1d\x67\x1d\x4b\x52\x08\x37\xba\x2e\x92\x19\x5f\x1f\x6e\xdd\xfd\
\x69\xc5\xef\xef\xb8\xf3\xb0\xe0\xe9\x01\x07\x41\xc8\xc8\xef\xbc\
\xfb\x9d\xcc\x81\x73\x6d\xd7\x95\x0d\x41\xc5\x8a\xd4\x85\x19\x5f\
\x1f\xa6\x7d\xfd\x58\xf4\x84\x76\xbc\x67\x47\xc0\x4f\x26\x8e\xe7\
\xb7\x2b\x0a\x4c\x0f\xbf\xb8\xcd\x7b\xb2\x4b\xb0\x20\x55\xad\xb7\
\xda\x4f\x57\x96\xb9\x8d\x67\xd2\x31\xdc\xea\xbc\x40\xe6\x7c\x27\
\xf0\xf9\xdd\xc1\x5d\xef\xa9\xba\x7b\xa8\xa9\x61\x78\x98\x09\xf3\
\x65\x5e\xcb\x9b\x82\x08\x07\xc2\x81\xd2\xae\xeb\x39\x9a\x1a\x6e\
\x7e\x2e\x2d\x95\xb8\xde\x41\x72\xed\xca\xae\x6c\x37\x0f\xf8\xbf\
\xff\xba\x12\x73\x7b\x30\xa5\x86\x8b\x3b\xef\x87\xf8\x66\xc5\xb9\
\xea\x5e\x6b\x56\xe0\x0e\x0e\xf1\xcd\x62\x25\x42\xaa\xc4\x95\x1f\
\xff\x2d\x54\xf5\x19\x55\x87\x74\xe6\xe5\x83\xc4\xd8\xbd\x0b\xc8\
\x0e\xde\x21\x9a\xda\x8b\x91\xf4\x4d\x5e\x56\xd4\x82\xfd\x59\xe1\
\x74\x19\x95\xb9\x5d\x2c\x6a\x79\xae\x1e\xc1\x8d\xae\x8b\x64\x76\
\x17\x57\xae\x1b\x70\xa9\x6b\x03\x40\xc4\x58\x80\x49\x95\x62\xd9\
\x52\x97\xbd\x0a\xd5\x31\x90\xa3\xe2\x9e\xed\x30\x52\x30\x88\x2c\
\x07\x43\x50\xf1\x4c\x3a\x06\x93\xbe\x2e\x5b\x9a\xf5\xf5\x15\x63\
\x6b\x29\x60\xd7\xb5\x3d\xe7\x6e\x13\xe5\xb0\x55\x2c\x4c\xfb\x24\
\x1d\xe7\x41\x7b\x65\xcf\xf2\x74\x69\x9e\x5d\x91\xba\x70\xab\xf3\
\x02\xd1\xbc\xe1\x7c\x61\x1a\x95\x6b\x66\xb6\x6e\xc0\x6e\x9b\x78\
\xf4\xdb\xd8\xf7\x7f\xfc\xd7\x84\x4d\x25\x64\xa9\x82\xb0\xb1\x00\
\x02\x8e\x40\xee\x15\x14\x66\x16\xcb\x99\x1a\xa9\x84\xdf\x9a\x5f\
\x29\x18\x28\x67\xf9\x19\x94\x14\xc2\x8c\xaf\x0f\x73\xbe\x13\x70\
\x4b\x0f\x6b\xd1\x6c\xd3\x80\x33\x2f\x1f\x24\xdc\x1f\xd2\x00\x60\
\xf0\x2e\x49\xa9\x21\x8c\xa4\x6f\xf2\xee\x16\x68\xbb\x92\x56\x57\
\xd4\x30\x6e\x74\x5d\x24\xd3\xbe\xfe\xaa\x79\xb6\xe5\x80\xb7\xb6\
\x45\x4f\xbe\xa6\x22\x6c\x2c\x20\xbb\x45\xdb\xb5\x56\xc2\x57\x7a\
\x9f\xdd\xaa\xd5\x19\x5f\xdf\xae\x33\xa8\x7d\x03\xbc\xa3\xb6\x57\
\xc7\xc7\x83\xd6\x72\x77\x2d\x85\xe1\x00\xfa\x81\xd7\x05\xe2\xcf\
\xe5\xf7\x9a\xd6\x6a\x55\xc0\xbc\x49\xaf\xb9\xff\xec\xef\xe8\xe8\
\xfd\x0d\x6c\x2a\x23\x0b\x05\x51\x55\xfb\xb9\x09\x29\x60\x11\x99\
\xee\x32\x15\xfd\xb6\xf0\xdf\x00\xca\x8f\x00\xcc\x79\x4f\x60\x5e\
\x8d\x40\x62\x16\x9e\x7e\x79\x25\x06\xa0\xe1\x73\x0f\xa5\xd8\x8a\
\x80\x99\x43\xe0\x7f\x67\x20\xb6\xfe\xed\x4c\x43\x0f\x5e\x4e\x5d\
\xc3\x72\xea\x1a\x7c\x81\x53\xb1\xe4\xda\x74\x42\x3e\x33\x61\x7b\
\xfd\x83\xe9\x46\x87\xf4\xe7\xff\x28\x63\x34\xd1\x0c\x19\xcc\x21\
\x45\xd0\x45\xc0\xde\x77\x1d\xfc\x68\xf0\x8f\x09\x2a\xf0\xa6\xce\
\x3f\x10\xf0\xc4\xd4\xbd\xd1\x58\x7c\x72\xa8\xa9\x20\x5b\x75\x8c\
\x87\x39\x04\xde\x77\x1d\x08\x22\x2f\xc4\x57\x68\xad\x3c\xa8\xd5\
\xe8\x01\xad\xad\x4c\xef\xc5\x41\xad\x37\xae\xfd\x1f\xda\x88\x8f\
\x47\x37\xa4\x0a\xa4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
\x82\
\x00\x00\x04\x2f\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x01\x2c\x08\x06\x00\x00\x00\x9f\x5d\xd0\x5d\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc2\x00\x00\x0e\xc2\x01\x15\x28\
\x4a\x80\x00\x00\x03\xc4\x49\x44\x41\x54\x78\x5e\xed\x9b\x4b\x8e\
\x14\x31\x10\x05\x1b\x2e\x32\x0b\xce\xc3\x9c\x05\xcd\x41\x58\x70\
\x94\x61\xcf\x4d\x58\x70\x12\x90\x47\x5d\x2c\x2c\x59\xe9\x4f\x3a\
\xcb\x7e\x8e\xd8\x0c\x62\x53\xf9\x14\xf5\xdc\x55\x6d\xf7\xa7\x6f\
\x3f\x7e\xfd\x7d\x1c\xc4\xe7\xe7\xdf\x63\xf8\x6f\xf8\xfd\xe5\xfb\
\xc7\x7f\xa8\xf2\xfa\xe7\xed\xe3\x2f\x86\xbd\xf9\xfd\xfa\xf3\xf9\
\xaf\x36\xbe\xbc\x7f\x7d\xfe\xcb\x07\x0c\x8f\x1a\xee\x35\x59\xcb\
\xa8\xf1\x63\x0d\x0f\x07\x4e\x66\x67\xdb\x4d\x78\x5d\x87\x0e\x5b\
\x44\xd8\x6c\xa1\xb6\xdb\x74\xd8\x22\xaa\xab\xad\xb4\xce\x85\x61\
\x75\x08\x9c\xb3\x6a\x77\x73\x6a\xe7\xc4\xf0\xc5\x2e\x66\x73\xac\
\xb9\x31\xac\x0e\x81\x55\x28\x75\x19\xc3\xd6\x2a\xb7\x3b\x18\x56\
\x87\xc0\xea\x10\x58\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\x81\xd3\
\x5e\x8d\xf7\xee\xfb\x1d\x94\x72\x60\x58\x1d\x02\x5f\xec\xda\x65\
\x6b\x6e\x0c\xe7\xec\x62\xba\x76\x4e\x0c\xab\x43\xe0\x12\xab\x76\
\xb9\x75\xae\xe3\x0c\x0f\x9f\xb5\x8c\xde\xa5\xe8\xbd\xcb\x38\xa7\
\xd5\x4b\x54\xb7\xbd\xae\x43\x87\xbd\x18\xed\xb6\xf7\x5d\xc3\x89\
\xf8\x59\xbf\x79\x58\x05\x0c\x9f\x02\x9f\xc3\xea\xb0\x4a\xab\xc2\
\x2a\x3d\xcb\x70\xef\x13\x17\x4f\x5a\x4e\xb8\x19\x9e\xfd\x5e\x3c\
\x6a\x9c\xf7\xe1\x5e\x92\xd9\x88\x6f\x3d\xbc\xae\x43\x87\x2d\x22\
\x6c\xb6\x50\xdb\x6d\x3a\x6c\x11\xd5\xd5\x56\x5a\xe7\xc2\xb0\x3a\
\x04\xce\x59\xb5\xbb\x39\xb5\x73\x62\xf8\x62\x17\xb3\x39\xd6\xdc\
\x18\x56\x87\xc0\x2a\x94\xba\x8c\x61\x6b\x95\xdb\x1d\x0c\xab\x43\
\x60\x75\x08\xac\x0e\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\x69\xaf\
\xc6\x7b\xf7\xfd\x0e\x4a\x39\x30\xac\x0e\x81\x2f\x76\xed\xb2\x35\
\x37\x86\x73\x76\x31\x5d\x3b\x27\x86\xd5\x21\x70\x89\x55\xbb\xdc\
\x3a\xd7\x71\x86\x87\xcf\x5a\x46\xef\x52\xf4\xde\x65\x9c\xd3\xea\
\x25\xaa\xdb\x5e\xd7\xa1\xc3\x5e\x8c\x76\xdb\xfb\xae\xe1\x44\xfc\
\xac\xdf\x3c\xac\x02\x86\x4f\x81\xcf\x61\x75\x58\xa5\x55\x61\x95\
\x9e\x65\xb8\xf7\x89\x8b\x27\x2d\x27\xdc\x0c\xcf\x7e\x2f\x1e\x35\
\xce\xfb\x70\x2f\xc9\x6c\xc4\xb7\x1e\x5e\xd7\xa1\xc3\x16\x11\x36\
\x5b\xa8\xed\x36\x1d\xb6\x88\xea\x6a\x2b\xad\x73\x61\x58\x1d\x02\
\xe7\xac\xda\xdd\x9c\xda\x39\x31\x7c\xb1\x8b\xd9\x1c\x6b\x6e\x0c\
\xab\x43\x60\x15\x4a\x5d\xc6\xb0\xb5\xca\xed\x0e\x86\xd5\x21\xb0\
\x3a\x04\x56\x87\xc0\xea\x10\x58\x1d\x02\xab\x43\xe0\xb4\x57\xe3\
\xbd\xfb\x7e\x07\xa5\x1c\x18\x56\x87\xc0\x17\xbb\x76\xd9\x9a\x1b\
\xc3\x39\xbb\x98\xae\x9d\x13\xc3\xea\x10\xb8\xc4\xaa\x5d\x6e\x9d\
\xeb\x38\xc3\xc3\x67\x2d\xa3\x77\x29\x7a\xef\x32\xce\x69\xf5\x12\
\xd5\x6d\xaf\xeb\xd0\x61\x2f\x46\xbb\xed\x7d\xd7\x70\x22\x7e\xd6\
\x6f\x1e\x56\x01\xc3\xa7\xc0\xe7\xb0\x3a\xac\xd2\xaa\xb0\x4a\xcf\
\x32\xdc\xfb\xc4\xc5\x93\x96\x13\x6e\x86\x67\xbf\x17\x8f\x1a\xe7\
\x7d\xb8\x97\x64\x36\xe2\x5b\x0f\xaf\xeb\xd0\x61\x8b\x08\x9b\x2d\
\xd4\x76\x9b\x0e\x5b\x44\x75\xb5\x95\xd6\xb9\x30\xac\x0e\x81\x73\
\x56\xed\x6e\x4e\xed\x9c\x18\xbe\xd8\xc5\x6c\x8e\x35\x37\x86\xd5\
\x21\xb0\x0a\xa5\x2e\x63\xd8\x5a\xe5\x76\x07\xc3\xea\x10\x58\x1d\
\x02\xab\x43\x60\x75\x08\xac\x0e\x81\xd5\x21\x70\xda\xab\xf1\xde\
\x7d\xbf\x83\x52\x0e\x0c\xab\x43\xe0\x8b\x5d\xbb\x6c\xcd\x8d\xe1\
\x9c\x5d\x4c\xd7\xce\x89\x61\x75\x08\x5c\x62\xd5\x2e\xb7\xce\x75\
\x9c\xe1\xe1\xb3\x96\xd1\xbb\x14\xbd\x77\x19\xe7\xb4\x7a\x89\xea\
\xb6\xd7\x75\xe8\xb0\x17\xa3\xdd\xf6\xbe\x6b\x38\x11\x3f\xeb\x37\
\x0f\xab\x80\xe1\x53\xe0\x73\x58\x1d\x56\x69\x55\x58\xa5\x67\x19\
\xee\x7d\xe2\xe2\x49\xcb\x09\x37\xc3\xb3\xdf\x8b\x47\x8d\xf3\x3e\
\xdc\x4b\x32\x1b\xf1\xad\x87\xd7\x75\xe8\xb0\x45\x84\xcd\x16\x6a\
\xbb\x4d\x87\x2d\xa2\xba\xda\x4a\xeb\x5c\x18\x56\x87\xc0\x39\xab\
\x76\x37\xa7\x76\x4e\x0c\x5f\xec\x62\x36\xc7\x9a\x1b\xc3\xea\x10\
\x58\x85\x52\x97\x31\x6c\xad\x72\xbb\x83\x61\x75\x08\xac\x0e\x81\
\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\x38\xed\xd5\x78\xef\xbe\
\xdf\x41\x29\x07\x86\xd5\x21\xf0\xc5\xae\x5d\xb6\xe6\xc6\x70\xce\
\x2e\xa6\x6b\xe7\xc4\xb0\x3a\x04\x2e\xb1\x6a\x97\x5b\xe7\x3a\xce\
\xf0\xf0\x59\xcb\xe8\x5d\x8a\xde\xbb\x8c\x73\x5a\xbd\x44\x75\xdb\
\xeb\x3a\x74\xd8\x8b\xd1\x6e\x7b\xdf\x35\x9c\x88\x9f\xf5\x9b\x87\
\x55\xc0\xf0\x29\x1c\x66\xf8\xf1\xf8\x07\xbc\x9f\x52\xe5\x7d\x77\
\xa8\xbd\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\x30\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x02\x00\x00\x00\xb4\x52\x39\xf5\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7\x6f\
\xa8\x64\x00\x00\x00\xc5\x49\x44\x41\x54\x48\x4b\x63\x2c\x98\xb4\
\x8f\x81\x36\x00\x64\xf4\xf9\x6d\x7c\x50\x1e\xf5\x80\xa1\xd7\x27\
\xa2\x8c\x5e\x77\x25\x02\xca\x42\x02\x41\x3a\x2b\xa0\x2c\x6c\x80\
\x80\xd1\x58\x4d\x44\x03\xb8\x2c\x00\x1a\xcd\x04\x65\x62\x00\x62\
\xcc\x05\x02\x3c\xca\xb0\x18\x0d\x54\x4d\xa4\xb9\x10\x80\x4b\x3d\
\xba\xd1\x24\x19\x8a\x0c\x30\x35\xe2\x0c\x10\xca\x01\x8a\xd1\x64\
\x3b\x19\x02\xd0\xb4\x23\x8c\xa6\xd0\x5c\x08\x40\x36\x84\x5e\x01\
\x42\x15\x00\x77\x38\xd4\x68\xaa\x84\x06\x1a\x18\x52\x01\x02\x07\
\xa3\x46\xa3\x01\xda\x1b\x8d\xbf\x5c\x27\x09\xc0\x8d\xa2\x4b\x80\
\x50\xc5\xe1\xc8\x86\xa0\xb8\x9a\x42\xd3\xd1\xb4\xd3\x25\x40\x20\
\x80\x6c\x87\x63\x6a\xc4\xe2\x6a\xa0\x22\x92\x2c\xc0\xa5\x1e\x67\
\x80\x10\x69\x3a\x1e\x65\xf8\xc2\x1a\x97\x73\x20\x00\xbf\x2c\x10\
\xd0\xb8\x61\x06\xe5\x51\x17\x30\x30\x00\x00\x94\x80\x4b\x4f\xcc\
\x0c\x4a\x1e\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\xa1\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x02\x00\x00\x00\xb4\x52\x39\xf5\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7\x6f\
\xa8\x64\x00\x00\x00\x36\x49\x44\x41\x54\x48\x4b\xed\xcc\xa1\x01\
\x00\x20\x10\xc3\xc0\xc2\x1c\x48\xf6\xdf\x8c\x1d\x30\xaf\xe2\xeb\
\x72\x26\x2e\xeb\x9d\x9b\x8e\x3d\x2d\x70\x0d\xae\xc1\x35\xb8\x06\
\xd7\xe0\x1a\x5c\x83\x6b\x70\x0d\xb5\x75\xf2\x01\xd3\xaa\x01\x69\
\xd0\x7f\x6d\x8d\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
\x00\x00\x04\x34\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x01\x2c\x08\x06\x00\x00\x00\x9f\x5d\xd0\x5d\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc2\x00\x00\x0e\xc2\x01\x15\x28\
\x4a\x80\x00\x00\x03\xc9\x49\x44\x41\x54\x78\x5e\xed\x9b\xcb\x8d\
\x14\x31\x14\x45\x1b\x72\x20\x05\x24\x24\xf2\x20\x93\x59\x13\x0b\
\x4b\x32\x61\x43\x14\x48\x48\xa4\x40\x10\x83\x3c\xea\x62\x61\xc9\
\x7a\xfe\x3c\xbf\xb2\xaf\xcf\xd9\x0c\x62\x53\xef\xea\xd4\x75\x57\
\xb5\xdd\xef\xbe\x7e\xfb\xf9\xfa\x38\x88\xf7\xcf\xbf\xc7\xf0\xdf\
\xf0\xa7\x2f\x9f\xdf\xfe\x43\x95\xdf\x3f\x7e\xbd\xfd\xc5\xb0\x37\
\x2f\x1f\x3f\x3c\xff\xd5\xc6\xf7\x3f\x7f\x9f\xff\xf2\x01\xc3\xa3\
\x86\x7b\x4d\xd6\x32\x6a\xfc\x58\xc3\xc3\x81\x93\xd9\xd9\x76\x13\
\x5e\xd7\xa1\xc3\x16\x11\x36\x5b\xa8\xed\x36\x1d\xb6\x88\xea\x6a\
\x2b\xad\x73\x61\x58\x1d\x02\xe7\xac\xda\xdd\x9c\xda\x39\x31\x7c\
\xb1\x8b\xd9\x1c\x6b\x6e\x0c\xab\x43\x60\x15\x4a\x5d\xc6\xb0\xb5\
\xca\xed\x0e\x86\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\x58\x1d\
\x02\xab\x43\xe0\xb4\x57\xe3\xbd\xfb\x7e\x07\xa5\x1c\x18\x56\x87\
\xc0\x17\xbb\x76\xd9\x9a\x1b\xc3\x39\xbb\x98\xae\x9d\x13\xc3\xea\
\x10\xb8\xc4\xaa\x5d\x6e\x9d\xeb\x38\xc3\xc3\x67\x2d\xa3\x77\x29\
\x7a\xef\x32\xce\x69\xf5\x12\xd5\x6d\xaf\xeb\xd0\x61\x2f\x46\xbb\
\xed\x7d\xd7\x70\x22\x7e\xd6\x6f\x1e\x56\x01\xc3\xa7\xc0\xe7\xb0\
\x3a\xac\xd2\xaa\xb0\x4a\xcf\x32\xdc\xfb\xc4\xc5\x93\x96\x13\x6e\
\x86\x67\xbf\x17\x8f\x1a\xe7\x7d\xb8\x97\x64\x36\xe2\x5b\x0f\xaf\
\xeb\xd0\x61\x8b\x08\x9b\x2d\xd4\x76\x9b\x0e\x5b\x44\x75\xb5\x95\
\xd6\xb9\x30\xac\x0e\x81\x73\x56\xed\x6e\x4e\xed\x9c\x18\xbe\xd8\
\xc5\x6c\x8e\x35\x37\x86\xd5\x21\xb0\x0a\xa5\x2e\x63\xd8\x5a\xe5\
\x76\x07\xc3\xea\x10\x58\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\x81\
\xd5\x21\x70\xda\xab\xf1\xde\x7d\xbf\x83\x52\x0e\x0c\xab\x43\xe0\
\x8b\x5d\xbb\x6c\xcd\x8d\xe1\x9c\x5d\x4c\xd7\xce\x89\x61\x75\x08\
\x5c\x62\xd5\x2e\xb7\xce\x75\x9c\xe1\xe1\xb3\x96\xd1\xbb\x14\xbd\
\x77\x19\xe7\xb4\x7a\x89\xea\xb6\xd7\x75\xe8\xb0\x17\xa3\xdd\xf6\
\xbe\x6b\x38\x11\x3f\xeb\x37\x0f\xab\x80\xe1\x53\xe0\x73\x58\x1d\
\x56\x69\x55\x58\xa5\x67\x19\xee\x7d\xe2\xe2\x49\xcb\x09\x37\xc3\
\xb3\xdf\x8b\x47\x8d\xf3\x3e\xdc\x4b\x32\x1b\xf1\xad\x87\xd7\x75\
\xe8\xb0\x45\x84\xcd\x16\x6a\xbb\x4d\x87\x2d\xa2\xba\xda\x4a\xeb\
\x5c\x18\x56\x87\xc0\x39\xab\x76\x37\xa7\x76\x4e\x0c\x5f\xec\x62\
\x36\xc7\x9a\x1b\xc3\xea\x10\x58\x85\x52\x97\x31\x6c\xad\x72\xbb\
\x83\x61\x75\x08\xac\x0e\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\
\x10\x38\xed\xd5\x78\xef\xbe\xdf\x41\x29\x07\x86\xd5\x21\xf0\xc5\
\xae\x5d\xb6\xe6\xc6\x70\xce\x2e\xa6\x6b\xe7\xc4\xb0\x3a\x04\x2e\
\xb1\x6a\x97\x5b\xe7\x3a\xce\xf0\xf0\x59\xcb\xe8\x5d\x8a\xde\xbb\
\x8c\x73\x5a\xbd\x44\x75\xdb\xeb\x3a\x74\xd8\x8b\xd1\x6e\x7b\xdf\
\x35\x9c\x88\x9f\xf5\x9b\x87\x55\xc0\xf0\x29\xf0\x39\xac\x0e\xab\
\xb4\x2a\xac\xd2\xb3\x0c\xf7\x3e\x71\xf1\xa4\xe5\x84\x9b\xe1\xd9\
\xef\xc5\xa3\xc6\x79\x1f\xee\x25\x99\x8d\xf8\xd6\xc3\xeb\x3a\x74\
\xd8\x22\xc2\x66\x0b\xb5\xdd\xa6\xc3\x16\x51\x5d\x6d\xa5\x75\x2e\
\x0c\xab\x43\xe0\x9c\x55\xbb\x9b\x53\x3b\x27\x86\x2f\x76\x31\x9b\
\x63\xcd\x8d\x61\x75\x08\xac\x42\xa9\xcb\x18\xb6\x56\xb9\xdd\xc1\
\xb0\x3a\x04\x56\x87\xc0\xea\x10\x58\x1d\x02\xab\x43\x60\x75\x08\
\x9c\xf6\x6a\xbc\x77\xdf\xef\xa0\x94\x03\xc3\xea\x10\xf8\x62\xd7\
\x2e\x5b\x73\x63\x38\x67\x17\xd3\xb5\x73\x62\x58\x1d\x02\x97\x58\
\xb5\xcb\xad\x73\x1d\x67\x78\xf8\xac\x65\xf4\x2e\x45\xef\x5d\xc6\
\x39\xad\x5e\xa2\xba\xed\x75\x1d\x3a\xec\xc5\x68\xb7\xbd\xef\x1a\
\x4e\xc4\xcf\xfa\xcd\xc3\x2a\x60\xf8\x14\xf8\x1c\x56\x87\x55\x5a\
\x15\x56\xe9\x59\x86\x7b\x9f\xb8\x78\xd2\x72\xc2\xcd\xf0\xec\xf7\
\xe2\x51\xe3\xbc\x0f\xf7\x92\xcc\x46\x7c\xeb\xe1\x75\x1d\x3a\x6c\
\x11\x61\xb3\x85\xda\x6e\xd3\x61\x8b\xa8\xae\xb6\xd2\x3a\x17\x86\
\xd5\x21\x70\xce\xaa\xdd\xcd\xa9\x9d\x13\xc3\x17\xbb\x98\xcd\xb1\
\xe6\xc6\xb0\x3a\x04\x56\xa1\xd4\x65\x0c\x5b\xab\xdc\xee\x60\x58\
\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\x81\xd5\x21\xb0\x3a\x04\x4e\
\x7b\x35\xde\xbb\xef\x77\x50\xca\x81\x61\x75\x08\x7c\xb1\x6b\x97\
\xad\xb9\x31\x9c\xb3\x8b\xe9\xda\x39\x31\xac\x0e\x81\x4b\xac\xda\
\xe5\xd6\xb9\x8e\x33\x3c\x7c\xd6\x32\x7a\x97\xa2\xf7\x2e\xe3\x9c\
\x56\x2f\x51\xdd\xf6\xba\x0e\x1d\xf6\x62\xb4\xdb\xde\x77\x0d\x27\
\xe2\x67\xfd\xe6\x61\x15\x30\x7c\x0a\x87\x19\x7e\x3c\xfe\x01\xf7\
\xb2\x52\xe5\x8e\xd1\x3c\x39\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x04\x31\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x3c\x00\x00\x01\x2c\x08\x06\x00\x00\x00\x9f\x5d\xd0\x5d\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc2\x00\x00\x0e\xc2\x01\x15\x28\
\x4a\x80\x00\x00\x03\xc6\x49\x44\x41\x54\x78\x5e\xed\x9b\xcb\x8d\
\x14\x31\x14\x45\x1b\x02\x20\x17\x44\x02\x6c\x99\x68\x88\x85\x60\
\x60\x87\x48\x00\x91\x0b\x09\x0c\xf2\xa8\x8b\x85\x25\xeb\xf9\xf3\
\xfc\xca\xbe\x3e\x67\x33\x88\x4d\xbd\xab\x53\xd7\x5d\xd5\x76\xbf\
\xfb\xfa\xed\xe7\xeb\xe3\x20\xde\x3f\xff\x1e\xc3\x7f\xc3\x7f\xbe\
\x7f\x78\xfb\x0f\x55\x3e\xbe\xfc\x7d\xfb\x8b\x61\x6f\x7e\xfd\xf8\
\xf4\xfc\x57\x1b\x9f\xbf\xfc\x7e\xfe\xcb\x07\x0c\x8f\x1a\xee\x35\
\x59\xcb\xa8\xf1\x63\x0d\x0f\x07\x4e\x66\x67\xdb\x4d\x78\x5d\x87\
\x0e\x5b\x44\xd8\x6c\xa1\xb6\xdb\x74\xd8\x22\xaa\xab\xad\xb4\xce\
\x85\x61\x75\x08\x9c\xb3\x6a\x77\x73\x6a\xe7\xc4\xf0\xc5\x2e\x66\
\x73\xac\xb9\x31\xac\x0e\x81\x55\x28\x75\x19\xc3\xd6\x2a\xb7\x3b\
\x18\x56\x87\xc0\xea\x10\x58\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\
\x81\xd3\x5e\x8d\xf7\xee\xfb\x1d\x94\x72\x60\x58\x1d\x02\x5f\xec\
\xda\x65\x6b\x6e\x0c\xe7\xec\x62\xba\x76\x4e\x0c\xab\x43\xe0\x12\
\xab\x76\xb9\x75\xae\xe3\x0c\x0f\x9f\xb5\x8c\xde\xa5\xe8\xbd\xcb\
\x38\xa7\xd5\x4b\x54\xb7\xbd\xae\x43\x87\xbd\x18\xed\xb6\xf7\x5d\
\xc3\x89\xf8\x59\xbf\x79\x58\x05\x0c\x9f\x02\x9f\xc3\xea\xb0\x4a\
\xab\xc2\x2a\x3d\xcb\x70\xef\x13\x17\x4f\x5a\x4e\xb8\x19\x9e\xfd\
\x5e\x3c\x6a\x9c\xf7\xe1\x5e\x92\xd9\x88\x6f\x3d\xbc\xae\x43\x87\
\x2d\x22\x6c\xb6\x50\xdb\x6d\x3a\x6c\x11\xd5\xd5\x56\x5a\xe7\xc2\
\xb0\x3a\x04\xce\x59\xb5\xbb\x39\xb5\x73\x62\xf8\x62\x17\xb3\x39\
\xd6\xdc\x18\x56\x87\xc0\x2a\x94\xba\x8c\x61\x6b\x95\xdb\x1d\x0c\
\xab\x43\x60\x75\x08\xac\x0e\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\
\x69\xaf\xc6\x7b\xf7\xfd\x0e\x4a\x39\x30\xac\x0e\x81\x2f\x76\xed\
\xb2\x35\x37\x86\x73\x76\x31\x5d\x3b\x27\x86\xd5\x21\x70\x89\x55\
\xbb\xdc\x3a\xd7\x71\x86\x87\xcf\x5a\x46\xef\x52\xf4\xde\x65\x9c\
\xd3\xea\x25\xaa\xdb\x5e\xd7\xa1\xc3\x5e\x8c\x76\xdb\xfb\xae\xe1\
\x44\xfc\xac\xdf\x3c\xac\x02\x86\x4f\x81\xcf\x61\x75\x58\xa5\x55\
\x61\x95\x9e\x65\xb8\xf7\x89\x8b\x27\x2d\x27\xdc\x0c\xcf\x7e\x2f\
\x1e\x35\xce\xfb\x70\x2f\xc9\x6c\xc4\xb7\x1e\x5e\xd7\xa1\xc3\x16\
\x11\x36\x5b\xa8\xed\x36\x1d\xb6\x88\xea\x6a\x2b\xad\x73\x61\x58\
\x1d\x02\xe7\xac\xda\xdd\x9c\xda\x39\x31\x7c\xb1\x8b\xd9\x1c\x6b\
\x6e\x0c\xab\x43\x60\x15\x4a\x5d\xc6\xb0\xb5\xca\xed\x0e\x86\xd5\
\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\x58\x1d\x02\xab\x43\xe0\xb4\
\x57\xe3\xbd\xfb\x7e\x07\xa5\x1c\x18\x56\x87\xc0\x17\xbb\x76\xd9\
\x9a\x1b\xc3\x39\xbb\x98\xae\x9d\x13\xc3\xea\x10\xb8\xc4\xaa\x5d\
\x6e\x9d\xeb\x38\xc3\xc3\x67\x2d\xa3\x77\x29\x7a\xef\x32\xce\x69\
\xf5\x12\xd5\x6d\xaf\xeb\xd0\x61\x2f\x46\xbb\xed\x7d\xd7\x70\x22\
\x7e\xd6\x6f\x1e\x56\x01\xc3\xa7\xc0\xe7\xb0\x3a\xac\xd2\xaa\xb0\
\x4a\xcf\x32\xdc\xfb\xc4\xc5\x93\x96\x13\x6e\x86\x67\xbf\x17\x8f\
\x1a\xe7\x7d\xb8\x97\x64\x36\xe2\x5b\x0f\xaf\xeb\xd0\x61\x8b\x08\
\x9b\x2d\xd4\x76\x9b\x0e\x5b\x44\x75\xb5\x95\xd6\xb9\x30\xac\x0e\
\x81\x73\x56\xed\x6e\x4e\xed\x9c\x18\xbe\xd8\xc5\x6c\x8e\x35\x37\
\x86\xd5\x21\xb0\x0a\xa5\x2e\x63\xd8\x5a\xe5\x76\x07\xc3\xea\x10\
\x58\x1d\x02\xab\x43\x60\x75\x08\xac\x0e\x81\xd5\x21\x70\xda\xab\
\xf1\xde\x7d\xbf\x83\x52\x0e\x0c\xab\x43\xe0\x8b\x5d\xbb\x6c\xcd\
\x8d\xe1\x9c\x5d\x4c\xd7\xce\x89\x61\x75\x08\x5c\x62\xd5\x2e\xb7\
\xce\x75\x9c\xe1\xe1\xb3\x96\xd1\xbb\x14\xbd\x77\x19\xe7\xb4\x7a\
\x89\xea\xb6\xd7\x75\xe8\xb0\x17\xa3\xdd\xf6\xbe\x6b\x38\x11\x3f\
\xeb\x37\x0f\xab\x80\xe1\x53\xe0\x73\x58\x1d\x56\x69\x55\x58\xa5\
\x67\x19\xee\x7d\xe2\xe2\x49\xcb\x09\x37\xc3\xb3\xdf\x8b\x47\x8d\
\xf3\x3e\xdc\x4b\x32\x1b\xf1\xad\x87\xd7\x75\xe8\xb0\x45\x84\xcd\
\x16\x6a\xbb\x4d\x87\x2d\xa2\xba\xda\x4a\xeb\x5c\x18\x56\x87\xc0\
\x39\xab\x76\x37\xa7\x76\x4e\x0c\x5f\xec\x62\x36\xc7\x9a\x1b\xc3\
\xea\x10\x58\x85\x52\x97\x31\x6c\xad\x72\xbb\x83\x61\x75\x08\xac\
\x0e\x81\xd5\x21\xb0\x3a\x04\x56\x87\xc0\xea\x10\x38\xed\xd5\x78\
\xef\xbe\xdf\x41\x29\x07\x86\xd5\x21\xf0\xc5\xae\x5d\xb6\xe6\xc6\
\x70\xce\x2e\xa6\x6b\xe7\xc4\xb0\x3a\x04\x2e\xb1\x6a\x97\x5b\xe7\
\x3a\xce\xf0\xf0\x59\xcb\xe8\x5d\x8a\xde\xbb\x8c\x73\x5a\xbd\x44\
\x75\xdb\xeb\x3a\x74\xd8\x8b\xd1\x6e\x7b\xdf\x35\x9c\x88\x9f\xf5\
\x9b\x87\x55\xc0\xf0\x29\x1c\x66\xf8\xf1\xf8\x07\xc2\xdd\x52\xe5\
\x67\xa9\x54\x6d\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
\x00\x00\x01\x05\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x02\x00\x00\x00\xb4\x52\x39\xf5\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7\x6f\
\xa8\x64\x00\x00\x00\x9a\x49\x44\x41\x54\x48\x4b\xed\xcc\xdb\x0d\
\x80\x20\x14\x03\x50\x37\xf3\xd7\x71\x9c\x85\x81\x98\xc0\x9d\x14\
\x73\x1b\x02\x95\xf0\x86\xc4\x84\xa6\x5f\x70\x7b\xb6\x53\xe9\x41\
\x7d\xe9\xfd\xb8\xba\x37\x97\xbe\x43\xa1\x1b\x6a\x82\x86\x11\x0d\
\x4d\x6c\x63\x34\xa6\x19\xa1\xa1\x34\x4c\x63\x51\x18\x42\x02\x34\
\x0e\xab\xe2\x3a\x13\x69\x9c\x34\xc4\x52\x1e\x8d\xcf\xe6\xfc\x93\
\x36\xf1\x68\xbc\x75\xca\xa2\x29\x8b\xa6\x78\x74\x47\x5d\xb4\x59\
\x74\x17\xdd\x52\x4c\x9b\xe2\xa4\x2a\xae\x33\x97\x36\xc5\x61\x61\
\x08\x09\xd3\x52\x2c\x32\x42\x43\x69\x8c\x36\xc5\x34\x1a\x9a\xd8\
\x26\x68\x29\x8c\x4f\xe8\x8c\x9a\x45\xd7\x15\xf4\x90\x2a\xfd\x00\
\xd2\x70\x4b\x9d\xc8\x09\x12\x84\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82\
\x00\x00\x01\x30\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x02\x00\x00\x00\xb4\x52\x39\xf5\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7\x6f\
\xa8\x64\x00\x00\x00\xc5\x49\x44\x41\x54\x48\x4b\x63\x2c\x98\xb4\
\x8f\x81\x36\x00\x64\xf4\xf9\x6d\x7c\x50\x1e\xf5\x80\xa1\xd7\x27\
\xa2\x8c\x3e\xb0\xca\x04\xca\x42\x02\x0e\x61\x67\xa0\x2c\x6c\x80\
\x80\xd1\x58\x4d\x44\x03\xb8\x2c\x00\x1a\xcd\x04\x65\x62\x00\x62\
\xcc\x05\x02\x3c\xca\xb0\x18\x0d\x54\x4d\xa4\xb9\x10\x80\x4b\x3d\
\xba\xd1\x24\x19\x8a\x0c\x30\x35\xe2\x0c\x10\xca\x01\x8a\xd1\x64\
\x3b\x19\x02\xd0\xb4\x23\x8c\xa6\xd0\x5c\x08\x40\x36\x84\x5e\x01\
\x42\x15\x00\x77\x38\xd4\x68\xaa\x84\x06\x1a\x18\x52\x01\x02\x07\
\xa3\x46\xa3\x01\xda\x1b\x8d\xbf\x5c\x27\x09\xc0\x8d\xa2\x4b\x80\
\x50\xc5\xe1\xc8\x86\xa0\xb8\x9a\x42\xd3\xd1\xb4\xd3\x25\x40\x20\
\x80\x6c\x87\x63\x6a\xc4\xe2\x6a\xa0\x22\x92\x2c\xc0\xa5\x1e\x67\
\x80\x10\x69\x3a\x1e\x65\xf8\xc2\x1a\x97\x73\x20\x00\xbf\x2c\x10\
\xd0\xb8\x61\x06\xe5\x51\x17\x30\x30\x00\x00\x71\x0a\x4c\x3f\xf2\
\xc4\xa9\x1d\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x00\x9e\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1e\x00\x00\x00\x1e\x08\x02\x00\x00\x00\xb4\x52\x39\xf5\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7\x6f\
\xa8\x64\x00\x00\x00\x33\x49\x44\x41\x54\x48\x4b\xed\xcc\xa1\x01\
\x00\x30\x0c\x84\xc0\x4f\xf7\x9f\xb6\x0b\x34\xa6\x0a\xff\x8e\x33\
\x38\xe6\xdd\x94\x9c\xdf\x02\xd7\xe0\x1a\x5c\x83\x6b\x70\x0d\xae\
\xc1\x35\xb8\x06\xd7\x50\x5b\x27\x0b\xfc\xf8\x02\x2d\xb4\x3c\xf1\
\x15\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = b"\
\x00\x06\
\x06\xcf\xc2\xb3\
\x00\x66\
\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x73\
\x00\x11\
\x09\x2c\xb9\xe7\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x5f\x00\x66\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x5f\x00\x31\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x14\
\x05\xe8\xbf\x47\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x5f\x00\x63\x00\x6f\x00\x6c\x00\x75\x00\x6d\x00\x6e\x00\x5f\x00\x62\x00\x61\x00\x64\x00\x2e\
\x00\x70\x00\x6e\x00\x67\
\x00\x12\
\x0f\x6d\x6a\x87\
\x00\x79\
\x00\x65\x00\x6c\x00\x6c\x00\x6f\x00\x77\x00\x5f\x00\x66\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x5f\x00\x31\x00\x2e\x00\x70\x00\x6e\
\x00\x67\
\x00\x0f\
\x0e\x9c\x4d\xe7\
\x00\x72\
\x00\x65\x00\x64\x00\x5f\x00\x66\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x5f\x00\x31\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x15\
\x0f\xa9\xd7\x27\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x5f\x00\x63\x00\x6f\x00\x6c\x00\x75\x00\x6d\x00\x6e\x00\x5f\x00\x67\x00\x6f\x00\x6f\x00\x64\
\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0d\
\x0d\x53\xef\x47\
\x00\x72\
\x00\x65\x00\x64\x00\x5f\x00\x66\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0d\
\x0c\x71\x86\x27\
\x00\x63\
\x00\x6f\x00\x6c\x00\x6f\x00\x72\x00\x5f\x00\x72\x00\x65\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x16\
\x03\x2d\x52\xa7\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x5f\x00\x63\x00\x6f\x00\x6c\x00\x75\x00\x6d\x00\x6e\x00\x5f\x00\x68\x00\x6f\x00\x76\x00\x65\
\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x0f\xf1\x0a\xc7\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x5f\x00\x63\x00\x6f\x00\x6c\x00\x75\x00\x6d\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0f\
\x07\x58\x5f\xa7\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x5f\x00\x66\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x0e\xe2\x1e\x67\
\x00\x79\
\x00\x65\x00\x6c\x00\x6c\x00\x6f\x00\x77\x00\x5f\x00\x66\x00\x69\x00\x65\x00\x6c\x00\x64\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x0e\x81\x27\xe7\
\x00\x63\
\x00\x6f\x00\x6c\x00\x6f\x00\x72\x00\x5f\x00\x79\x00\x65\x00\x6c\x00\x6c\x00\x6f\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x02\
\x00\x00\x01\x26\x00\x00\x00\x00\x00\x01\x00\x00\x20\x70\
\x00\x00\x00\x3a\x00\x00\x00\x00\x00\x01\x00\x00\x05\xd8\
\x00\x00\x01\x7e\x00\x00\x00\x00\x00\x01\x00\x00\x28\xdd\
\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x06\x00\x00\x00\x00\x00\x01\x00\x00\x1f\xcb\
\x00\x00\x00\xe6\x00\x00\x00\x00\x00\x01\x00\x00\x1e\x97\
\x00\x00\x01\xc8\x00\x00\x00\x00\x00\x01\x00\x00\x2b\x1a\
\x00\x00\x00\x92\x00\x00\x00\x00\x00\x01\x00\x00\x11\xbe\
\x00\x00\x01\xa2\x00\x00\x00\x00\x00\x01\x00\x00\x29\xe6\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x0a\x0c\
\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x01\x00\x00\x1a\x64\
\x00\x00\x01\x58\x00\x00\x00\x00\x00\x01\x00\x00\x24\xa8\
"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
|
KFlaga/Match4 | Match4Client/GameScreen.py | <filename>Match4Client/GameScreen.py
from PyQt5.QtWidgets import QFrame, QWidget
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot
from GameSettings import GameSettings, PlayerColor, PlayerType, Player
from PyQt5 import QtGui
import Messages
from Messages import Message, MessageType
import ui.GameFrame
import ui.resources
from GameBoard import GameBoard
from BoardField import BoardField
from ServerConnector import ServerConnector
class GameScreen(QFrame, ui.GameFrame.Ui_GameFrame):
endGame = pyqtSignal()
def __init__(self, parent=None):
super(GameScreen, self).__init__(parent)
self.board = GameBoard(self)
self.setupUi(self, self.board)
self.iconRed = QtGui.QIcon()
self.iconRed.addPixmap(QtGui.QPixmap(":/fields/color_red.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off)
self.iconYellow = QtGui.QIcon()
self.iconYellow.addPixmap(QtGui.QPixmap(":/fields/color_yellow.png"), QtGui.QIcon.Disabled, QtGui.QIcon.Off)
self.board.columnHover.connect(self.columnHovered)
self.board.columnClicked.connect(self.columnSelected)
self.currentState = None
self.changeState(AwaitingGameConfirmation(self))
self.gameSettings = None
self.currentPlayer = 0
self.messageInterpreters = {
MessageType.NoMessage: Interpreter_NoMessage(self),
MessageType.RespConfirm: Interpreter_RespConfirm(self),
MessageType.RespGoodMove: Interpreter_RespGoodMove(self),
MessageType.RespBadMove: Interpreter_RespBadMove(self),
MessageType.RespNextPlayer_Human: Interpreter_RespNextPlayer_Human(self),
MessageType.RespNextPlayer_Cpu: Interpreter_RespNextPlayer_Cpu(self),
MessageType.RespWinMove: Interpreter_RespWinMove(self),
MessageType.RespDraw: Interpreter_RespDraw(self),
MessageType.RespField: Interpreter_RespField(self)
}
self.serverConnector = ServerConnector()
self.serverConnector.messageReceived.connect(self.messageReceived)
def startGame(self, gameSettings):
self.gameSettings = gameSettings
self.currentPlayer = 1
self.serverConnector.createServer()
self.sendMessage(Messages.createMessage(
MessageType.ReqSettings,
[gameSettings.player_1.difficulty,
gameSettings.player_2.difficulty, 0]))
return
def endClicked(self):
self.serverConnector.destroyServer()
self.endGame.emit()
return
def setCurrentPlayer(self, playerNum):
self.currentPlayer = playerNum
self.setPlayerColor(self.gameSettings.getPlayer(playerNum).color)
self.setPlayerType(self.gameSettings.getPlayer(playerNum).type)
def setPlayerColor(self, playerColor):
if playerColor == PlayerColor.Red:
self.currentPlayerColor.setIcon(self.iconRed)
else:
self.currentPlayerColor.setIcon(self.iconYellow)
def setPlayerType(self, playerType):
if playerType == PlayerType.Human:
self.currentPlayerType.setText("Human")
else:
self.currentPlayerType.setText("Cpu")
def setStatus(self, statusText):
self.statusText.setText(statusText)
@pyqtSlot(int)
def columnHovered(self, column):
self.currentState.onColumnHovered(column)
return
@pyqtSlot(int)
def columnSelected(self, column):
self.currentState.onColumnSelected(column)
return
@pyqtSlot(Message)
def messageReceived(self, message):
self.messageInterpreters[message.msgType].interpretMessage(message)
return
@pyqtSlot(Message)
def sendMessage(self, message):
self.serverConnector.sendToServer(message)
return
def changeState(self, state):
if self.currentState is not None:
self.currentState.end()
self.currentState = state
self.currentState.begin()
def makeMove(self, column, player):
for field in reversed(self.board.columns[column].fields):
if field.getColor() is PlayerColor.NoPlayer:
field.setColor(self.gameSettings.getPlayer(player).color)
break
return
def nextPlayer(self):
player = 0
if self.currentPlayer == 0:
player = 1
self.setCurrentPlayer(player)
def acceptMove(self, column):
self.currentState.acceptMove(column)
return
def rejectMove(self, column):
self.currentState.rejectMove(column)
return
class GameState:
def __init__(self, parent):
self.gameScreen = parent
def begin(self):
return
def end(self):
return
def onColumnHovered(self, column):
return
def onColumnSelected(self, column):
return
def acceptMove(self, column):
return
def rejectMove(self, column):
return
class AwaitingGameConfirmation(GameState):
def __init__(self, parent):
super(AwaitingGameConfirmation, self).__init__(parent)
def begin(self):
self.gameScreen.setStatus("Awaiting for game server connection")
return
def end(self):
self.gameScreen.setStatus("Game started")
return
class AwaitingHumanMoveState(GameState):
def __init__(self, parent):
super(AwaitingHumanMoveState, self).__init__(parent)
def begin(self):
self.gameScreen.setStatus("Awaiting human move")
return
def end(self):
return
def onColumnHovered(self, column):
self.gameScreen.changeState(AwaitingResponseHover(self.gameScreen))
msg = Messages.createMessage(MessageType.ReqHover, [column, 0, 0])
self.gameScreen.sendMessage(msg)
return
def onColumnSelected(self, column):
self.gameScreen.changeState(AwaitingResponseSelect(self.gameScreen))
msg = Messages.createMessage(MessageType.ReqSelect, [column, 0, 0])
self.gameScreen.sendMessage(msg)
return
class AwaitingCpuMoveState(GameState):
def __init__(self, parent):
super(AwaitingCpuMoveState, self).__init__(parent)
def begin(self):
self.gameScreen.setStatus("Awaiting cpu move")
return
def acceptMove(self, column):
self.gameScreen.makeMove(column, self.gameScreen.currentPlayer)
return
def rejectMove(self, column):
return
class AwaitingResponseHover(GameState):
def __init__(self, parent):
super(AwaitingResponseHover, self).__init__(parent)
def begin(self):
self.gameScreen.setStatus("Awaiting hover confirmation")
return
def acceptMove(self, column):
self.gameScreen.board.setHoverGood(column)
self.gameScreen.changeState(AwaitingHumanMoveState(self.gameScreen))
return
def rejectMove(self, column):
self.gameScreen.board.setHoverBad(column)
self.gameScreen.changeState(AwaitingHumanMoveState(self.gameScreen))
return
class AwaitingResponseSelect(GameState):
def __init__(self, parent):
super(AwaitingResponseSelect, self).__init__(parent)
def begin(self):
self.gameScreen.setStatus("Awaiting move confirmation")
return
def acceptMove(self, column):
self.gameScreen.board.setHoverGood(column)
self.gameScreen.makeMove(column, self.gameScreen.currentPlayer)
self.gameScreen.columnHovered(column)
return
def rejectMove(self, column):
self.gameScreen.board.setHoverBad(column)
self.gameScreen.changeState(AwaitingHumanMoveState(self.gameScreen))
return
class MessageInterpreter:
def __init__(self, parent):
self.gameScreen = parent
def interpretMessage(self, message):
return
class Interpreter_NoMessage(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
return
class Interpreter_RespConfirm(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
return
class Interpreter_RespGoodMove(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
self.gameScreen.acceptMove(message.data[0])
return
class Interpreter_RespBadMove(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
self.gameScreen.rejectMove(message.data[0])
return
class Interpreter_RespNextPlayer_Human(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
self.gameScreen.changeState(AwaitingHumanMoveState(self.gameScreen))
self.gameScreen.nextPlayer()
return
class Interpreter_RespNextPlayer_Cpu(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
self.gameScreen.changeState(AwaitingCpuMoveState(self.gameScreen))
self.gameScreen.nextPlayer()
return
class Interpreter_RespWinMove(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
return
class Interpreter_RespDraw(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
return
class Interpreter_RespField(MessageInterpreter):
def __init__(self, parent):
super().__init__(parent)
def interpretMessage(self, message):
return
|
Sarah-Marion/Password_Locker-ultimate- | user_data_test.py | import unittest
from user_data import User
class user_test(unittest.TestCase):
"""
Test class that defines test cases for the user_data class behaviours
Args:
unittest.Testcase: TestCase class that helps in creating test cases
"""
def setUp(self):
"""
set up method to run each test case
"""
self.new_user = User("username","password")
def test_init(self):
"""
test init test case to test if the object is initialized properly
"""
self.assertEqual(self.new_user.username, "username")
self.assertEqual(self.new_user.password, "password")
def test_create_new_account(self):
"""
test_create_new_account test case to test if the new user object is
saved into the user list
"""
self.new_user.save_user()
self.assertEqual(len(User.user_list), 1)
def tearDown(self):
"""
teardown method that does clean up after each test case has run
"""
User.user_list = []
def test_check_user_exists(self):
"""
test_check_user_exists to test if a user exists or not
"""
self.new_user.save_user()
test_user = User("username", "<PASSWORD>")
test_user.save_user()
user_exists = User.user_exists("username")
self.assertTrue(user_exists)
def test_username_match_password(self):
"""
test_username_match_password to test if a password matches a username
"""
self.test_user = User("username", "<PASSWORD>")
self.test_user.save_user()
confirm_user_exist = User.confirm_user("username", "<PASSWORD>")
self.assertTrue(confirm_user_exist)
def test_user_change_password(self):
"""
test_user_change_password to test if a user can alter their password
"""
test_alter = User("username", "<PASSWORD>")
test_alter.save_user()
change_passwrd = test_alter.change_userpass("username", "<PASSWORD>")
self.assertEqual(change_passwrd.password, "password03")
def test_user_delete_account(self):
"""
test_user_delete_account to test if a user can delete their account
"""
self.test_user = User("username", "<PASSWORD>")
self.test_user.save_user()
self.test_user.user_delete_account()
self.assertEqual(len(User.user_list), 0)
if __name__ == "__main__":
unittest.main() |
Sarah-Marion/Password_Locker-ultimate- | credential.py | import pyperclip
import string
import random
class Credential:
"""
class that generates new instances of user credentials
"""
def __init__(self, profile_name, display_profiles = None, profile_username = None, profile_email = None, profile_password = True):
self.profile_name = profile_name
self.profile_username = profile_username
self.profile_email = profile_email
self.profile_password = <PASSWORD>
self.display_profiles = display_profiles
profile_list = []
def save_profile(self):
"""
save_profile method saves user object into profile_list
"""
Credential.profile_list.append(self)
@classmethod
def check_profile_exist(cls, profile_name, profile_username = None, profile_email = None):
"""
check_profile_exist method checks if there is another matching or similar profile
Args:
profile to search if it exists
Returns:
Boolean: True or false depending if the profile exists
"""
for profile in cls.profile_list:
if (profile.profile_name == profile_name) or (profile.profile_username == profile_username) or (profile.profile_email == profile_email):
return True
else:
return False
@classmethod
def search_profile(cls, param):
"""
search_profile method that searches for profile/s based on profile name, username or profile_email
Args:
profile to search if it exists
"""
for profile in cls.profile_list:
while (profile.profile_name == param) or (profile.profile_username == param) or (profile.profile_email == param):
return profile
def delete_profile(self):
"""
delete_profile method that deletes a particular profile
"""
Credential.profile_list.remove(self)
@classmethod
def display_all_profiles(cls):
'''
method that returns the all the profiles
'''
return cls.profile_list
@classmethod
def copy_credentials(cls, item):
"""
copy_credentials method that copies a credential to the clipboard
"""
profile_found = cls.search_profile(item)
pyperclip.copy(profile_found.profile_password)
@classmethod
def generate_random_password(cls, length):
"""
generate_random_password method that returns a randomly generated password
Args:
length: The actual length of the password that is to be generated
"""
chars = string.ascii_lowercase + string.ascii_uppercase + string.digits
generated_password = ''.join(random.choice(chars) for char in range(length))
return generated_password
|
Sarah-Marion/Password_Locker-ultimate- | credential_test.py | <filename>credential_test.py
import unittest
import pyperclip
from credential import Credential
class credential_test(unittest.TestCase):
"""
Test class that defines test cases for the credential class behaviours
Args:
unittest.TestCase: TestCase class that helps in creating test cases
"""
def setUp(self):
"""
set up method to run each test case
"""
self.new_profile = Credential ("github", "Sarah", "<EMAIL>", "password")
def test_init(self):
"""
test init to test if the object is initialized properly
"""
self.assertTrue(self.new_profile.profile_name, "github")
self.assertTrue(self.new_profile.profile_username, "Sarah")
self.assertTrue(self.new_profile.profile_email,"<EMAIL>")
self.assertTrue(self.new_profile.profile_password)
def test_create_new_profile(self):
"""
test_create_new_profile to test if a new object can be saved
"""
self.new_profile.save_profile()
self.assertEqual(len(Credential.profile_list), 1)
def tearDown(self):
"""
teardown method that does clean up after each test case has run
"""
Credential.profile_list = []
def test_create_multiple_profiles(self):
"""
test_create_multiple_profiles to test if multiple objects can be saved
"""
self.new_profile.save_profile()
test_profile = Credential("facebook", "Marion", "<EMAIL>")
test_profile.save_profile()
self.assertEqual(len(Credential.profile_list), 2)
def test_profile_exist(self):
"""
test_profile_exist to check if there is another matching or similar profile
"""
test_profile1 = Credential("twitter", "Marion", "<EMAIL>")
test_profile1.save_profile()
profile = test_profile1.check_profile_exist("twitter", "Marion", "<EMAIL>")
self.assertTrue(profile)
def test_search_profile(self):
"""
test_search_profile to test if a user can be able to search for a profile_email
"""
test_profile1 = Credential("twitter", "Marion", "<EMAIL>")
test_profile1.save_profile()
search_result = test_profile1.search_profile("twitter")
self.assertEqual(test_profile1, search_result)
def test_delete_profile(self):
"""
test_delete_profile to test if a user can delete a specific profile
"""
test_profile1 = Credential("twitter", "Marion", "<EMAIL>")
test_profile1.save_profile()
test_profile1.delete_profile()
self.assertEqual(len(Credential.profile_list), 0)
# def test_display_all_profiles(self):
# """
# test_display_all_profiles to test if a user can view all their profiles
# """
# self.assertEqual(Credential.display_profiles(), Credential.profile_list)
def test_copy_credentials(self):
"""
test copy_credentials to test if a user can be able to copy an item to the clipboard
"""
test_profile1 = Credential("twitter","Marion","<EMAIL>","<PASSWORD>")
test_profile1.save_profile()
Credential.copy_credentials("twitter")
self.assertEqual(test_profile1.profile_password,pyperclip.paste())
def test_generate_random_password(self):
"""
test_generate_random_password to test if a user can generate a random password with a set length
"""
test_profile1 = Credential("Marion","<EMAIL>")
generated_password = test_profile1.generate_random_password
test_profile1.profile_password = generated_password
test_profile1.save_profile()
self.assertTrue(test_profile1.profile_password)
if __name__ == "__main__":
unittest.main()
|
Sarah-Marion/Password_Locker-ultimate- | run.py | <reponame>Sarah-Marion/Password_Locker-ultimate-
#!/usr/bin/env python3.6
import sys
import os
import pyperclip
import string
import random
from credential import Credential
from user_data import User
from pyfiglet import figlet_format
from termcolor import colored, cprint
from colorama import init
init(strip=not sys.stdout.isatty())
terminal_width = os.get_terminal_size().columns
def create_new_account(username, password):
new_account = User(username, password)
return new_account
def check_user_exists(userName):
return User.user_exists(userName)
def save_account(account):
account.save_user()
def delete_account(account):
account.user_delete_account()
def login_user(userName, passwrd):
return User.confirm_user(userName, passwrd)
def user_change_password(userName, new_pass):
return User.change_userpass(userName, new_pass)
def create_new_profile(profile_name, profile_username = None, profile_email = None, profile_password = None):
new_profile = Credential(profile_name, profile_username = None, profile_email = None, profile_password = None)
return new_profile
def save_profile(new_profile):
new_profile.save_profile()
def delete_profile(profile):
profile.delete_profile()
def generate_random_password(length):
generate_random_password = Credential.generate_random_password(length)
return generate_random_password
# chars = string.ascii_lowercase + string.ascii_uppercase + string.digits
# generated_password = ''.join(random.choice(chars) for char in range(length))
# return int(generated_password)
def check_profile_exists(profile_name, profile_username = None, profile_email = None):
return Credential.check_profile_exist(profile_name, profile_username = None, profile_email = None)
def search_profile(search):
return Credential.search_profile(search)
def copy_password(search_item):
return Credential.copy_credentials(search_item)
def display_profiles():
return Credential.profile_list
def handle_short_codes(short_code):
short_code = short_code.lower().replace(" ", "")
if short_code == "np":
cprint("You have entered a command to Create a New Profile".center(terminal_width), "blue")
print("Kindly input a Profile Name...example github")
profile_name_entered = input()
if not profile_name_entered:
cprint("Your Profile Name Cannot Be Blank", "red")
else:
print("Kindly enter Username of the Profile Account(optional)")
profile_username_entered = input()
print("Kindly enter Email of the Profile Account(optional)")
profile_email_entered = input()
print("Kindly enter Password of the Account(optional)")
profile_password_entered = input()
new_profile = Credential(profile_name_entered, profile_username_entered, profile_email_entered, profile_password_entered)
profile_exist = check_profile_exists(profile_name_entered, profile_username_entered, profile_email_entered)
if profile_exist:
print("\n")
cprint("New Profile Created".center(terminal_width),"green")
print("\n")
else:
if not save_profile(new_profile):
print("\n")
cprint("Your Profile Has Been Created.".center(terminal_width), "green")
print("\n")
elif short_code == "dp":
show_profile = display_profiles()
if not show_profile:
print("\n")
cprint("THERE IS NO PROFILE SAVED IN YOUR ACCOUNT".center(terminal_width), "red")
print("\n")
else:
cprint("Here's a list of all your profiles".center(terminal_width),"blue")
print("\n")
print(("-*-"*25).center(terminal_width))
for profile in display_profiles():
print(f"PROFILE NAME:{profile.profile_name}".center(terminal_width))
print(f"PROFILE USERNAME:{profile.profile_username}".center(terminal_width))
print(f"PROFILE EMAIL:{profile.profile_email}".center(terminal_width))
print(f"PROFILE PASSWORD:{profile.profile_password}".center(terminal_width))
print(("-*-"*25).center(terminal_width))
print("\n")
elif short_code == "gp":
print("Kindly enter the profile name you want to generate a password for")
profile_gen_passwrd = input()
profile_to_change = search_profile(profile_gen_passwrd)
if profile_to_change:
print("Input the length of password you want:")
passwrd_length = int(input())
new_passwrd = generate_random_password(passwrd_length)
profile_to_change.profile_password = <PASSWORD>
print("\n")
cprint("A New Password was Generated and has been Successfully Saved".center(terminal_width), "green")
print("\n")
else:
print("\n")
cprint("There is no Profile with That Name".center(terminal_width), "red")
print("\n")
elif short_code == "search":
print("Kindly enter your search")
search_string = input()
if search_string:
search_result = search_profile(search_string)
if search_result:
print("\n")
cprint("SEARCH RESULTS".center(terminal_width),"green")
print("\n")
print(("-*-"*25).center(terminal_width))
print(f"PROFILE NAME:{search_result.profile_name}".center(terminal_width))
print(f"PROFILE USERNAME:{search_result.profile_username}".center(terminal_width))
print(f"PROFILE EMAIL:{search_result.profile_email}".center(terminal_width))
print(f"PROFILE PASSWORD:{search_result.profile_password}".center(terminal_width))
print(("-*-"*25).center(terminal_width))
print("\n")
else:
print("\n")
cprint("No items were found using that criteria".center(terminal_width),"magenta")
print("\n")
else:
cprint("You MUST input a search item","red")
elif short_code == "copy":
print("Kindly enter the profile you want to copy(password)")
search_passwrd = input()
found_copy_profile = search_profile(search_passwrd)
if not search_passwrd:
cprint("You MUST input the profile you want to copy password","red")
else:
if not found_copy_profile:
cprint("\t Profile found!","red",attrs=["bold"])
else:
found_copy_profile = copy_password(search_passwrd)
paste_passwrd = pyperclip.paste()
if paste_passwrd:
cprint("\t Copied!!","green")
print("\n")
else:
cprint("\t NOT copied!!!","red")
print("\n")
elif short_code == "del":
cprint("PROCEED WITH CAUTION!".center(terminal_width),"red",attrs=["bold","blink"])
print("Enter the name of the profile you want to delete:")
del_profile = input()
found_profile = search_profile(del_profile)
if found_profile:
cprint("DO YOU WANT TO CONTINUE TO DELETE? Y/N",attrs=["bold"])
continue_prompt = input().upper()
if continue_prompt == "Y":
delete_profile(found_profile)
print("\n")
cprint("Profile DELETED!".center(terminal_width),"green")
print("\n")
elif continue_prompt == "N":
return
else:
cprint("\t You input an unrecognised command","red")
else:
print("\n")
cprint("The profile does NOT exist".center(terminal_width),"red")
print("\n")
elif short_code=="cap":
cprint("WE NEED TO CONFIRM ITS YOU!".center(terminal_width),"red",attrs=['bold','blink'])
print("Enter your username")
passwrd_change_username = input()
print("Enter your account password")
passwrd_change_password = input()
if not (passwrd_change_password or passwrd_change_username):
cprint("You submitted empty field(s)")
print("\n")
else:
data_match = login_user(passwrd_change_username, passwrd_change_password)
if data_match:
print("Enter your new password")
new_entered_passwrd = input()
print("Confirm password")
confirm_entered_passwrd = input()
if new_entered_passwrd == confirm_entered_passwrd:
user_change_password(passwrd_change_username, new_entered_passwrd)
print("\n")
cprint("Password changed","green")
print("\n")
else:
print("\n")
cprint("Password confirmation does NOT match","red")
print("\n")
else:
print("\n")
cprint("ERROR, please check your login details and try again","red")
print("\n")
elif short_code=="delete":
cprint("WE NEED TO CONFIRM ITS YOU!".center(terminal_width),"red",attrs=["bold","blink"])
print("Enter your username")
passwrd_change_username = input()
print("Enter your account password")
passwrd_change_password = input()
if not (passwrd_change_password or passwrd_change_username):
cprint("You submitted empty field(s)")
print("\n")
else:
data_match = login_user(passwrd_change_username, passwrd_change_password)
user_acc = user_change_password(passwrd_change_username, passwrd_change_password)
if data_match:
delete_account(user_acc)
print("\n")
cprint("User DELETED","green")
print("\n")
return
else:
print("\n")
cprint("ERROR, please check your Account Details and try again","red")
print("\n")
elif short_code=="logout":
return
elif short_code == "ex":
cprint("\t BYE. . ...","cyan")
sys.exit()
else:
print("\n")
cprint("You input an unrecognised command".center(terminal_width),"red")
print("\n")
def main():
cprint(figlet_format('LOCKER', font='speed'),'green', attrs=['bold'])
cprint("\033[1m" + "Hello and Welcome to the Password Locker".center(terminal_width),"white", attrs=['bold','blink'])
while True:
print("Do you have an account? Y/N")
account_prompt = input().upper().strip()
if account_prompt == "Y":
print("Enter your username:")
existing_username = input()
if not existing_username:
cprint("You have not entered a username !","red")
print("Enter your username:")
existing_username = input()
print("Enter your password:")
existing_password = input()
if not existing_password:
cprint("You have not entered a password!","red")
print("Enter your password:")
existing_password = input()
login_success = login_user(existing_username, existing_password)
if not login_success:
print("\n")
cprint("Incorrect username / password combination","red")
print("\n")
else:
while True:
print("\033[1m PROFILE CONTROLS:- "+'\033[0m'+"Use these short codes : np - Add a new profile, dp-Display all profiles, gp - generate new password for a profile, search - find a profile, copy - copy password to clipboard, del - delete a profile, logout- logout of session, ex - exit the application")
print("\033[1m ACCOUNT CONTROLS:- "+'\033[0m'+"Use these short codes : acp - Change your account password, delete - Delete your account")
short_code = input()
handle_short_codes(short_code)
if short_code=="logout" or short_code=="delete":
break
elif account_prompt == "N":
print("Enter your details to create a new account".center(terminal_width))
print("Please enter your preffered username")
new_user_username = input()
if not new_user_username:
cprint("You have not entered any username!","red")
new_user_username = input()
print("Please enter your password")
new_user_password = input()
if not new_user_password:
cprint("You have not entered any password!","red")
new_user_password = input()
user_already_exist = check_user_exists(new_user_username)
if not user_already_exist:
user_new = User(new_user_username, new_user_password)
if not save_account(user_new):
print("\n")
cprint("\033[1m Account created successfully \033[0m".center(terminal_width),"green")
print("\n")
while True:
print("\033[1m PROFILE CONTROLS:- "+'\033[0m'+"Use these short codes : np - Add a new profile, dp-Display all profiles, gp - generate new password for a profile, search - find a profile, copy - copy password to clipboard, del - delete a profile, logout- logout ex - exit the application")
print("\033[1m ACCOUNT CONTROLS:- "+'\033[0m'+"Use these short codes : cap - Change your account password, delete - Delete your account")
short_code = input()
handle_short_codes(short_code)
if short_code=="logout" or short_code=="delete":
break
else:
print("\n")
cprint("The username is already in use","magenta")
cprint("Please try another username","magenta")
print("\n")
else:
print("\n")
cprint("You Input an unrecognised command...Please enter Y/N!","red")
print("\n")
print("\n")
cprint("An interrupt detected...Exiting..", "red", attrs=["bold"])
sys.exit()
if __name__ == "__main__":
main() |
Sarah-Marion/Password_Locker-ultimate- | user_data.py | <filename>user_data.py
class User:
"""
class that generates new instances of users
"""
def __init__(self, username, password):
self.username = username
self.password = password
user_list = []
def save_user(self):
"""
save_user method saves user object into user_list
"""
User.user_list.append(self)
@classmethod
def user_exists(cls, userName):
"""
Method that checks if a user exists in the user list.
Args:
username: username to search if the user exists
Returns :
Boolean: True or false depending if the user exists
"""
for user in cls.user_list:
if user.username == userName:
return True
else:
return False
@classmethod
def find_user(cls, userName, passwrd):
"""
find_user method that checks if a username already exists
"""
for user in cls.user_list:
if user.username == userName:
return True
else:
return False
@classmethod
def confirm_user(cls, userName, passwrd):
"""
confirm_user method that checks if a password matches a username
"""
for User in cls.user_list:
if cls.find_user(userName, passwrd):
password_match = User.password
if password_match == passwrd:
return True
else:
return False
else:
return False
@classmethod
def change_userpass(cls, userName, new_pass):
"""
change_userpass method changes a user's password
"""
for user in cls.user_list:
if cls.find_user(userName, new_pass):
user.password = <PASSWORD>
return user
else:
return False
def user_delete_account(self):
"""
user_delete_account method that deletes a particular acount
"""
User.user_list.remove(self)
|
GenoM87/hubmap | src/models/scheduler.py | import torch
def make_scheduler(optimizer, cfg, train_loader):
if cfg.SOLVER.SCHEDULER == 'CosineAnnealingWarmRestarts':
number_of_iteration_per_epoch = len(train_loader)
learning_rate_step_size = cfg.SOLVER.SCHEDULER_COS_CPOCH * number_of_iteration_per_epoch
scheduler = getattr(torch.optim.lr_scheduler, cfg.SOLVER.SCHEDULER)(optimizer, T_0=learning_rate_step_size, T_mult=cfg.SOLVER.T_MUL)
return scheduler
elif cfg.SOLVER.SCHEDULER == 'ReduceLROnPlateau':
return torch.optim.lr_scheduler.ReduceLROnPlateau(
optimizer=optimizer,
mode=cfg.SOLVER.SCHEDULER_MODE,
factor=cfg.SOLVER.SCHEDULER_REDFACT,
patience=cfg.SOLVER.SCHEDULER_PATIENCE
)
if cfg.SOLVER.SCHEDULER == 'CosineAnnealingLR':
number_of_iteration_per_epoch = len(train_loader)
learning_rate_step_size = cfg.SOLVER.SCHEDULER_COS_CPOCH * number_of_iteration_per_epoch
scheduler = getattr(torch.optim.lr_scheduler, cfg.SOLVER.SCHEDULER)(optimizer, T_max=cfg.SOLVER.T_MAX, eta_min=cfg.SOLVER.MIN_LR, last_epoch=-1)
return scheduler
else:
print('NOME SCHEDULER NON RICONOSCIUTO!')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.