# Path: visual/visual_info.py
# USE_TIME_AS_X = 2
# BF_EVOLUTION = 1
# SINGLE_TOPO_FILE = 3
# 
# Path: visual/visualize_species_struct.py
# def get_config():
# def sync_dir(remote_dir, synced_flag=False):
# def parse_rank_info(local_dir, topk=5):
# def burst_images(args, local_dir, spc_candidates):


import init_path
import os
import csv
import glob
import datetime
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
        import pdb; pdb.set_trace()
            import pdb; pdb.set_trace()
    import pandas as pd
    import seaborn as sns
    import seaborn as sns
    import pandas as pd
        import pdb; pdb.set_trace()
    import seaborn as sns
    import pandas as pd
        import pdb; pdb.set_trace()
    import seaborn as sns
    import pandas as pd
        import pdb; pdb.set_trace()
from matplotlib import rc
from matplotlib import rcParams
from scipy import interpolate
from visual import visual_info
from visual import visualize_species_struct
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl

        gen_date = row.split(' ')[0][-4:] # log file seems to have color
        gen_hms = row.split(' ')[1]
        # the training might take place overnight, so need to consider 
        # clock and the date time
        gen_time = '2018-%s-%s %s' % (gen_date[0:2], gen_date[2:], gen_hms)
        gen_time = datetime.datetime.strptime(gen_time, 
                                              "%Y-%m-%d %H:%M:%S")
        gen_time_list.append( (gen_num, gen_time) )


    gen_time_list = sorted(gen_time_list, key=lambda x: x[0])
    start_time = gen_time_list[0][1]
    
    new_gen_time_list = []
    for i in range( len(gen_time_list) - 1 ):

        gen_num, gen_time = gen_time_list[i + 1]
        time_offset = (gen_time - start_time).total_seconds()
        new_gen_time_list.append(time_offset / 3600.0)

    for i in range( len(new_gen_time_list) - 1 ):
        assert new_gen_time_list[i] <= new_gen_time_list[i + 1]


    return [0] + new_gen_time_list

def examine_brute_force(task, experiment):
    '''
    '''

# Path: visual/visual_info.py
# USE_TIME_AS_X = 2
# BF_EVOLUTION = 1
# SINGLE_TOPO_FILE = 3
# 
# Path: visual/visualize_species_struct.py
# def get_config():
# def sync_dir(remote_dir, synced_flag=False):
# def parse_rank_info(local_dir, topk=5):
# def burst_images(args, local_dir, spc_candidates):


# Path: visual/visual_util.py
import init_path
import os
import csv
import glob
import datetime
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
        import pdb; pdb.set_trace()
            import pdb; pdb.set_trace()
    import pandas as pd
    import seaborn as sns
    import seaborn as sns
    import pandas as pd
        import pdb; pdb.set_trace()
    import seaborn as sns
    import pandas as pd
        import pdb; pdb.set_trace()
    import seaborn as sns
    import pandas as pd
        import pdb; pdb.set_trace()
from matplotlib import rc
from matplotlib import rcParams
from scipy import interpolate
from visual import visual_info
from visual import visualize_species_struct
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl
    from matplotlib import pyplot as pl


        gen_date = row.split(' ')[0][-4:] # log file seems to have color
        gen_hms = row.split(' ')[1]
        # the training might take place overnight, so need to consider 
        # clock and the date time
        gen_time = '2018-%s-%s %s' % (gen_date[0:2], gen_date[2:], gen_hms)
        gen_time = datetime.datetime.strptime(gen_time, 
                                              "%Y-%m-%d %H:%M:%S")
        gen_time_list.append( (gen_num, gen_time) )


    gen_time_list = sorted(gen_time_list, key=lambda x: x[0])
    start_time = gen_time_list[0][1]
    
    new_gen_time_list = []
    for i in range( len(gen_time_list) - 1 ):

        gen_num, gen_time = gen_time_list[i + 1]
        time_offset = (gen_time - start_time).total_seconds()
        new_gen_time_list.append(time_offset / 3600.0)

    for i in range( len(new_gen_time_list) - 1 ):
        assert new_gen_time_list[i] <= new_gen_time_list[i + 1]


    return [0] + new_gen_time_list

def examine_brute_force(task, experiment):
    '''
    '''

    remote_dir = visual_info.remote_data_dir[task][experiment]