def _add_implied_task_id(d):
 if (d.get('attempt_id') and (not d.get('task_id'))):
  d['task_id'] = _attempt_id_to_task_id(d['attempt_id'])

def _add_implied_task_id ( d ) : if ( d . get ( 'attempt_id' ) and ( not d . get ( 'task_id' ) ) ) : d [ 'task_id' ] = _attempt_id_to_task_id ( d [ 'attempt_id' ] )
if *d* has *attempt_id* but not *task_id* .