def _task_get(context, task_id, session=None, force_show_deleted=False):
 session = (session or get_session())
 query = session.query(models.Task).options(sa_orm.joinedload(models.Task.info)).filter_by(id=task_id)
 if ((not force_show_deleted) and (not context.can_see_deleted)):
  query = query.filter_by(deleted=False)
 try:
  task_ref = query.one()
 except sa_orm.exc.NoResultFound:
  LOG.debug('No task found with ID %s', task_id)
  raise exception.TaskNotFound(task_id=task_id)
 if (not _is_task_visible(context, task_ref)):
  msg = ('Forbidding request, task %s is not visible' % task_id)
  LOG.debug(msg)
  raise exception.Forbidden(msg)
 return task_ref

def _task_get ( context , task_id , session = None , force_show_deleted = False ) : session = ( session or get_session ( ) ) query = session . query ( models . Task ) . options ( sa_orm . joinedload ( models . Task . info ) ) . filter_by ( id = task_id ) if ( ( not force_show_deleted ) and ( not context . can_see_deleted ) ) : query = query . filter_by ( deleted = False ) try : task_ref = query . one ( ) except sa_orm . exc . NoResultFound : LOG . debug ( 'No task found with ID %s' , task_id ) raise exception . TaskNotFound ( task_id = task_id ) if ( not _is_task_visible ( context , task_ref ) ) : msg = ( 'Forbidding request, task %s is not visible' % task_id ) LOG . debug ( msg ) raise exception . Forbidden ( msg ) return task_ref
fetch a task entity by id .