nodes: 0, module; 1, function_definition; 2, function_name:query; 3, parameters; 4, block; 5, identifier:self; 6, identifier:table_name; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, default_parameter; 17, default_parameter; 18, default_parameter; 19, expression_statement; 20, expression_statement; 21, if_statement; 22, if_statement; 23, if_statement; 24, if_statement; 25, if_statement; 26, if_statement; 27, if_statement; 28, if_statement; 29, if_statement; 30, if_statement; 31, if_statement; 32, return_statement; 33, identifier:index_name; 34, None; 35, identifier:consistent_read; 36, None; 37, identifier:key_condition_expression; 38, None; 39, identifier:filter_expression; 40, None; 41, identifier:expression_attribute_names; 42, None; 43, identifier:expression_attribute_values; 44, None; 45, identifier:projection_expression; 46, None; 47, identifier:select; 48, None; 49, identifier:exclusive_start_key; 50, None; 51, identifier:limit; 52, None; 53, identifier:scan_index_forward; 54, True; 55, identifier:return_consumed_capacity; 56, None; 57, comment:"""A `Query`_ operation uses the primary key of a table or a secondary
          index to directly access items from that table or index.
  
          :param str table_name: The name of the table containing the requested
              items.
          :param bool consistent_read: Determines the read consistency model: If
              set to ``True``, then the operation uses strongly consistent reads;
              otherwise, the operation uses eventually consistent reads. Strongly
              consistent reads are not supported on global secondary indexes. If
              you query a global secondary index with ``consistent_read`` set to
              ``True``, you will receive a
              :exc:`~sprockets_dynamodb.exceptions.ValidationException`.
          :param dict exclusive_start_key: The primary key of the first
              item that this operation will evaluate. Use the value that was
              returned for ``LastEvaluatedKey`` in the previous operation. In a
              parallel scan, a *Scan* request that includes
              ``exclusive_start_key`` must specify the same segment whose
              previous *Scan* returned the corresponding value of
              ``LastEvaluatedKey``.
          :param dict expression_attribute_names: One or more substitution tokens
              for attribute names in an expression.
          :param dict expression_attribute_values: One or more values that can be
              substituted in an expression.
          :param str key_condition_expression: The condition that specifies the
              key value(s) for items to be retrieved by the *Query* action. The
              condition must perform an equality test on a single partition key
              value, but can optionally perform one of several comparison tests
              on a single sort key value. The partition key equality test is
              required. For examples see `KeyConditionExpression
              <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
              Query.html#Query.KeyConditionExpressions>.
          :param str filter_expression: A string that contains conditions that
              DynamoDB applies after the *Query* operation, but before the data
              is returned to you. Items that do not satisfy the criteria are not
              returned. Note that a filter expression is applied after the items
              have already been read; the process of filtering does not consume
              any additional read capacity units. For more information, see
              `Filter Expressions <http://docs.aws.amazon.com/amazondynamodb/
              latest/developerguide/QueryAndScan.html#FilteringResults>`_ in the
              Amazon DynamoDB Developer Guide.
          :param str projection_expression:
          :param str index_name: The name of a secondary index to query. This
              index can be any local secondary index or global secondary index.
              Note that if you use this parameter, you must also provide
              ``table_name``.
          :param int limit: The maximum number of items to evaluate (not
              necessarily the number of matching items). If DynamoDB processes
              the number of items up to the limit while processing the results,
              it stops the operation and returns the matching values up to that
              point, and a key in ``LastEvaluatedKey`` to apply in a subsequent
              operation, so that you can pick up where you left off. Also, if the
              processed data set size exceeds 1 MB before DynamoDB reaches this
              limit, it stops the operation and returns the matching values up to
              the limit, and a key in ``LastEvaluatedKey`` to apply in a
              subsequent operation to continue the operation. For more
              information, see `Query and Scan <http://docs.aws.amazon.com/amazo
              ndynamodb/latest/developerguide/QueryAndScan.html>`_ in the Amazon
              DynamoDB Developer Guide.
          :param str return_consumed_capacity: Determines the level of detail
              about provisioned throughput consumption that is returned in the
              response:
  
                - ``INDEXES``: The response includes the aggregate consumed
                  capacity for the operation, together with consumed capacity for
                  each table and secondary index that was accessed. Note that
                  some operations, such as *GetItem* and *BatchGetItem*, do not
                  access any indexes at all. In these cases, specifying
                  ``INDEXES`` will only return consumed capacity information for
                  table(s).
                - ``TOTAL``: The response includes only the aggregate consumed
                  capacity for the operation.
                - ``NONE``: No consumed capacity details are included in the
                  response.
          :param bool scan_index_forward: Specifies the order for index
              traversal: If ``True`` (default), the traversal is performed in
              ascending order; if ``False``, the traversal is performed in
              descending order. Items with the same partition key value are
              stored in sorted order by sort key. If the sort key data type is
              *Number*, the results are stored in numeric order. For type
              *String*, the results are stored in order of ASCII character code
              values. For type *Binary*, DynamoDB treats each byte of the binary
              data as unsigned. If set to ``True``, DynamoDB returns the results
              in the order in which they are stored (by sort key value). This is
              the default behavior. If set to ``False``, DynamoDB reads the
              results in reverse order by sort key value, and then returns the
              results to the client.
          :param str select: The attributes to be returned in the result. You can
              retrieve all item attributes, specific item attributes, the count
              of matching items, or in the case of an index, some or all of the
              attributes projected into the index. Possible values are:
  
                - ``ALL_ATTRIBUTES``: Returns all of the item attributes from the
                  specified table or index. If you query a local secondary index,
                  then for each matching item in the index DynamoDB will fetch
                  the entire item from the parent table. If the index is
                  configured to project all item attributes, then all of the data
                  can be obtained from the local secondary index, and no fetching
                  is required.
                - ``ALL_PROJECTED_ATTRIBUTES``: Allowed only when querying an
                  index. Retrieves all attributes that have been projected into
                  the index. If the index is configured to project all
                  attributes, this return value is equivalent to specifying
                  ``ALL_ATTRIBUTES``.
                - ``COUNT``: Returns the number of matching items, rather than
                  the matching items themselves.
          :rtype: dict
  
          .. _Query: http://docs.aws.amazon.com/amazondynamodb/
             latest/APIReference/API_Query.html
  
          """; 58, assignment; 59, identifier:index_name; 60, block; 61, comparison_operator:consistent_read is not None; 62, block; 63, identifier:key_condition_expression; 64, block; 65, identifier:filter_expression; 66, block; 67, identifier:expression_attribute_names; 68, block; 69, identifier:expression_attribute_values; 70, block; 71, identifier:projection_expression; 72, block; 73, identifier:select; 74, block; 75, identifier:exclusive_start_key; 76, block; 77, identifier:limit; 78, block; 79, identifier:return_consumed_capacity; 80, block; 81, call; 82, identifier:payload; 83, dictionary; 84, expression_statement; 85, identifier:consistent_read; 86, None; 87, expression_statement; 88, expression_statement; 89, expression_statement; 90, expression_statement; 91, expression_statement; 92, expression_statement; 93, expression_statement; 94, expression_statement; 95, expression_statement; 96, expression_statement; 97, expression_statement; 98, expression_statement; 99, attribute; 100, argument_list; 101, pair; 102, pair; 103, assignment; 104, assignment; 105, assignment; 106, assignment; 107, assignment; 108, assignment; 109, assignment; 110, call; 111, assignment; 112, assignment; 113, assignment; 114, call; 115, assignment; 116, identifier:self; 117, identifier:execute; 118, string; 119, identifier:payload; 120, string; 121, identifier:table_name; 122, string; 123, identifier:scan_index_forward; 124, subscript; 125, identifier:index_name; 126, subscript; 127, identifier:consistent_read; 128, subscript; 129, identifier:key_condition_expression; 130, subscript; 131, identifier:filter_expression; 132, subscript; 133, identifier:expression_attribute_names; 134, subscript; 135, line_continuation:\; 136, call; 137, subscript; 138, identifier:projection_expression; 139, identifier:_validate_select; 140, argument_list; 141, subscript; 142, identifier:select; 143, subscript; 144, call; 145, subscript; 146, identifier:limit; 147, identifier:_validate_return_consumed_capacity; 148, argument_list; 149, subscript; 150, identifier:return_consumed_capacity; 151, string_content:Query; 152, string_content:TableName; 153, string_content:ScanIndexForward; 154, identifier:payload; 155, string; 156, identifier:payload; 157, string; 158, identifier:payload; 159, string; 160, identifier:payload; 161, string; 162, identifier:payload; 163, string; 164, identifier:payload; 165, string; 166, attribute; 167, argument_list; 168, identifier:payload; 169, string; 170, identifier:select; 171, identifier:payload; 172, string; 173, identifier:payload; 174, string; 175, attribute; 176, argument_list; 177, identifier:payload; 178, string; 179, identifier:return_consumed_capacity; 180, identifier:payload; 181, string; 182, string_content:IndexName; 183, string_content:ConsistentRead; 184, string_content:KeyConditionExpression; 185, string_content:FilterExpression; 186, string_content:ExpressionAttributeNames; 187, string_content:ExpressionAttributeValues; 188, identifier:utils; 189, identifier:marshall; 190, identifier:expression_attribute_values; 191, string_content:ProjectionExpression; 192, string_content:Select; 193, string_content:ExclusiveStartKey; 194, identifier:utils; 195, identifier:marshall; 196, identifier:exclusive_start_key; 197, string_content:Limit; 198, string_content:ReturnConsumedCapacity
code: def query(self, table_name,
                index_name=None,
                consistent_read=None,
                key_condition_expression=None,
                filter_expression=None,
                expression_attribute_names=None,
                expression_attribute_values=None,
                projection_expression=None,
                select=None,
                exclusive_start_key=None,
                limit=None,
                scan_index_forward=True,
                return_consumed_capacity=None):
          """A `Query`_ operation uses the primary key of a table or a secondary
          index to directly access items from that table or index.
  
          :param str table_name: The name of the table containing the requested
              items.
          :param bool consistent_read: Determines the read consistency model: If
              set to ``True``, then the operation uses strongly consistent reads;
              otherwise, the operation uses eventually consistent reads. Strongly
              consistent reads are not supported on global secondary indexes. If
              you query a global secondary index with ``consistent_read`` set to
              ``True``, you will receive a
              :exc:`~sprockets_dynamodb.exceptions.ValidationException`.
          :param dict exclusive_start_key: The primary key of the first
              item that this operation will evaluate. Use the value that was
              returned for ``LastEvaluatedKey`` in the previous operation. In a
              parallel scan, a *Scan* request that includes
              ``exclusive_start_key`` must specify the same segment whose
              previous *Scan* returned the corresponding value of
              ``LastEvaluatedKey``.
          :param dict expression_attribute_names: One or more substitution tokens
              for attribute names in an expression.
          :param dict expression_attribute_values: One or more values that can be
              substituted in an expression.
          :param str key_condition_expression: The condition that specifies the
              key value(s) for items to be retrieved by the *Query* action. The
              condition must perform an equality test on a single partition key
              value, but can optionally perform one of several comparison tests
              on a single sort key value. The partition key equality test is
              required. For examples see `KeyConditionExpression
              <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
              Query.html#Query.KeyConditionExpressions>.
          :param str filter_expression: A string that contains conditions that
              DynamoDB applies after the *Query* operation, but before the data
              is returned to you. Items that do not satisfy the criteria are not
              returned. Note that a filter expression is applied after the items
              have already been read; the process of filtering does not consume
              any additional read capacity units. For more information, see
              `Filter Expressions <http://docs.aws.amazon.com/amazondynamodb/
              latest/developerguide/QueryAndScan.html#FilteringResults>`_ in the
              Amazon DynamoDB Developer Guide.
          :param str projection_expression:
          :param str index_name: The name of a secondary index to query. This
              index can be any local secondary index or global secondary index.
              Note that if you use this parameter, you must also provide
              ``table_name``.
          :param int limit: The maximum number of items to evaluate (not
              necessarily the number of matching items). If DynamoDB processes
              the number of items up to the limit while processing the results,
              it stops the operation and returns the matching values up to that
              point, and a key in ``LastEvaluatedKey`` to apply in a subsequent
              operation, so that you can pick up where you left off. Also, if the
              processed data set size exceeds 1 MB before DynamoDB reaches this
              limit, it stops the operation and returns the matching values up to
              the limit, and a key in ``LastEvaluatedKey`` to apply in a
              subsequent operation to continue the operation. For more
              information, see `Query and Scan <http://docs.aws.amazon.com/amazo
              ndynamodb/latest/developerguide/QueryAndScan.html>`_ in the Amazon
              DynamoDB Developer Guide.
          :param str return_consumed_capacity: Determines the level of detail
              about provisioned throughput consumption that is returned in the
              response:
  
                - ``INDEXES``: The response includes the aggregate consumed
                  capacity for the operation, together with consumed capacity for
                  each table and secondary index that was accessed. Note that
                  some operations, such as *GetItem* and *BatchGetItem*, do not
                  access any indexes at all. In these cases, specifying
                  ``INDEXES`` will only return consumed capacity information for
                  table(s).
                - ``TOTAL``: The response includes only the aggregate consumed
                  capacity for the operation.
                - ``NONE``: No consumed capacity details are included in the
                  response.
          :param bool scan_index_forward: Specifies the order for index
              traversal: If ``True`` (default), the traversal is performed in
              ascending order; if ``False``, the traversal is performed in
              descending order. Items with the same partition key value are
              stored in sorted order by sort key. If the sort key data type is
              *Number*, the results are stored in numeric order. For type
              *String*, the results are stored in order of ASCII character code
              values. For type *Binary*, DynamoDB treats each byte of the binary
              data as unsigned. If set to ``True``, DynamoDB returns the results
              in the order in which they are stored (by sort key value). This is
              the default behavior. If set to ``False``, DynamoDB reads the
              results in reverse order by sort key value, and then returns the
              results to the client.
          :param str select: The attributes to be returned in the result. You can
              retrieve all item attributes, specific item attributes, the count
              of matching items, or in the case of an index, some or all of the
              attributes projected into the index. Possible values are:
  
                - ``ALL_ATTRIBUTES``: Returns all of the item attributes from the
                  specified table or index. If you query a local secondary index,
                  then for each matching item in the index DynamoDB will fetch
                  the entire item from the parent table. If the index is
                  configured to project all item attributes, then all of the data
                  can be obtained from the local secondary index, and no fetching
                  is required.
                - ``ALL_PROJECTED_ATTRIBUTES``: Allowed only when querying an
                  index. Retrieves all attributes that have been projected into
                  the index. If the index is configured to project all
                  attributes, this return value is equivalent to specifying
                  ``ALL_ATTRIBUTES``.
                - ``COUNT``: Returns the number of matching items, rather than
                  the matching items themselves.
          :rtype: dict
  
          .. _Query: http://docs.aws.amazon.com/amazondynamodb/
             latest/APIReference/API_Query.html
  
          """
          payload = {'TableName': table_name,
                     'ScanIndexForward': scan_index_forward}
          if index_name:
              payload['IndexName'] = index_name
          if consistent_read is not None:
              payload['ConsistentRead'] = consistent_read
          if key_condition_expression:
              payload['KeyConditionExpression'] = key_condition_expression
          if filter_expression:
              payload['FilterExpression'] = filter_expression
          if expression_attribute_names:
              payload['ExpressionAttributeNames'] = expression_attribute_names
          if expression_attribute_values:
              payload['ExpressionAttributeValues'] = \
                  utils.marshall(expression_attribute_values)
          if projection_expression:
              payload['ProjectionExpression'] = projection_expression
          if select:
              _validate_select(select)
              payload['Select'] = select
          if exclusive_start_key:
              payload['ExclusiveStartKey'] = utils.marshall(exclusive_start_key)
          if limit:
              payload['Limit'] = limit
          if return_consumed_capacity:
              _validate_return_consumed_capacity(return_consumed_capacity)
              payload['ReturnConsumedCapacity'] = return_consumed_capacity
          return self.execute('Query', payload)