def query(self, table_name, hash_key, range_key_condition=None, filter_condition=None, attributes_to_get=None, consistent_read=False, exclusive_start_key=None, index_name=None, key_conditions=None, query_filters=None, conditional_operator=None, limit=None, return_consumed_capacity=None, scan_index_forward=None, select=None):
    '\n        Performs the Query operation and returns the result\n        '
    self._check_condition('range_key_condition', range_key_condition, key_conditions, conditional_operator)
    self._check_condition('filter_condition', filter_condition, query_filters, conditional_operator)
    operation_kwargs = {TABLE_NAME: table_name}
    name_placeholders = {}
    expression_attribute_values = {}
    tbl = self.get_meta_table(table_name)
    if (tbl is None):
        raise TableError('No such table: {0}'.format(table_name))
    if index_name:
        hash_keyname = tbl.get_index_hash_keyname(index_name)
        if (not hash_keyname):
            raise ValueError('No hash key attribute for index: {0}'.format(index_name))
        range_keyname = tbl.get_index_range_keyname(index_name)
    else:
        hash_keyname = tbl.hash_keyname
        range_keyname = tbl.range_keyname
    key_condition = self._get_condition(table_name, hash_keyname, '__eq__', hash_key)
    if (range_key_condition is not None):
        if range_key_condition.is_valid_range_key_condition(range_keyname):
            key_condition = (key_condition & range_key_condition)
        elif (filter_condition is None):
            (filter_condition, range_key_condition) = (range_key_condition, None)
        else:
            raise ValueError('{0} is not a valid range key condition'.format(range_key_condition))
    if ((key_conditions is None) or (len(key_conditions) == 0)):
        pass
    elif (len(key_conditions) > 1):
        raise ValueError('Multiple attributes are not supported in key_conditions: {0}'.format(key_conditions))
    else:
        ((key, condition),) = key_conditions.items()
        operator = condition.get(COMPARISON_OPERATOR)
        if (operator not in COMPARISON_OPERATOR_VALUES):
            raise ValueError('{0} must be one of {1}'.format(COMPARISON_OPERATOR, COMPARISON_OPERATOR_VALUES))
        operator = KEY_CONDITION_OPERATOR_MAP[operator]
        values = condition.get(ATTR_VALUE_LIST)
        sort_key_expression = self._get_condition(table_name, key, operator, *values)
        key_condition = (key_condition & sort_key_expression)
    operation_kwargs[KEY_CONDITION_EXPRESSION] = key_condition.serialize(name_placeholders, expression_attribute_values)
    if (filter_condition is not None):
        filter_expression = filter_condition.serialize(name_placeholders, expression_attribute_values)
        hash_key_placeholder = name_placeholders.get(hash_keyname)
        range_key_placeholder = (range_keyname and name_placeholders.get(range_keyname))
        if ((hash_key_placeholder in filter_expression) or (range_key_placeholder and (range_key_placeholder in filter_expression))):
            raise ValueError("'filter_condition' cannot contain key attributes")
        operation_kwargs[FILTER_EXPRESSION] = filter_expression
    if attributes_to_get:
        projection_expression = create_projection_expression(attributes_to_get, name_placeholders)
        operation_kwargs[PROJECTION_EXPRESSION] = projection_expression
    if consistent_read:
        operation_kwargs[CONSISTENT_READ] = True
    if exclusive_start_key:
        operation_kwargs.update(self.get_exclusive_start_key_map(table_name, exclusive_start_key))
    if index_name:
        operation_kwargs[INDEX_NAME] = index_name
    if (limit is not None):
        operation_kwargs[LIMIT] = limit
    if return_consumed_capacity:
        operation_kwargs.update(self.get_consumed_capacity_map(return_consumed_capacity))
    conditional_operator = self.get_conditional_operator((conditional_operator or AND))
    if query_filters:
        filter_expression = self._get_filter_expression(table_name, query_filters, conditional_operator, name_placeholders, expression_attribute_values)
        operation_kwargs[FILTER_EXPRESSION] = filter_expression
    if select:
        if (select.upper() not in SELECT_VALUES):
            raise ValueError('{0} must be one of {1}'.format(SELECT, SELECT_VALUES))
        operation_kwargs[SELECT] = str(select).upper()
    if (scan_index_forward is not None):
        operation_kwargs[SCAN_INDEX_FORWARD] = scan_index_forward
    if name_placeholders:
        operation_kwargs[EXPRESSION_ATTRIBUTE_NAMES] = self._reverse_dict(name_placeholders)
    if expression_attribute_values:
        operation_kwargs[EXPRESSION_ATTRIBUTE_VALUES] = expression_attribute_values
    try:
        return self.dispatch(QUERY, operation_kwargs)
    except BOTOCORE_EXCEPTIONS as e:
        raise QueryError('Failed to query items: {0}'.format(e), e)
Performs the Query operation and returns the result
def query(self, table_name, hash_key, range_key_condition=None, filter_condition=None, attributes_to_get=None, consistent_read=False, exclusive_start_key=None, index_name=None, key_conditions=None, query_filters=None, conditional_operator=None, limit=None, return_consumed_capacity=None, scan_index_forward=None, select=None):
    '\n        \n        '
    self._check_condition('range_key_condition', range_key_condition, key_conditions, conditional_operator)
    self._check_condition('filter_condition', filter_condition, query_filters, conditional_operator)
    operation_kwargs = {TABLE_NAME: table_name}
    name_placeholders = {}
    expression_attribute_values = {}
    tbl = self.get_meta_table(table_name)
    if (tbl is None):
        raise TableError('No such table: {0}'.format(table_name))
    if index_name:
        hash_keyname = tbl.get_index_hash_keyname(index_name)
        if (not hash_keyname):
            raise ValueError('No hash key attribute for index: {0}'.format(index_name))
        range_keyname = tbl.get_index_range_keyname(index_name)
    else:
        hash_keyname = tbl.hash_keyname
        range_keyname = tbl.range_keyname
    key_condition = self._get_condition(table_name, hash_keyname, '__eq__', hash_key)
    if (range_key_condition is not None):
        if range_key_condition.is_valid_range_key_condition(range_keyname):
            key_condition = (key_condition & range_key_condition)
        elif (filter_condition is None):
            (filter_condition, range_key_condition) = (range_key_condition, None)
        else:
            raise ValueError('{0} is not a valid range key condition'.format(range_key_condition))
    if ((key_conditions is None) or (len(key_conditions) == 0)):
        pass
    elif (len(key_conditions) > 1):
        raise ValueError('Multiple attributes are not supported in key_conditions: {0}'.format(key_conditions))
    else:
        ((key, condition),) = key_conditions.items()
        operator = condition.get(COMPARISON_OPERATOR)
        if (operator not in COMPARISON_OPERATOR_VALUES):
            raise ValueError('{0} must be one of {1}'.format(COMPARISON_OPERATOR, COMPARISON_OPERATOR_VALUES))
        operator = KEY_CONDITION_OPERATOR_MAP[operator]
        values = condition.get(ATTR_VALUE_LIST)
        sort_key_expression = self._get_condition(table_name, key, operator, *values)
        key_condition = (key_condition & sort_key_expression)
    operation_kwargs[KEY_CONDITION_EXPRESSION] = key_condition.serialize(name_placeholders, expression_attribute_values)
    if (filter_condition is not None):
        filter_expression = filter_condition.serialize(name_placeholders, expression_attribute_values)
        hash_key_placeholder = name_placeholders.get(hash_keyname)
        range_key_placeholder = (range_keyname and name_placeholders.get(range_keyname))
        if ((hash_key_placeholder in filter_expression) or (range_key_placeholder and (range_key_placeholder in filter_expression))):
            raise ValueError("'filter_condition' cannot contain key attributes")
        operation_kwargs[FILTER_EXPRESSION] = filter_expression
    if attributes_to_get:
        projection_expression = create_projection_expression(attributes_to_get, name_placeholders)
        operation_kwargs[PROJECTION_EXPRESSION] = projection_expression
    if consistent_read:
        operation_kwargs[CONSISTENT_READ] = True
    if exclusive_start_key:
        operation_kwargs.update(self.get_exclusive_start_key_map(table_name, exclusive_start_key))
    if index_name:
        operation_kwargs[INDEX_NAME] = index_name
    if (limit is not None):
        operation_kwargs[LIMIT] = limit
    if return_consumed_capacity:
        operation_kwargs.update(self.get_consumed_capacity_map(return_consumed_capacity))
    conditional_operator = self.get_conditional_operator((conditional_operator or AND))
    if query_filters:
        filter_expression = self._get_filter_expression(table_name, query_filters, conditional_operator, name_placeholders, expression_attribute_values)
        operation_kwargs[FILTER_EXPRESSION] = filter_expression
    if select:
        if (select.upper() not in SELECT_VALUES):
            raise ValueError('{0} must be one of {1}'.format(SELECT, SELECT_VALUES))
        operation_kwargs[SELECT] = str(select).upper()
    if (scan_index_forward is not None):
        operation_kwargs[SCAN_INDEX_FORWARD] = scan_index_forward
    if name_placeholders:
        operation_kwargs[EXPRESSION_ATTRIBUTE_NAMES] = self._reverse_dict(name_placeholders)
    if expression_attribute_values:
        operation_kwargs[EXPRESSION_ATTRIBUTE_VALUES] = expression_attribute_values
    try:
        return self.dispatch(QUERY, operation_kwargs)
    except BOTOCORE_EXCEPTIONS as e:
        raise QueryError('Failed to query items: {0}'.format(e), e)