def need_to_sort(path, dt):

    def get_dt(path):
        df_dt = pd.read_csv(path)['time'][0:2].values
        return (df_dt[1] - df_dt[0])
    if (path[(- 11):] == '_sorted.csv'):
        if (get_dt(path) == dt):
            return False
        else:
            return True
    else:
        path_sorted = (path[:(- 4)] + '_sorted.csv')
        import os.path
        if os.path.isfile(path_sorted):
            if (get_dt(path_sorted) == dt):
                return False
            else:
                return True
        else:
            return True
def need_to_sort(path, dt):

    def get_dt(path):
        df_dt = pd.read_csv(path)['time'][0:2].values
        return (df_dt[1] - df_dt[0])
    if (path[(- 11):] == '_sorted.csv'):
        if (get_dt(path) == dt):
            return False
        else:
            return True
    else:
        path_sorted = (path[:(- 4)] + '_sorted.csv')
        import os.path
        if os.path.isfile(path_sorted):
            if (get_dt(path_sorted) == dt):
                return False
            else:
                return True
        else:
            return True