parameters: (self, key)
docstring: x.__getitem__(i) <=> x[i]
  
          Returns a newly created NDArray based on the indexing key.
  
          Parameters
          ----------
          key : int or mxnet.ndarray.NDArray.slice
              Indexing key.
  
          Examples
          --------
          >>> indptr = np.array([0, 2, 3, 6])
          >>> indices = np.array([0, 2, 2, 0, 1, 2])
          >>> data = np.array([1, 2, 3, 4, 5, 6])
          >>> a = mx.nd.sparse.csr_matrix((data, indices, indptr), shape=(3, 3))
          >>> a.asnumpy()
          array([[ 1.,  0.,  2.],
                 [ 0.,  0.,  3.],
                 [ 4.,  5.,  6.]], dtype=float32)
          >>> a[1:2].asnumpy()
          array([[ 0.,  0.,  3.]], dtype=float32)
          >>> a[1].asnumpy()
          array([[ 0.,  0.,  3.]], dtype=float32)
          >>> a[-1].asnumpy()
          array([[ 4.,  5.,  6.]], dtype=float32)
docstring_summary: x.__getitem__(i) <=> x[i]
docstring_tokens: x . __getitem__ ( i ) < = > x [ i ]
function: def __getitem__(self, key):
          """x.__getitem__(i) <=> x[i]
  
          Returns a newly created NDArray based on the indexing key.
  
          Parameters
          ----------
          key : int or mxnet.ndarray.NDArray.slice
              Indexing key.
  
          Examples
          --------
          >>> indptr = np.array([0, 2, 3, 6])
          >>> indices = np.array([0, 2, 2, 0, 1, 2])
          >>> data = np.array([1, 2, 3, 4, 5, 6])
          >>> a = mx.nd.sparse.csr_matrix((data, indices, indptr), shape=(3, 3))
          >>> a.asnumpy()
          array([[ 1.,  0.,  2.],
                 [ 0.,  0.,  3.],
                 [ 4.,  5.,  6.]], dtype=float32)
          >>> a[1:2].asnumpy()
          array([[ 0.,  0.,  3.]], dtype=float32)
          >>> a[1].asnumpy()
          array([[ 0.,  0.,  3.]], dtype=float32)
          >>> a[-1].asnumpy()
          array([[ 4.,  5.,  6.]], dtype=float32)
          """
          # pylint: disable= no-member, protected-access
          if isinstance(key, int):
              if key == -1:
                  begin = self.shape[0] - 1
              else:
                  begin = key
              return op.slice(self, begin=begin, end=begin+1)
          if isinstance(key, py_slice):
              if key.step is not None:
                  raise ValueError('CSRNDArray only supports continuous slicing on axis 0')
              if key.start is not None or key.stop is not None:
                  begin = key.start if key.start else 0
                  end = key.stop if key.stop else self.shape[0]
                  return op.slice(self, begin=begin, end=end)
              else:
                  return self
          if isinstance(key, tuple):
              raise ValueError('Multi-dimension indexing is not supported')
          raise ValueError('Undefined behaviour for {}'.format(key))
function_tokens: def __getitem__ ( self , key ) : # pylint: disable= no-member, protected-access if isinstance ( key , int ) : if key == - 1 : begin = self . shape [ 0 ] - 1 else : begin = key return op . slice ( self , begin = begin , end = begin + 1 ) if isinstance ( key , py_slice ) : if key . step is not None : raise ValueError ( 'CSRNDArray only supports continuous slicing on axis 0' ) if key . start is not None or key . stop is not None : begin = key . start if key . start else 0 end = key . stop if key . stop else self . shape [ 0 ] return op . slice ( self , begin = begin , end = end ) else : return self if isinstance ( key , tuple ) : raise ValueError ( 'Multi-dimension indexing is not supported' ) raise ValueError ( 'Undefined behaviour for {}' . format ( key ) )