parameters: (self, limit=None, details=True, category=None, owner=None,
                     offset=None, status=None, sample_id=None, not_status=None,
                     completed_after=None, order_by=None)
docstring: Retrieve list of task.
          @param limit: specify a limit of entries.
          @param details: if details about must be included
          @param category: filter by category
          @param owner: task owner
          @param offset: list offset
          @param status: filter by task status
          @param sample_id: filter tasks for a sample
          @param not_status: exclude this task status from filter
          @param completed_after: only list tasks completed after this timestamp
          @param order_by: definition which field to sort by
          @return: list of tasks.
docstring_summary: Retrieve list of task.
docstring_tokens: Retrieve list of task .
function: def list_tasks(self, limit=None, details=True, category=None, owner=None,
                     offset=None, status=None, sample_id=None, not_status=None,
                     completed_after=None, order_by=None):
          """Retrieve list of task.
          @param limit: specify a limit of entries.
          @param details: if details about must be included
          @param category: filter by category
          @param owner: task owner
          @param offset: list offset
          @param status: filter by task status
          @param sample_id: filter tasks for a sample
          @param not_status: exclude this task status from filter
          @param completed_after: only list tasks completed after this timestamp
          @param order_by: definition which field to sort by
          @return: list of tasks.
          """
          session = self.Session()
          try:
              search = session.query(Task)
  
              if status:
                  search = search.filter_by(status=status)
              if not_status:
                  search = search.filter(Task.status != not_status)
              if category:
                  search = search.filter_by(category=category)
              if owner:
                  search = search.filter_by(owner=owner)
              if details:
                  search = search.options(joinedload("guest"), joinedload("errors"), joinedload("tags"))
              if sample_id is not None:
                  search = search.filter_by(sample_id=sample_id)
              if completed_after:
                  search = search.filter(Task.completed_on > completed_after)
  
              if order_by is not None:
                  search = search.order_by(order_by)
              else:
                  search = search.order_by(Task.added_on.desc())
  
              tasks = search.limit(limit).offset(offset).all()
              return tasks
          except SQLAlchemyError as e:
              log.exception("Database error listing tasks: {0}".format(e))
              return []
          finally:
              session.close()
function_tokens: def list_tasks ( self , limit = None , details = True , category = None , owner = None , offset = None , status = None , sample_id = None , not_status = None , completed_after = None , order_by = None ) : session = self . Session ( ) try : search = session . query ( Task ) if status : search = search . filter_by ( status = status ) if not_status : search = search . filter ( Task . status != not_status ) if category : search = search . filter_by ( category = category ) if owner : search = search . filter_by ( owner = owner ) if details : search = search . options ( joinedload ( "guest" ) , joinedload ( "errors" ) , joinedload ( "tags" ) ) if sample_id is not None : search = search . filter_by ( sample_id = sample_id ) if completed_after : search = search . filter ( Task . completed_on > completed_after ) if order_by is not None : search = search . order_by ( order_by ) else : search = search . order_by ( Task . added_on . desc ( ) ) tasks = search . limit ( limit ) . offset ( offset ) . all ( ) return tasks except SQLAlchemyError as e : log . exception ( "Database error listing tasks: {0}" . format ( e ) ) return [ ] finally : session . close ( )