original_docstring:  Query the table and perform an operation on each item 
docstring: Query the table and perform an operation on each item
docstring_tokens: Query the table and perform an operation on each item
code: def _query_and_op(self, tree, table, method_name, method_kwargs):
          """ Query the table and perform an operation on each item """
          result = []
          if tree.keys_in:
              if tree.using:
                  raise SyntaxError("Cannot use USING with KEYS IN")
              keys = self._iter_where_in(tree)
          else:
              visitor = Visitor(self.reserved_words)
              (action, kwargs, _) = self._build_query(table, tree, visitor)
              attrs = [visitor.get_field(table.hash_key.name)]
              if table.range_key is not None:
                  attrs.append(visitor.get_field(table.range_key.name))
              kwargs["attributes"] = attrs
              kwargs["expr_values"] = visitor.expression_values
              kwargs["alias"] = visitor.attribute_names
              # If there is no 'where' on this update/delete, check with the
              # caution_callback before proceeding.
              if (
                  visitor.expression_values is None
                  and callable(self.caution_callback)
                  and not self.caution_callback(method_name)  # pylint: disable=E1102
              ):
                  return False
              method = getattr(self.connection, action)
              keys = method(table.name, **kwargs)
              if self._explaining:
                  try:
                      list(keys)
                  except ExplainSignal:
                      keys = [{}]
  
          method = getattr(self.connection, method_name)
          count = 0
          for key in keys:
              try:
                  ret = method(table.name, key, **method_kwargs)
              except CheckFailed:
                  continue
              count += 1
              if ret:
                  result.append(ret)
          if result:
              return result
          else:
              return count
code_tokens: def _query_and_op ( self , tree , table , method_name , method_kwargs ) : result = [ ] if tree . keys_in : if tree . using : raise SyntaxError ( "Cannot use USING with KEYS IN" ) keys = self . _iter_where_in ( tree ) else : visitor = Visitor ( self . reserved_words ) ( action , kwargs , _ ) = self . _build_query ( table , tree , visitor ) attrs = [ visitor . get_field ( table . hash_key . name ) ] if table . range_key is not None : attrs . append ( visitor . get_field ( table . range_key . name ) ) kwargs [ "attributes" ] = attrs kwargs [ "expr_values" ] = visitor . expression_values kwargs [ "alias" ] = visitor . attribute_names if ( visitor . expression_values is None and callable ( self . caution_callback ) and not self . caution_callback ( method_name ) ) : return False method = getattr ( self . connection , action ) keys = method ( table . name , ** kwargs ) if self . _explaining : try : list ( keys ) except ExplainSignal : keys = [ { } ] method = getattr ( self . connection , method_name ) count = 0 for key in keys : try : ret = method ( table . name , key , ** method_kwargs ) except CheckFailed : continue count += 1 if ret : result . append ( ret ) if result : return result else : return count
short_docstring: Query the table and perform an operation on each item
short_docstring_tokens: Query the table and perform an operation on each item
comment: """ Query the table and perform an operation on each item """$SEP$# If there is no 'where' on this update/delete, check with the$SEP$# caution_callback before proceeding.$SEP$# pylint: disable=E1102