from datetime import datetime


def make_paths(global_root_dir, global_results_dir_name, prefix, insert_datetime=True):
    """Returns paths formed from command line arguments"""

    global_results_dir = global_root_dir + '/' + global_results_dir_name

    if insert_datetime:
        datetime_string = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
    else:
        datetime_string = ''

    if prefix is None:
        results_dir_name = datetime_string
    else:
        if datetime_string:
            results_dir_name = prefix + '_' + datetime_string
        else:
            results_dir_name = prefix

    results_dir = global_results_dir + '/' + results_dir_name

    return global_results_dir, results_dir, results_dir_name