nodes: 0, module; 1, function_definition; 2, function_name:list_packets; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, if_statement; 15, if_statement; 16, if_statement; 17, return_statement; 18, identifier:name; 19, None; 20, identifier:start; 21, None; 22, identifier:stop; 23, None; 24, identifier:page_size; 25, integer:500; 26, identifier:descending; 27, False; 28, comment:"""
          Reads packet information between the specified start and stop
          time.
  
          Packets are sorted by generation time and sequence number.
  
          :param ~datetime.datetime start: Minimum generation time of the returned
                                           packets (inclusive)
          :param ~datetime.datetime stop: Maximum genreation time of the returned
                                          packets (exclusive)
          :param int page_size: Page size of underlying requests. Higher values imply
                                less overhead, but risk hitting the maximum message size limit.
          :param bool descending: If set to ``True`` packets are fetched in reverse
                                  order (most recent first).
          :rtype: ~collections.Iterable[.Packet]
          """; 29, assignment; 30, comparison_operator:name is not None; 31, block; 32, comparison_operator:page_size is not None; 33, block; 34, comparison_operator:start is not None; 35, block; 36, comparison_operator:stop is not None; 37, block; 38, call; 39, identifier:params; 40, dictionary; 41, identifier:name; 42, None; 43, expression_statement; 44, identifier:page_size; 45, None; 46, expression_statement; 47, identifier:start; 48, None; 49, expression_statement; 50, identifier:stop; 51, None; 52, expression_statement; 53, attribute; 54, argument_list; 55, pair; 56, assignment; 57, assignment; 58, assignment; 59, assignment; 60, identifier:pagination; 61, identifier:Iterator; 62, keyword_argument; 63, keyword_argument; 64, keyword_argument; 65, keyword_argument; 66, keyword_argument; 67, keyword_argument; 68, string; 69, conditional_expression:'desc' if descending else 'asc'; 70, subscript; 71, identifier:name; 72, subscript; 73, identifier:page_size; 74, subscript; 75, call; 76, subscript; 77, call; 78, identifier:client; 79, attribute; 80, identifier:path; 81, call; 82, identifier:params; 83, identifier:params; 84, identifier:response_class; 85, attribute; 86, identifier:items_key; 87, string; 88, identifier:item_mapper; 89, identifier:Packet; 90, string_content:order; 91, string; 92, identifier:descending; 93, string; 94, identifier:params; 95, string; 96, identifier:params; 97, string; 98, identifier:params; 99, string; 100, identifier:to_isostring; 101, argument_list; 102, identifier:params; 103, string; 104, identifier:to_isostring; 105, argument_list; 106, identifier:self; 107, identifier:_client; 108, attribute; 109, argument_list; 110, identifier:rest_pb2; 111, identifier:ListPacketsResponse; 112, string_content:packet; 113, string_content:desc; 114, string_content:asc; 115, string_content:name; 116, string_content:limit; 117, string_content:start; 118, identifier:start; 119, string_content:stop; 120, identifier:stop; 121, string; 122, identifier:format; 123, attribute; 124, string_content:/archive/{}/packets; 125, identifier:self; 126, identifier:_instance
code: def list_packets(self, name=None, start=None, stop=None, page_size=500, descending=False):
          """
          Reads packet information between the specified start and stop
          time.
  
          Packets are sorted by generation time and sequence number.
  
          :param ~datetime.datetime start: Minimum generation time of the returned
                                           packets (inclusive)
          :param ~datetime.datetime stop: Maximum genreation time of the returned
                                          packets (exclusive)
          :param int page_size: Page size of underlying requests. Higher values imply
                                less overhead, but risk hitting the maximum message size limit.
          :param bool descending: If set to ``True`` packets are fetched in reverse
                                  order (most recent first).
          :rtype: ~collections.Iterable[.Packet]
          """
          params = {
              'order': 'desc' if descending else 'asc',
          }
          if name is not None:
              params['name'] = name
          if page_size is not None:
              params['limit'] = page_size
          if start is not None:
              params['start'] = to_isostring(start)
          if stop is not None:
              params['stop'] = to_isostring(stop)
  
          return pagination.Iterator(
              client=self._client,
              path='/archive/{}/packets'.format(self._instance),
              params=params,
              response_class=rest_pb2.ListPacketsResponse,
              items_key='packet',
              item_mapper=Packet,
          )