nodes: 0, module; 1, function_definition; 2, function_name:update_item; 3, parameters; 4, block; 5, identifier:self; 6, identifier:table_name; 7, identifier:key_dict; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, expression_statement; 16, expression_statement; 17, if_statement; 18, if_statement; 19, if_statement; 20, if_statement; 21, if_statement; 22, if_statement; 23, return_statement; 24, identifier:condition_expression; 25, None; 26, identifier:update_expression; 27, None; 28, identifier:expression_attribute_names; 29, None; 30, identifier:expression_attribute_values; 31, None; 32, identifier:return_consumed_capacity; 33, None; 34, identifier:return_item_collection_metrics; 35, None; 36, identifier:return_values; 37, None; 38, comment:"""Invoke the `UpdateItem`_ function.
  
          Edits an existing item's attributes, or adds a new item to the table
          if it does not already exist. You can put, delete, or add attribute
          values. You can also perform a conditional update on an existing item
          (insert a new attribute name-value pair if it doesn't exist, or replace
          an existing name-value pair if it has certain expected attribute
          values).
  
          :param str table_name: The name of the table that contains the item to
              update
          :param dict key_dict: A dictionary of key/value pairs that are used to
              define the primary key values for the item. For the primary key,
              you must provide all of the attributes. For example, with a simple
              primary key, you only need to provide a value for the partition
              key. For a composite primary key, you must provide values for both
              the partition key and the sort key.
          :param str condition_expression: A condition that must be satisfied in
              order for a conditional *UpdateItem* operation to succeed. One of:
              ``attribute_exists``, ``attribute_not_exists``, ``attribute_type``,
              ``contains``, ``begins_with``, ``size``, ``=``, ``<>``, ``<``,
              ``>``, ``<=``, ``>=``, ``BETWEEN``, ``IN``, ``AND``, ``OR``, or
              ``NOT``.
          :param str update_expression: An expression that defines one or more
              attributes to be updated, the action to be performed on them, and
              new value(s) for them.
          :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 return_consumed_capacity: Determines the level of detail
              about provisioned throughput consumption that is returned in the
              response. See the `AWS documentation
              for ReturnConsumedCapacity <http://docs.aws.amazon.com/
              amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-Update
              Item-request-ReturnConsumedCapacity>`_ for more information.
          :param str return_item_collection_metrics: Determines whether item
              collection metrics are returned.
          :param str return_values: Use ReturnValues if you want to get the item
              attributes as they appeared either before or after they were
              updated. See the `AWS documentation for ReturnValues <http://docs.
              aws.amazon.com/amazondynamodb/latest/APIReference/
              API_UpdateItem.html#DDB-UpdateItem-request-ReturnValues>`_
          :rtype: tornado.concurrent.Future
  
          .. _UpdateItem: http://docs.aws.amazon.com/amazondynamodb/
             latest/APIReference/API_UpdateItem.html
  
          """; 39, assignment; 40, identifier:condition_expression; 41, block; 42, identifier:expression_attribute_names; 43, block; 44, identifier:expression_attribute_values; 45, block; 46, identifier:return_consumed_capacity; 47, block; 48, identifier:return_item_collection_metrics; 49, block; 50, identifier:return_values; 51, block; 52, call; 53, identifier:payload; 54, dictionary; 55, expression_statement; 56, expression_statement; 57, expression_statement; 58, expression_statement; 59, expression_statement; 60, expression_statement; 61, expression_statement; 62, expression_statement; 63, expression_statement; 64, attribute; 65, argument_list; 66, pair; 67, pair; 68, pair; 69, assignment; 70, assignment; 71, assignment; 72, call; 73, assignment; 74, call; 75, assignment; 76, call; 77, assignment; 78, identifier:self; 79, identifier:execute; 80, string; 81, identifier:payload; 82, string; 83, identifier:table_name; 84, string; 85, call; 86, string; 87, identifier:update_expression; 88, subscript; 89, identifier:condition_expression; 90, subscript; 91, identifier:expression_attribute_names; 92, subscript; 93, line_continuation:\; 94, call; 95, identifier:_validate_return_consumed_capacity; 96, argument_list; 97, subscript; 98, identifier:return_consumed_capacity; 99, identifier:_validate_return_item_collection_metrics; 100, argument_list; 101, subscript; 102, line_continuation:\; 103, identifier:return_item_collection_metrics; 104, identifier:_validate_return_values; 105, argument_list; 106, subscript; 107, identifier:return_values; 108, string_content:UpdateItem; 109, string_content:TableName; 110, string_content:Key; 111, attribute; 112, argument_list; 113, string_content:UpdateExpression; 114, identifier:payload; 115, string; 116, identifier:payload; 117, string; 118, identifier:payload; 119, string; 120, attribute; 121, argument_list; 122, identifier:return_consumed_capacity; 123, identifier:payload; 124, string; 125, identifier:return_item_collection_metrics; 126, identifier:payload; 127, string; 128, identifier:return_values; 129, identifier:payload; 130, string; 131, identifier:utils; 132, identifier:marshall; 133, identifier:key_dict; 134, string_content:ConditionExpression; 135, string_content:ExpressionAttributeNames; 136, string_content:ExpressionAttributeValues; 137, identifier:utils; 138, identifier:marshall; 139, identifier:expression_attribute_values; 140, string_content:ReturnConsumedCapacity; 141, string_content:ReturnItemCollectionMetrics; 142, string_content:ReturnValues
code: def update_item(self, table_name, key_dict,
                      condition_expression=None,
                      update_expression=None,
                      expression_attribute_names=None,
                      expression_attribute_values=None,
                      return_consumed_capacity=None,
                      return_item_collection_metrics=None,
                      return_values=None):
          """Invoke the `UpdateItem`_ function.
  
          Edits an existing item's attributes, or adds a new item to the table
          if it does not already exist. You can put, delete, or add attribute
          values. You can also perform a conditional update on an existing item
          (insert a new attribute name-value pair if it doesn't exist, or replace
          an existing name-value pair if it has certain expected attribute
          values).
  
          :param str table_name: The name of the table that contains the item to
              update
          :param dict key_dict: A dictionary of key/value pairs that are used to
              define the primary key values for the item. For the primary key,
              you must provide all of the attributes. For example, with a simple
              primary key, you only need to provide a value for the partition
              key. For a composite primary key, you must provide values for both
              the partition key and the sort key.
          :param str condition_expression: A condition that must be satisfied in
              order for a conditional *UpdateItem* operation to succeed. One of:
              ``attribute_exists``, ``attribute_not_exists``, ``attribute_type``,
              ``contains``, ``begins_with``, ``size``, ``=``, ``<>``, ``<``,
              ``>``, ``<=``, ``>=``, ``BETWEEN``, ``IN``, ``AND``, ``OR``, or
              ``NOT``.
          :param str update_expression: An expression that defines one or more
              attributes to be updated, the action to be performed on them, and
              new value(s) for them.
          :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 return_consumed_capacity: Determines the level of detail
              about provisioned throughput consumption that is returned in the
              response. See the `AWS documentation
              for ReturnConsumedCapacity <http://docs.aws.amazon.com/
              amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-Update
              Item-request-ReturnConsumedCapacity>`_ for more information.
          :param str return_item_collection_metrics: Determines whether item
              collection metrics are returned.
          :param str return_values: Use ReturnValues if you want to get the item
              attributes as they appeared either before or after they were
              updated. See the `AWS documentation for ReturnValues <http://docs.
              aws.amazon.com/amazondynamodb/latest/APIReference/
              API_UpdateItem.html#DDB-UpdateItem-request-ReturnValues>`_
          :rtype: tornado.concurrent.Future
  
          .. _UpdateItem: http://docs.aws.amazon.com/amazondynamodb/
             latest/APIReference/API_UpdateItem.html
  
          """
          payload = {'TableName': table_name,
                     'Key': utils.marshall(key_dict),
                     'UpdateExpression': update_expression}
          if condition_expression:
              payload['ConditionExpression'] = condition_expression
          if expression_attribute_names:
              payload['ExpressionAttributeNames'] = expression_attribute_names
          if expression_attribute_values:
              payload['ExpressionAttributeValues'] = \
                  utils.marshall(expression_attribute_values)
          if return_consumed_capacity:
              _validate_return_consumed_capacity(return_consumed_capacity)
              payload['ReturnConsumedCapacity'] = return_consumed_capacity
          if return_item_collection_metrics:
              _validate_return_item_collection_metrics(
                  return_item_collection_metrics)
              payload['ReturnItemCollectionMetrics'] = \
                  return_item_collection_metrics
          if return_values:
              _validate_return_values(return_values)
              payload['ReturnValues'] = return_values
          return self.execute('UpdateItem', payload)