nodes: 0, module; 1, function_definition; 2, function_name:tasks; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, expression_statement; 15, expression_statement; 16, for_statement; 17, identifier:pattern; 18, None; 19, identifier:negate; 20, False; 21, identifier:state; 22, None; 23, identifier:limit; 24, None; 25, identifier:reverse; 26, True; 27, identifier:params; 28, None; 29, identifier:success; 30, False; 31, identifier:error; 32, True; 33, comment:"""Filters stored tasks and displays their current statuses.
  
          Note that, to be able to list the tasks sorted chronologically, celery retrieves
          tasks from the LRU event heap instead of the dict storage, so the total number
          of tasks fetched may be different than the server `max_tasks` setting. For
          instance, the `limit` field refers to max events searched, not max tasks.
  
          Args:
              Filter args:
  
              pattern (Optional[str]): a pattern to filter tasks
                  ex.: '^dispatch|^email' to filter names starting with that
                        or 'dispatch.*123456' to filter that exact name and number
                        or even '123456' to filter that exact number anywhere.
              negate (bool): if True, finds tasks that do not match criteria
              state (Optional[str]): a celery task state to filter
              limit (int): the maximum number of events to fetch
                  if None or 0, fetches all.
              reverse (bool): if True (default), shows the most recent first
  
              Display args:
  
              params (Optional[bool]): if True shows args and kwargs in the first and
                  last seen states, if False never shows, and if None follows the
                  success and error arguments.
                  default is None
              success (bool): if True shows successful tasks' results
                  default is False
              error (bool): if True shows failed and retried tasks' tracebacks.
                  default is True, as you're monitoring to find errors, right?
          """; 34, assignment; 35, identifier:task; 36, call; 37, block; 38, identifier:request; 39, call; 40, identifier:about_time; 41, argument_list; 42, expression_statement; 43, attribute; 44, argument_list; 45, attribute; 46, call; 47, call; 48, identifier:clearly_pb2; 49, identifier:FilterTasksRequest; 50, keyword_argument; 51, keyword_argument; 52, keyword_argument; 53, keyword_argument; 54, identifier:ClearlyClient; 55, identifier:_fetched_callback; 56, attribute; 57, argument_list; 58, attribute; 59, argument_list; 60, identifier:tasks_filter; 61, call; 62, identifier:state_pattern; 63, boolean_operator; 64, identifier:limit; 65, identifier:limit; 66, identifier:reverse; 67, identifier:reverse; 68, attribute; 69, identifier:filter_tasks; 70, identifier:request; 71, identifier:ClearlyClient; 72, identifier:_display_task; 73, identifier:task; 74, identifier:params; 75, identifier:success; 76, identifier:error; 77, attribute; 78, argument_list; 79, identifier:state; 80, string; 81, identifier:self; 82, identifier:_stub; 83, identifier:clearly_pb2; 84, identifier:PatternFilter; 85, keyword_argument; 86, keyword_argument; 87, string_content:.; 88, identifier:pattern; 89, boolean_operator; 90, identifier:negate; 91, identifier:negate; 92, identifier:pattern; 93, string; 94, string_content:.
code: def tasks(self, pattern=None, negate=False, state=None, limit=None, reverse=True,
                params=None, success=False, error=True):
          """Filters stored tasks and displays their current statuses.
  
          Note that, to be able to list the tasks sorted chronologically, celery retrieves
          tasks from the LRU event heap instead of the dict storage, so the total number
          of tasks fetched may be different than the server `max_tasks` setting. For
          instance, the `limit` field refers to max events searched, not max tasks.
  
          Args:
              Filter args:
  
              pattern (Optional[str]): a pattern to filter tasks
                  ex.: '^dispatch|^email' to filter names starting with that
                        or 'dispatch.*123456' to filter that exact name and number
                        or even '123456' to filter that exact number anywhere.
              negate (bool): if True, finds tasks that do not match criteria
              state (Optional[str]): a celery task state to filter
              limit (int): the maximum number of events to fetch
                  if None or 0, fetches all.
              reverse (bool): if True (default), shows the most recent first
  
              Display args:
  
              params (Optional[bool]): if True shows args and kwargs in the first and
                  last seen states, if False never shows, and if None follows the
                  success and error arguments.
                  default is None
              success (bool): if True shows successful tasks' results
                  default is False
              error (bool): if True shows failed and retried tasks' tracebacks.
                  default is True, as you're monitoring to find errors, right?
          """
          request = clearly_pb2.FilterTasksRequest(
              tasks_filter=clearly_pb2.PatternFilter(pattern=pattern or '.',
                                                     negate=negate),
              state_pattern=state or '.', limit=limit, reverse=reverse
          )
  
          for task in about_time(ClearlyClient._fetched_callback, self._stub.filter_tasks(request)):
              ClearlyClient._display_task(task, params, success, error)