nodes: 0, module; 1, function_definition; 2, function_name:row_sparse_pull; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, assert_statement; 12, assert_statement; 13, if_statement; 14, assert_statement; 15, expression_statement; 16, comment:# whether row_ids are the same; 17, expression_statement; 18, if_statement; 19, expression_statement; 20, expression_statement; 21, assert_statement; 22, if_statement; 23, comment:# the result can be copied to other devices without invoking row_sparse_pull; 24, comment:# if the indices are the same; 25, if_statement; 26, identifier:out; 27, None; 28, identifier:priority; 29, integer:0; 30, identifier:row_ids; 31, None; 32, comment:""" Pulls a single RowSparseNDArray value or a sequence of RowSparseNDArray values \
          from the store with specified row_ids. When there is only one row_id, KVStoreRowSparsePull \
          is invoked just once and the result is broadcast to all the rest of outputs.
  
          `row_sparse_pull` is executed asynchronously after all previous
          `pull`/`row_sparse_pull` calls and the last `push` call for the
          same input key(s) are finished.
  
          The returned values are guaranteed to be the latest values in the store.
  
          Parameters
          ----------
          key : str, int, or sequence of str or int
              Keys.
  
          out: RowSparseNDArray or list of RowSparseNDArray or list of list of RowSparseNDArray
              Values corresponding to the keys. The stype is expected to be row_sparse
  
          priority : int, optional
              The priority of the pull operation.
              Higher priority pull operations are likely to be executed before
              other pull actions.
  
          row_ids : NDArray or list of NDArray
              The row_ids for which to pull for each value. Each row_id is an 1-D NDArray \
              whose values don't have to be unique nor sorted.
  
          Examples
          --------
          >>> shape = (3, 3)
          >>> kv.init('3', mx.nd.ones(shape).tostype('row_sparse'))
          >>> a = mx.nd.sparse.zeros('row_sparse', shape)
          >>> row_ids = mx.nd.array([0, 2], dtype='int64')
          >>> kv.row_sparse_pull('3', out=a, row_ids=row_ids)
          >>> print a.asnumpy()
          [[ 1.  1.  1.]
          [ 0.  0.  0.]
          [ 1.  1.  1.]]
          >>> duplicate_row_ids = mx.nd.array([2, 2], dtype='int64')
          >>> kv.row_sparse_pull('3', out=a, row_ids=duplicate_row_ids)
          >>> print a.asnumpy()
          [[ 0.  0.  0.]
          [ 0.  0.  0.]
          [ 1.  1.  1.]]
          >>> unsorted_row_ids = mx.nd.array([1, 0], dtype='int64')
          >>> kv.row_sparse_pull('3', out=a, row_ids=unsorted_row_ids)
          >>> print a.asnumpy()
          [[ 1.  1.  1.]
          [ 1.  1.  1.]
          [ 0.  0.  0.]]
          """; 33, parenthesized_expression; 34, parenthesized_expression; 35, call; 36, block; 37, parenthesized_expression; 38, string:"row_ids should be NDArray or list of NDArray"; 39, assignment; 40, assignment; 41, boolean_operator; 42, block; 43, assignment; 44, assignment; 45, parenthesized_expression; 46, string:"the number of row_ids doesn't match the number of values"; 47, identifier:use_str_keys; 48, block; 49, else_clause; 50, identifier:single_rowid; 51, block; 52, comparison_operator:out is not None; 53, comparison_operator:row_ids is not None; 54, identifier:isinstance; 55, argument_list; 56, expression_statement; 57, call; 58, identifier:first_out; 59, identifier:out; 60, identifier:single_rowid; 61, False; 62, comparison_operator:len(row_ids) == 1; 63, call; 64, expression_statement; 65, expression_statement; 66, pattern_list; 67, call; 68, pattern_list; 69, call; 70, comparison_operator:len(crow_ids) == len(cvals); 71, expression_statement; 72, block; 73, for_statement; 74, identifier:out; 75, None; 76, identifier:row_ids; 77, None; 78, identifier:row_ids; 79, identifier:NDArray; 80, assignment; 81, identifier:isinstance; 82, argument_list; 83, call; 84, integer:1; 85, identifier:isinstance; 86, argument_list; 87, assignment; 88, assignment; 89, identifier:ckeys; 90, identifier:cvals; 91, identifier:use_str_keys; 92, identifier:_ctype_key_value; 93, argument_list; 94, identifier:_; 95, identifier:crow_ids; 96, identifier:_; 97, identifier:_ctype_key_value; 98, argument_list; 99, call; 100, call; 101, call; 102, expression_statement; 103, identifier:out_i; 104, subscript; 105, block; 106, identifier:row_ids; 107, list; 108, identifier:row_ids; 109, identifier:list; 110, identifier:len; 111, argument_list; 112, identifier:out; 113, identifier:list; 114, identifier:single_rowid; 115, True; 116, identifier:first_out; 117, list; 118, identifier:key; 119, identifier:first_out; 120, identifier:key; 121, identifier:row_ids; 122, identifier:len; 123, argument_list; 124, identifier:len; 125, argument_list; 126, identifier:check_call; 127, argument_list; 128, call; 129, identifier:out; 130, slice; 131, expression_statement; 132, identifier:row_ids; 133, identifier:row_ids; 134, subscript; 135, identifier:crow_ids; 136, identifier:cvals; 137, call; 138, identifier:check_call; 139, argument_list; 140, integer:1; 141, call; 142, identifier:out; 143, integer:0; 144, attribute; 145, argument_list; 146, call; 147, attribute; 148, argument_list; 149, identifier:_LIB; 150, identifier:MXKVStorePullRowSparseEx; 151, attribute; 152, call; 153, identifier:ckeys; 154, identifier:cvals; 155, identifier:crow_ids; 156, call; 157, attribute; 158, argument_list; 159, subscript; 160, identifier:copyto; 161, identifier:out_i; 162, identifier:self; 163, identifier:handle; 164, identifier:mx_uint; 165, argument_list; 166, attribute; 167, argument_list; 168, identifier:_LIB; 169, identifier:MXKVStorePullRowSparse; 170, attribute; 171, call; 172, identifier:ckeys; 173, identifier:cvals; 174, identifier:crow_ids; 175, call; 176, identifier:out; 177, integer:0; 178, call; 179, identifier:ctypes; 180, identifier:c_int; 181, identifier:priority; 182, identifier:self; 183, identifier:handle; 184, identifier:mx_uint; 185, argument_list; 186, attribute; 187, argument_list; 188, identifier:len; 189, argument_list; 190, call; 191, identifier:ctypes; 192, identifier:c_int; 193, identifier:priority; 194, identifier:ckeys; 195, identifier:len; 196, argument_list; 197, identifier:ckeys
code: def row_sparse_pull(self, key, out=None, priority=0, row_ids=None):
          """ Pulls a single RowSparseNDArray value or a sequence of RowSparseNDArray values \
          from the store with specified row_ids. When there is only one row_id, KVStoreRowSparsePull \
          is invoked just once and the result is broadcast to all the rest of outputs.
  
          `row_sparse_pull` is executed asynchronously after all previous
          `pull`/`row_sparse_pull` calls and the last `push` call for the
          same input key(s) are finished.
  
          The returned values are guaranteed to be the latest values in the store.
  
          Parameters
          ----------
          key : str, int, or sequence of str or int
              Keys.
  
          out: RowSparseNDArray or list of RowSparseNDArray or list of list of RowSparseNDArray
              Values corresponding to the keys. The stype is expected to be row_sparse
  
          priority : int, optional
              The priority of the pull operation.
              Higher priority pull operations are likely to be executed before
              other pull actions.
  
          row_ids : NDArray or list of NDArray
              The row_ids for which to pull for each value. Each row_id is an 1-D NDArray \
              whose values don't have to be unique nor sorted.
  
          Examples
          --------
          >>> shape = (3, 3)
          >>> kv.init('3', mx.nd.ones(shape).tostype('row_sparse'))
          >>> a = mx.nd.sparse.zeros('row_sparse', shape)
          >>> row_ids = mx.nd.array([0, 2], dtype='int64')
          >>> kv.row_sparse_pull('3', out=a, row_ids=row_ids)
          >>> print a.asnumpy()
          [[ 1.  1.  1.]
          [ 0.  0.  0.]
          [ 1.  1.  1.]]
          >>> duplicate_row_ids = mx.nd.array([2, 2], dtype='int64')
          >>> kv.row_sparse_pull('3', out=a, row_ids=duplicate_row_ids)
          >>> print a.asnumpy()
          [[ 0.  0.  0.]
          [ 0.  0.  0.]
          [ 1.  1.  1.]]
          >>> unsorted_row_ids = mx.nd.array([1, 0], dtype='int64')
          >>> kv.row_sparse_pull('3', out=a, row_ids=unsorted_row_ids)
          >>> print a.asnumpy()
          [[ 1.  1.  1.]
          [ 1.  1.  1.]
          [ 0.  0.  0.]]
          """
          assert(out is not None)
          assert(row_ids is not None)
          if isinstance(row_ids, NDArray):
              row_ids = [row_ids]
          assert(isinstance(row_ids, list)), \
              "row_ids should be NDArray or list of NDArray"
          first_out = out
          # whether row_ids are the same
          single_rowid = False
          if len(row_ids) == 1 and isinstance(out, list):
              single_rowid = True
              first_out = [out[0]]
          ckeys, cvals, use_str_keys = _ctype_key_value(key, first_out)
          _, crow_ids, _ = _ctype_key_value(key, row_ids)
          assert(len(crow_ids) == len(cvals)), \
                 "the number of row_ids doesn't match the number of values"
          if use_str_keys:
              check_call(_LIB.MXKVStorePullRowSparseEx(
                  self.handle, mx_uint(len(ckeys)), ckeys, cvals, crow_ids, ctypes.c_int(priority)))
          else:
              check_call(_LIB.MXKVStorePullRowSparse(
                  self.handle, mx_uint(len(ckeys)), ckeys, cvals, crow_ids, ctypes.c_int(priority)))
          # the result can be copied to other devices without invoking row_sparse_pull
          # if the indices are the same
          if single_rowid:
              for out_i in out[1:]:
                  out[0].copyto(out_i)