def batch_write_item(self, table_name, put_items=None, delete_items=None, return_consumed_capacity=None, return_item_collection_metrics=None):
    '\n        Performs the batch_write_item operation\n        '
    if ((put_items is None) and (delete_items is None)):
        raise ValueError('Either put_items or delete_items must be specified')
    operation_kwargs = {REQUEST_ITEMS: {table_name: []}}
    if return_consumed_capacity:
        operation_kwargs.update(self.get_consumed_capacity_map(return_consumed_capacity))
    if return_item_collection_metrics:
        operation_kwargs.update(self.get_item_collection_map(return_item_collection_metrics))
    put_items_list = []
    if put_items:
        for item in put_items:
            put_items_list.append({PUT_REQUEST: self.get_item_attribute_map(table_name, item, pythonic_key=False)})
    delete_items_list = []
    if delete_items:
        for item in delete_items:
            delete_items_list.append({DELETE_REQUEST: self.get_item_attribute_map(table_name, item, item_key=KEY, pythonic_key=False)})
    operation_kwargs[REQUEST_ITEMS][table_name] = (delete_items_list + put_items_list)
    try:
        return self.dispatch(BATCH_WRITE_ITEM, operation_kwargs)
    except BOTOCORE_EXCEPTIONS as e:
        raise PutError('Failed to batch write items: {0}'.format(e), e)
Performs the batch_write_item operation
def batch_write_item(self, table_name, put_items=None, delete_items=None, return_consumed_capacity=None, return_item_collection_metrics=None):
    '\n        \n        '
    if ((put_items is None) and (delete_items is None)):
        raise ValueError('Either put_items or delete_items must be specified')
    operation_kwargs = {REQUEST_ITEMS: {table_name: []}}
    if return_consumed_capacity:
        operation_kwargs.update(self.get_consumed_capacity_map(return_consumed_capacity))
    if return_item_collection_metrics:
        operation_kwargs.update(self.get_item_collection_map(return_item_collection_metrics))
    put_items_list = []
    if put_items:
        for item in put_items:
            put_items_list.append({PUT_REQUEST: self.get_item_attribute_map(table_name, item, pythonic_key=False)})
    delete_items_list = []
    if delete_items:
        for item in delete_items:
            delete_items_list.append({DELETE_REQUEST: self.get_item_attribute_map(table_name, item, item_key=KEY, pythonic_key=False)})
    operation_kwargs[REQUEST_ITEMS][table_name] = (delete_items_list + put_items_list)
    try:
        return self.dispatch(BATCH_WRITE_ITEM, operation_kwargs)
    except BOTOCORE_EXCEPTIONS as e:
        raise PutError('Failed to batch write items: {0}'.format(e), e)