class_docstr: A nicer way to build up index tuples for arrays.
  
  .. note::
     Use one of the two predefined instances `index_exp` or `s_`
     rather than directly using `IndexExpression`.
  
  For any index combination, including slicing and axis insertion,
  ``a[indices]`` is the same as ``a[np.index_exp[indices]]`` for any
  array `a`. However, ``np.index_exp[indices]`` can be used anywhere
  in Python code and returns a tuple of slice objects that can be
  used in the construction of complex index expressions.
  
  Parameters
  ----------
  maketuple : bool
      If True, always returns a tuple.
  
  See Also
  --------
  index_exp : Predefined instance that always returns a tuple:
     `index_exp = IndexExpression(maketuple=True)`.
  s_ : Predefined instance without tuple conversion:
     `s_ = IndexExpression(maketuple=False)`.
  
  Notes
  -----
  You can do all this with `slice()` plus a few special objects,
  but there's a lot to remember and this version is simpler because
  it uses the standard array indexing syntax.
  
  Examples
  --------
  >>> np.s_[2::2]
  slice(2, None, 2)
  >>> np.index_exp[2::2]
  (slice(2, None, 2),)
  
  >>> np.array([0, 1, 2, 3, 4])[np.s_[2::2]]
  array([2, 4])
class_docstr_tok: ["A","nicer","way","to","build","up","index","tuples","for","arrays",".","..","note",":",":","Use","one","of","the","two","predefined","instances","`","index_exp","`","or","`","s_","`","rather","than","directly","using","`","IndexExpression","`",".","For","any","index","combination",",","including","slicing","and","axis","insertion",",","``","a","[","indices","]","``","is","the","same","as","``","a","[","np.index_exp","[","indices","]","]","``","for","any","array","`","a","`",".","However",",","``","np.index_exp","[","indices","]","``","can","be","used","anywhere","in","Python","code","and","returns","a","tuple","of","slice","objects","that","can","be","used","in","the","construction","of","complex","index","expressions",".","Parameters","--","--","--","--","--","maketuple",":","bool","If","True",",","always","returns","a","tuple",".","See","Also","--","--","--","--","index_exp",":","Predefined","instance","that","always","returns","a","tuple",":","`","index_exp","=","IndexExpression","(","maketuple=True",")","`",".","s_",":","Predefined","instance","without","tuple","conversion",":","`","s_","=","IndexExpression","(","maketuple=False",")","`",".","Notes","--","--","-","You","can","do","all","this","with","`","slice","(",")","`","plus","a","few","special","objects",",","but","there","'s","a","lot","to","remember","and","this","version","is","simpler","because","it","uses","the","standard","array","indexing","syntax",".","Examples","--","--","--","--",">",">",">","np.s_","[","2",":",":2","]","slice","(","2",",","None",",","2",")",">",">",">","np.index_exp","[","2",":",":2","]","(","slice","(","2",",","None",",","2",")",",",")",">",">",">","np.array","(","[","0",",","1",",","2",",","3",",","4","]",")","[","np.s_","[","2",":",":2","]","]","array","(","[","2",",","4","]",")"]
code: def __getitem__(self, item):
      if self.maketuple and not isinstance(item, tuple):
          return (item,)
      else:
          return item
  
imports: from __future__ import division, absolute_import, print_function
  import functools
  import sys
  import math
  import numpy.core.numeric
  from numpy.core.numeric import asarray, ScalarType, array, alltrue, cumprod, arange, ndim
  from numpy.core.numerictypes import find_common_type, issubdtype
  import numpy.matrixlib
  from .function_base import diff
  from numpy.core.multiarray import ravel_multi_index, unravel_index
  from numpy.core.overrides import set_module
  from numpy.core import overrides, linspace
  from numpy.lib.stride_tricks import as_strided
label_desc: Use image node_id 2 for calling the IndexExpression obj's underlying member method code with example usage: obj.__getitem__(item) and returns: item, item