def _add_implied_job_id(d):
 if (not d.get('job_id')):
  if d.get('task_id'):
   d['job_id'] = _to_job_id(d['task_id'])
  elif d.get('application_id'):
   d['job_id'] = _to_job_id(d['application_id'])

def _add_implied_job_id ( d ) : if ( not d . get ( 'job_id' ) ) : if d . get ( 'task_id' ) : d [ 'job_id' ] = _to_job_id ( d [ 'task_id' ] ) elif d . get ( 'application_id' ) : d [ 'job_id' ] = _to_job_id ( d [ 'application_id' ] )
if *d* has *task_id* or *application_id* but not *job_id* .