@@ -0,0 +1,932 @@
+import logging%0A%0Afrom db.models.build_jobs import BuildJob%0A%0A_logger = logging.getLogger('polyaxon.db')%0A%0A%0Adef get_valid_build_job(build_job_id=None, build_job_uuid=None):%0A    if not any(%5Bbuild_job_id, build_job_uuid%5D) or all(%5Bbuild_job_id, build_job_uuid%5D):%0A        raise ValueError('%60get_valid_build_job%60 function expects an build_job id or uuid.')%0A%0A    try:%0A        if build_job_uuid:%0A            build_job = BuildJob.objects.get(uuid=build_job_uuid)%0A        else:%0A            build_job = BuildJob.objects.get(id=build_job_id)%0A    except BuildJob.DoesNotExist:%0A        _logger.info('Experiment id %60%25s%60 does not exist', build_job_id)%0A        return None%0A%0A    return build_job%0A%0A%0Adef is_build_job_still_running(build_job_id=None, build_job_uuid=None):%0A    build_job = get_valid_build_job(build_job_id=build_job_id, build_job_uuid=build_job_uuid)%0A%0A    if not build_job or not build_job.is_running:%0A        return False%0A%0A    return True%0A

Add build job getter