# Path: genData/gen_data_all.py
# def genAll(keys_type = None, ignore_date = True):
#     return genAll_X() + genAll_y(keys_type, ignore_date)
# 
# Path: utils/gen_u_a_d_keys.py
# def gen(fromDate = None, toDate = None, table_name = None):
# def genAll():
# 
# Path: utils/gen_u_s_d_keys.py
# def gen(fromDate = None, toDate = None, table_name = None):
# def genAll():
# 
# Path: gen_y_features/gen_y_features_all.py
# def gen_y_features_all(keys_type = None, ignore_date = True):
#     assert keys_type
#     if keys_type == 'u_a_d':
#         return [user_artist_y_features_train.gen(ignore_date=ignore_date), 
#                 user_artist_y_features_test.gen(ignore_date=ignore_date)]
#     elif keys_type == 'u_s_d':
#         return [user_song_y_features_train.gen(ignore_date=ignore_date), 
#                 user_song_y_features_test.gen(ignore_date=ignore_date)]


from genData.gen_data_all import genAll as genAllData
from utils import gen_u_a_d_keys, gen_u_s_d_keys
from gen_y_features import gen_y_features_all

    sql = """
    DROP table if EXISTS artist_label_map;
    CREATE TABLE artist_label_map as
    SELECT artist_id, @rank:=@rank+1 as label from songs, (SELECT @rank:=0)a
    GROUP BY artist_id;
    """
    
    return [sql]

if __name__ == '__main__':
    ignore_date = True
    keys_type = 'u_a_d'
    sql = ""
    
    for i in gen_artist_label_map():
        sql += i
    
    if keys_type == 'u_a_d':
        for i in gen_u_a_d_keys.genAll():
            sql += i
        
        for i in gen_y_features_all.gen_y_features_all(keys_type, ignore_date):
            sql += i
            
        for i in genAllData(keys_type, ignore_date):
            sql += i
    elif keys_type == 'u_s_d':
        for i in gen_u_s_d_keys.genAll():
            sql += i
            

# Path: genData/gen_data_all.py
# def genAll(keys_type = None, ignore_date = True):
#     return genAll_X() + genAll_y(keys_type, ignore_date)
# 
# Path: utils/gen_u_a_d_keys.py
# def gen(fromDate = None, toDate = None, table_name = None):
# def genAll():
# 
# Path: utils/gen_u_s_d_keys.py
# def gen(fromDate = None, toDate = None, table_name = None):
# def genAll():
# 
# Path: gen_y_features/gen_y_features_all.py
# def gen_y_features_all(keys_type = None, ignore_date = True):
#     assert keys_type
#     if keys_type == 'u_a_d':
#         return [user_artist_y_features_train.gen(ignore_date=ignore_date), 
#                 user_artist_y_features_test.gen(ignore_date=ignore_date)]
#     elif keys_type == 'u_s_d':
#         return [user_song_y_features_train.gen(ignore_date=ignore_date), 
#                 user_song_y_features_test.gen(ignore_date=ignore_date)]


# Path: models/gen_all_sql.py
from genData.gen_data_all import genAll as genAllData
from utils import gen_u_a_d_keys, gen_u_s_d_keys
from gen_y_features import gen_y_features_all

    sql = """
    DROP table if EXISTS artist_label_map;
    CREATE TABLE artist_label_map as
    SELECT artist_id, @rank:=@rank+1 as label from songs, (SELECT @rank:=0)a
    GROUP BY artist_id;
    """
    
    return [sql]

if __name__ == '__main__':
    ignore_date = True
    keys_type = 'u_a_d'
    sql = ""
    
    for i in gen_artist_label_map():
        sql += i
    
    if keys_type == 'u_a_d':
        for i in gen_u_a_d_keys.genAll():
            sql += i
        
        for i in gen_y_features_all.gen_y_features_all(keys_type, ignore_date):
            sql += i
            
        for i in genAllData(keys_type, ignore_date):
            sql += i
    elif keys_type == 'u_s_d':
        for i in gen_u_s_d_keys.genAll():
            sql += i
            

        for i in gen_y_features_all.gen_y_features_all(keys_type, ignore_date):
