install_aicrowd_utilities <- function() {
    if (Sys.getenv("AICROWD_IS_EVALUATING", "false") != "true") {
        cat(system('pip3 install -q -U aicrowd-cli', intern=TRUE), sep='\n')
    }
}

aicrowd_login <- function(api_key) {
    if (Sys.getenv("AICROWD_IS_EVALUATING", "false") != "true") {
        cat(system(paste('aicrowd login --api-key', api_key), intern=TRUE), sep='\n')
    }
}

aicrowd_submit <- function(assets_dir, dataset_dir, challenge_name = "addi-alzheimers-detection-challenge", description = "Submitted via AIcrowd CLI for R") {
    if (Sys.getenv("AICROWD_IS_EVALUATING", "false") != "true") {
        cat(system(paste('DATASET_PATH="', dataset_dir,'" aicrowd notebook submit --assets-dir ', assets_dir,' --challenge ', 'addi-alzheimers-detection-challenge 2>&1', sep=""), intern=TRUE), sep='\n')
    }
}