import numpy as np
import pickle
import os

def GenerateFeature_alpha(ligand_name, working_dir):
    Cut = 12.0

    LIGELE = ['C','N','O','S','CN','CO','CS','NO','NS','OS','CCl','CBr','CP','CF','CNO','CNS','COS','NOS','CNOS','CNOSPFClBrI','H','CH','NH','OH','SH','CNH','COH','CSH','NOH','NSH','OSH','CNOH','CNSH','COSH','NOSH','CNOSH','CNOSPFClBrIH','CClH','CBrH','CPH','CFH']

    Feature_i = []
    pdb = ligand_name
    InFile = open(working_dir+'/'+ligand_name+'_alpha.pkl')
    BarCollection = pickle.load(InFile)
    for el in LIGELE:
        if 'lig_'+el in BarCollection.keys():
            Bars = BarCollection['lig_'+el]
            Bar0Birth = []; Bar0Death = []; Bar1Birth = []; Bar1Death = []; Bar2Birth = []; Bar2Death = [];
            for Bar in Bars:
                if Bar[2] < Bar[1]:
                    continue
                if Bar[2] > 12.0 and Bar[0] == 0: continue
                if Bar[2] > 12.0 and Bar[0] > 0: Bar[2] = 12.0
                if Bar[0] == 0:
                    Bar0Birth.append(Bar[1])
                    Bar0Death.append(Bar[2])
                if Bar[0] == 1:
                    Bar1Birth.append(Bar[1])
                    Bar1Death.append(Bar[2])
                if Bar[0] == 2:
                    Bar2Birth.append(Bar[1])
                    Bar2Death.append(Bar[2])
            if len(Bar0Birth) > 0:
                Bar0Birth = np.asarray(Bar0Birth, float)
                Bar0Death = np.asarray(Bar0Death, float)
            if len(Bar1Birth) > 0:
                Bar1Birth = np.asarray(Bar1Birth, float)
                Bar1Death = np.asarray(Bar1Death, float)
            if len(Bar2Birth) > 0:
                Bar2Birth = np.asarray(Bar2Birth, float)
                Bar2Death = np.asarray(Bar2Death, float)
            if len(Bar0Death) > 0:
                Feature_i.append(np.mean(Bar0Death[:]))
                Feature_i.append(np.std(Bar0Death[:]))
                Feature_i.append(np.max(Bar0Death[:]))
                Feature_i.append(np.min(Bar0Death[:]))
                Feature_i.append(np.sum(Bar0Death[:]))
                Feature_i.append(len(Bar0Death))
            else:
                Feature_i.extend([0.]*6)
            if len(Bar1Death) > 0:
                Feature_i.append(np.mean(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.std(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.max(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.min(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.sum(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(Bar1Birth[np.argmax(Bar1Death[:] - Bar1Birth[:])])
                Feature_i.append(Bar1Death[np.argmax(Bar1Death[:] - Bar1Birth[:])])
                Feature_i.append(np.mean(Bar1Birth[:]))
                Feature_i.append(np.std(Bar1Birth[:]))
                Feature_i.append(np.max(Bar1Birth[:]))
                Feature_i.append(np.min(Bar1Birth[:]))
                Feature_i.append(np.sum(Bar1Birth[:]))
                Feature_i.append(np.mean(Bar1Death[:]))
                Feature_i.append(np.std(Bar1Death[:]))
                Feature_i.append(np.max(Bar1Death[:]))
                Feature_i.append(np.min(Bar1Death[:]))
                Feature_i.append(np.sum(Bar1Death[:]))
                Feature_i.append(len(Bar1Death))
            else:
                Feature_i.extend([0.]*18)
            if len(Bar2Death) > 0:
                Feature_i.append(np.mean(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.std(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.max(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.min(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.sum(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(Bar2Birth[np.argmax(Bar2Death[:] - Bar2Birth[:])])
                Feature_i.append(Bar2Death[np.argmax(Bar2Death[:] - Bar2Birth[:])])
                Feature_i.append(np.mean(Bar2Birth[:]))
                Feature_i.append(np.std(Bar2Birth[:]))
                Feature_i.append(np.max(Bar2Birth[:]))
                Feature_i.append(np.min(Bar2Birth[:]))
                Feature_i.append(np.sum(Bar2Birth[:]))
                Feature_i.append(np.mean(Bar2Death[:]))
                Feature_i.append(np.std(Bar2Death[:]))
                Feature_i.append(np.max(Bar2Death[:]))
                Feature_i.append(np.min(Bar2Death[:]))
                Feature_i.append(np.sum(Bar2Death[:]))
                Feature_i.append(len(Bar2Death))
            else:
                Feature_i.extend([0.]*18)
        else:
            Feature_i.extend([0.]*42)
    Feature_i = np.asarray(Feature_i, float)

    outfile = open(working_dir+'/'+ligand_name+'_feature_alpha_handcrafted.npy', 'w')
    np.save(outfile, Feature_i)
    outfile.close()

def GenerateFeature_level1(ligand_name, working_dir):
    small = 0.01
    Feature_i = []
    Cut = 12.0

    LIGELE = ['C','N','O','S','CN','CO','CS','NO','NS','OS','CCl','CBr','CP','CF','CNO','CNS','COS','NOS','CNOS','CNOSPFClBrI','H','CH','NH','OH','SH','CNH','COH','CSH','NOH','NSH','OSH','CNOH','CNSH','COSH','NOSH','CNOSH','CNOSPFClBrIH','CClH','CBrH','CPH','CFH']

    pdb = ligand_name

    for el in LIGELE:
        if os.path.exists(working_dir+'/'+ligand_name+'_'+el+'_level1.PH'):
            InFile = open(working_dir+'/'+ligand_name+'_'+el+'_level1.PH')
            lines = InFile.read().splitlines()
            Bars = []
            for line in lines:
                a,b,c = line.split()
                Bars.append([int(a), float(b), float(c)])
            InFile.close()
            Bar0Birth = []; Bar0Death = []; Bar1Birth = []; Bar1Death = []; Bar2Birth = []; Bar2Death = [];
            for Bar in Bars:
                if Bar[2] < Bar[1]:
                    continue
                if Bar[2] > 12.0 and Bar[0] == 0: continue
                if Bar[2] > 12.0 and Bar[0] > 0: Bar[2] = 12.0
                if Bar[0] == 0 and Bar[2]-Bar[1] >= small:
                    Bar0Birth.append(Bar[1])
                    Bar0Death.append(Bar[2])
                if Bar[0] == 1 and Bar[2]-Bar[1] >= small:
                    Bar1Birth.append(Bar[1])
                    Bar1Death.append(Bar[2])
                if Bar[0] == 2 and Bar[2]-Bar[1] >= small:
                    Bar2Birth.append(Bar[1])
                    Bar2Death.append(Bar[2])
            if len(Bar0Birth) > 0:
                Bar0Birth = np.asarray(Bar0Birth, float)
                Bar0Death = np.asarray(Bar0Death, float)
            if len(Bar1Birth) > 0:
                Bar1Birth = np.asarray(Bar1Birth, float)
                Bar1Death = np.asarray(Bar1Death, float)
            if len(Bar2Birth) > 0:
                Bar2Birth = np.asarray(Bar2Birth, float)
                Bar2Death = np.asarray(Bar2Death, float)
            if len(Bar0Death) > 0:
                Feature_i.append(np.mean(Bar0Death[:]))
                Feature_i.append(np.std(Bar0Death[:]))
                Feature_i.append(np.max(Bar0Death[:]))
                Feature_i.append(np.min(Bar0Death[:]))
                Feature_i.append(np.sum(Bar0Death[:]))
                Feature_i.append(len(Bar0Death))
            else:
                Feature_i.extend([0.]*6)
            if len(Bar1Death) > 0:
                Feature_i.append(np.mean(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.std(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.max(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.min(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(np.sum(Bar1Death[:] - Bar1Birth[:]))
                Feature_i.append(Bar1Birth[np.argmax(Bar1Death[:] - Bar1Birth[:])])
                Feature_i.append(Bar1Death[np.argmax(Bar1Death[:] - Bar1Birth[:])])
                Feature_i.append(np.mean(Bar1Birth[:]))
                Feature_i.append(np.std(Bar1Birth[:]))
                Feature_i.append(np.max(Bar1Birth[:]))
                Feature_i.append(np.min(Bar1Birth[:]))
                Feature_i.append(np.sum(Bar1Birth[:]))
                Feature_i.append(np.mean(Bar1Death[:]))
                Feature_i.append(np.std(Bar1Death[:]))
                Feature_i.append(np.max(Bar1Death[:]))
                Feature_i.append(np.min(Bar1Death[:]))
                Feature_i.append(np.sum(Bar1Death[:]))
                Feature_i.append(len(Bar1Death))
            else:
                Feature_i.extend([0.]*18)
            if len(Bar2Death) > 0:
                Feature_i.append(np.mean(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.std(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.max(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.min(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(np.sum(Bar2Death[:] - Bar2Birth[:]))
                Feature_i.append(Bar2Birth[np.argmax(Bar2Death[:] - Bar2Birth[:])])
                Feature_i.append(Bar2Death[np.argmax(Bar2Death[:] - Bar2Birth[:])])
                Feature_i.append(np.mean(Bar2Birth[:]))
                Feature_i.append(np.std(Bar2Birth[:]))
                Feature_i.append(np.max(Bar2Birth[:]))
                Feature_i.append(np.min(Bar2Birth[:]))
                Feature_i.append(np.sum(Bar2Birth[:]))
                Feature_i.append(np.mean(Bar2Death[:]))
                Feature_i.append(np.std(Bar2Death[:]))
                Feature_i.append(np.max(Bar2Death[:]))
                Feature_i.append(np.min(Bar2Death[:]))
                Feature_i.append(np.sum(Bar2Death[:]))
                Feature_i.append(len(Bar2Death))
            else:
                Feature_i.extend([0.]*18)
        else:
            Feature_i.extend([0.]*42)
    Feature_i = np.asarray(Feature_i, float)

    outfile = open(working_dir+'/'+ligand_name+'_feature_ligand_level1_handcrafted.npy', 'w')
    np.save(outfile, Feature_i)
    outfile.close()

[((13, 20, 13, 39), 'pickle.load', 'pickle.load', ({(13, 32, 13, 38): 'InFile'}, {}), '(InFile)', False, 'import pickle\n'), ((94, 16, 94, 44), 'numpy.asarray', 'np.asarray', ({(94, 27, 94, 36): 'Feature_i', (94, 38, 94, 43): 'float'}, {}), '(Feature_i, float)', True, 'import numpy as np\n'), ((97, 4, 97, 31), 'numpy.save', 'np.save', ({(97, 12, 97, 19): 'outfile', (97, 21, 97, 30): 'Feature_i'}, {}), '(outfile, Feature_i)', True, 'import numpy as np\n'), ((195, 16, 195, 44), 'numpy.asarray', 'np.asarray', ({(195, 27, 195, 36): 'Feature_i', (195, 38, 195, 43): 'float'}, {}), '(Feature_i, float)', True, 'import numpy as np\n'), ((198, 4, 198, 31), 'numpy.save', 'np.save', ({(198, 12, 198, 19): 'outfile', (198, 21, 198, 30): 'Feature_i'}, {}), '(outfile, Feature_i)', True, 'import numpy as np\n'), ((110, 11, 110, 74), 'os.path.exists', 'os.path.exists', ({(110, 26, 110, 73): "(working_dir + '/' + ligand_name + '_' + el + '_level1.PH')"}, {}), "(working_dir + '/' + ligand_name + '_' + el + '_level1.PH')", False, 'import os\n'), ((33, 28, 33, 56), 'numpy.asarray', 'np.asarray', ({(33, 39, 33, 48): 'Bar0Birth', (33, 50, 33, 55): 'float'}, {}), '(Bar0Birth, float)', True, 'import numpy as np\n'), ((34, 28, 34, 56), 'numpy.asarray', 'np.asarray', ({(34, 39, 34, 48): 'Bar0Death', (34, 50, 34, 55): 'float'}, {}), '(Bar0Death, float)', True, 'import numpy as np\n'), ((36, 28, 36, 56), 'numpy.asarray', 'np.asarray', ({(36, 39, 36, 48): 'Bar1Birth', (36, 50, 36, 55): 'float'}, {}), '(Bar1Birth, float)', True, 'import numpy as np\n'), ((37, 28, 37, 56), 'numpy.asarray', 'np.asarray', ({(37, 39, 37, 48): 'Bar1Death', (37, 50, 37, 55): 'float'}, {}), '(Bar1Death, float)', True, 'import numpy as np\n'), ((39, 28, 39, 56), 'numpy.asarray', 'np.asarray', ({(39, 39, 39, 48): 'Bar2Birth', (39, 50, 39, 55): 'float'}, {}), '(Bar2Birth, float)', True, 'import numpy as np\n'), ((40, 28, 40, 56), 'numpy.asarray', 'np.asarray', ({(40, 39, 40, 48): 'Bar2Death', (40, 50, 40, 55): 'float'}, {}), '(Bar2Death, float)', True, 'import numpy as np\n'), ((134, 28, 134, 56), 'numpy.asarray', 'np.asarray', ({(134, 39, 134, 48): 'Bar0Birth', (134, 50, 134, 55): 'float'}, {}), '(Bar0Birth, float)', True, 'import numpy as np\n'), ((135, 28, 135, 56), 'numpy.asarray', 'np.asarray', ({(135, 39, 135, 48): 'Bar0Death', (135, 50, 135, 55): 'float'}, {}), '(Bar0Death, float)', True, 'import numpy as np\n'), ((137, 28, 137, 56), 'numpy.asarray', 'np.asarray', ({(137, 39, 137, 48): 'Bar1Birth', (137, 50, 137, 55): 'float'}, {}), '(Bar1Birth, float)', True, 'import numpy as np\n'), ((138, 28, 138, 56), 'numpy.asarray', 'np.asarray', ({(138, 39, 138, 48): 'Bar1Death', (138, 50, 138, 55): 'float'}, {}), '(Bar1Death, float)', True, 'import numpy as np\n'), ((140, 28, 140, 56), 'numpy.asarray', 'np.asarray', ({(140, 39, 140, 48): 'Bar2Birth', (140, 50, 140, 55): 'float'}, {}), '(Bar2Birth, float)', True, 'import numpy as np\n'), ((141, 28, 141, 56), 'numpy.asarray', 'np.asarray', ({(141, 39, 141, 48): 'Bar2Death', (141, 50, 141, 55): 'float'}, {}), '(Bar2Death, float)', True, 'import numpy as np\n'), ((42, 33, 42, 54), 'numpy.mean', 'np.mean', ({(42, 41, 42, 53): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((43, 33, 43, 53), 'numpy.std', 'np.std', ({(43, 40, 43, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((44, 33, 44, 53), 'numpy.max', 'np.max', ({(44, 40, 44, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((45, 33, 45, 53), 'numpy.min', 'np.min', ({(45, 40, 45, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((46, 33, 46, 53), 'numpy.sum', 'np.sum', ({(46, 40, 46, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((51, 33, 51, 69), 'numpy.mean', 'np.mean', ({(51, 41, 51, 68): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((52, 33, 52, 68), 'numpy.std', 'np.std', ({(52, 40, 52, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((53, 33, 53, 68), 'numpy.max', 'np.max', ({(53, 40, 53, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((54, 33, 54, 68), 'numpy.min', 'np.min', ({(54, 40, 54, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((55, 33, 55, 68), 'numpy.sum', 'np.sum', ({(55, 40, 55, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((58, 33, 58, 54), 'numpy.mean', 'np.mean', ({(58, 41, 58, 53): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((59, 33, 59, 53), 'numpy.std', 'np.std', ({(59, 40, 59, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((60, 33, 60, 53), 'numpy.max', 'np.max', ({(60, 40, 60, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((61, 33, 61, 53), 'numpy.min', 'np.min', ({(61, 40, 61, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((62, 33, 62, 53), 'numpy.sum', 'np.sum', ({(62, 40, 62, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((63, 33, 63, 54), 'numpy.mean', 'np.mean', ({(63, 41, 63, 53): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((64, 33, 64, 53), 'numpy.std', 'np.std', ({(64, 40, 64, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((65, 33, 65, 53), 'numpy.max', 'np.max', ({(65, 40, 65, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((66, 33, 66, 53), 'numpy.min', 'np.min', ({(66, 40, 66, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((67, 33, 67, 53), 'numpy.sum', 'np.sum', ({(67, 40, 67, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((72, 33, 72, 69), 'numpy.mean', 'np.mean', ({(72, 41, 72, 68): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((73, 33, 73, 68), 'numpy.std', 'np.std', ({(73, 40, 73, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((74, 33, 74, 68), 'numpy.max', 'np.max', ({(74, 40, 74, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((75, 33, 75, 68), 'numpy.min', 'np.min', ({(75, 40, 75, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((76, 33, 76, 68), 'numpy.sum', 'np.sum', ({(76, 40, 76, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((79, 33, 79, 54), 'numpy.mean', 'np.mean', ({(79, 41, 79, 53): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((80, 33, 80, 53), 'numpy.std', 'np.std', ({(80, 40, 80, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((81, 33, 81, 53), 'numpy.max', 'np.max', ({(81, 40, 81, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((82, 33, 82, 53), 'numpy.min', 'np.min', ({(82, 40, 82, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((83, 33, 83, 53), 'numpy.sum', 'np.sum', ({(83, 40, 83, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((84, 33, 84, 54), 'numpy.mean', 'np.mean', ({(84, 41, 84, 53): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((85, 33, 85, 53), 'numpy.std', 'np.std', ({(85, 40, 85, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((86, 33, 86, 53), 'numpy.max', 'np.max', ({(86, 40, 86, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((87, 33, 87, 53), 'numpy.min', 'np.min', ({(87, 40, 87, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((88, 33, 88, 53), 'numpy.sum', 'np.sum', ({(88, 40, 88, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((143, 33, 143, 54), 'numpy.mean', 'np.mean', ({(143, 41, 143, 53): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((144, 33, 144, 53), 'numpy.std', 'np.std', ({(144, 40, 144, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((145, 33, 145, 53), 'numpy.max', 'np.max', ({(145, 40, 145, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((146, 33, 146, 53), 'numpy.min', 'np.min', ({(146, 40, 146, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((147, 33, 147, 53), 'numpy.sum', 'np.sum', ({(147, 40, 147, 52): 'Bar0Death[:]'}, {}), '(Bar0Death[:])', True, 'import numpy as np\n'), ((152, 33, 152, 69), 'numpy.mean', 'np.mean', ({(152, 41, 152, 68): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((153, 33, 153, 68), 'numpy.std', 'np.std', ({(153, 40, 153, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((154, 33, 154, 68), 'numpy.max', 'np.max', ({(154, 40, 154, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((155, 33, 155, 68), 'numpy.min', 'np.min', ({(155, 40, 155, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((156, 33, 156, 68), 'numpy.sum', 'np.sum', ({(156, 40, 156, 67): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((159, 33, 159, 54), 'numpy.mean', 'np.mean', ({(159, 41, 159, 53): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((160, 33, 160, 53), 'numpy.std', 'np.std', ({(160, 40, 160, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((161, 33, 161, 53), 'numpy.max', 'np.max', ({(161, 40, 161, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((162, 33, 162, 53), 'numpy.min', 'np.min', ({(162, 40, 162, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((163, 33, 163, 53), 'numpy.sum', 'np.sum', ({(163, 40, 163, 52): 'Bar1Birth[:]'}, {}), '(Bar1Birth[:])', True, 'import numpy as np\n'), ((164, 33, 164, 54), 'numpy.mean', 'np.mean', ({(164, 41, 164, 53): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((165, 33, 165, 53), 'numpy.std', 'np.std', ({(165, 40, 165, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((166, 33, 166, 53), 'numpy.max', 'np.max', ({(166, 40, 166, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((167, 33, 167, 53), 'numpy.min', 'np.min', ({(167, 40, 167, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((168, 33, 168, 53), 'numpy.sum', 'np.sum', ({(168, 40, 168, 52): 'Bar1Death[:]'}, {}), '(Bar1Death[:])', True, 'import numpy as np\n'), ((173, 33, 173, 69), 'numpy.mean', 'np.mean', ({(173, 41, 173, 68): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((174, 33, 174, 68), 'numpy.std', 'np.std', ({(174, 40, 174, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((175, 33, 175, 68), 'numpy.max', 'np.max', ({(175, 40, 175, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((176, 33, 176, 68), 'numpy.min', 'np.min', ({(176, 40, 176, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((177, 33, 177, 68), 'numpy.sum', 'np.sum', ({(177, 40, 177, 67): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((180, 33, 180, 54), 'numpy.mean', 'np.mean', ({(180, 41, 180, 53): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((181, 33, 181, 53), 'numpy.std', 'np.std', ({(181, 40, 181, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((182, 33, 182, 53), 'numpy.max', 'np.max', ({(182, 40, 182, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((183, 33, 183, 53), 'numpy.min', 'np.min', ({(183, 40, 183, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((184, 33, 184, 53), 'numpy.sum', 'np.sum', ({(184, 40, 184, 52): 'Bar2Birth[:]'}, {}), '(Bar2Birth[:])', True, 'import numpy as np\n'), ((185, 33, 185, 54), 'numpy.mean', 'np.mean', ({(185, 41, 185, 53): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((186, 33, 186, 53), 'numpy.std', 'np.std', ({(186, 40, 186, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((187, 33, 187, 53), 'numpy.max', 'np.max', ({(187, 40, 187, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((188, 33, 188, 53), 'numpy.min', 'np.min', ({(188, 40, 188, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((189, 33, 189, 53), 'numpy.sum', 'np.sum', ({(189, 40, 189, 52): 'Bar2Death[:]'}, {}), '(Bar2Death[:])', True, 'import numpy as np\n'), ((56, 43, 56, 81), 'numpy.argmax', 'np.argmax', ({(56, 53, 56, 80): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((57, 43, 57, 81), 'numpy.argmax', 'np.argmax', ({(57, 53, 57, 80): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((77, 43, 77, 81), 'numpy.argmax', 'np.argmax', ({(77, 53, 77, 80): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((78, 43, 78, 81), 'numpy.argmax', 'np.argmax', ({(78, 53, 78, 80): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((157, 43, 157, 81), 'numpy.argmax', 'np.argmax', ({(157, 53, 157, 80): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((158, 43, 158, 81), 'numpy.argmax', 'np.argmax', ({(158, 53, 158, 80): '(Bar1Death[:] - Bar1Birth[:])'}, {}), '(Bar1Death[:] - Bar1Birth[:])', True, 'import numpy as np\n'), ((178, 43, 178, 81), 'numpy.argmax', 'np.argmax', ({(178, 53, 178, 80): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n'), ((179, 43, 179, 81), 'numpy.argmax', 'np.argmax', ({(179, 53, 179, 80): '(Bar2Death[:] - Bar2Birth[:])'}, {}), '(Bar2Death[:] - Bar2Birth[:])', True, 'import numpy as np\n')]