def get_job_count_by_state(request, username):
 res = {'completed': 0, 'running': 0, 'failed': 0, 'killed': 0, 'all': 0}
 jobcounts = request.jt.get_job_count_by_user(username)
 res['completed'] = jobcounts.nSucceeded
 res['running'] = (jobcounts.nPrep + jobcounts.nRunning)
 res['failed'] = jobcounts.nFailed
 res['killed'] = jobcounts.nKilled
 res['all'] = (((res['completed'] + res['running']) + res['failed']) + res['killed'])
 return res

def get_job_count_by_state ( request , username ) : res = { 'completed' : 0 , 'running' : 0 , 'failed' : 0 , 'killed' : 0 , 'all' : 0 } jobcounts = request . jt . get_job_count_by_user ( username ) res [ 'completed' ] = jobcounts . nSucceeded res [ 'running' ] = ( jobcounts . nPrep + jobcounts . nRunning ) res [ 'failed' ] = jobcounts . nFailed res [ 'killed' ] = jobcounts . nKilled res [ 'all' ] = ( ( ( res [ 'completed' ] + res [ 'running' ] ) + res [ 'failed' ] ) + res [ 'killed' ] ) return res
returns the number of comlpeted .