class_docstr: Represent the base or stem of an indexed object
  
  The IndexedBase class represent an array that contains elements. The main purpose
  of this class is to allow the convenient creation of objects of the Indexed
  class.  The __getitem__ method of IndexedBase returns an instance of
  Indexed.  Alone, without indices, the IndexedBase class can be used as a
  notation for e.g. matrix equations, resembling what you could do with the
  Symbol class.  But, the IndexedBase class adds functionality that is not
  available for Symbol instances:
  
    -  An IndexedBase object can optionally store shape information.  This can
       be used in to check array conformance and conditions for numpy
       broadcasting.  (TODO)
    -  An IndexedBase object implements syntactic sugar that allows easy symbolic
       representation of array operations, using implicit summation of
       repeated indices.
    -  The IndexedBase object symbolizes a mathematical structure equivalent
       to arrays, and is recognized as such for code generation and automatic
       compilation and wrapping.
  
  >>> from sympy.tensor import IndexedBase, Idx
  >>> from sympy import symbols
  >>> A = IndexedBase('A'); A
  A
  >>> type(A)
  <class 'sympy.tensor.indexed.IndexedBase'>
  
  When an IndexedBase object receives indices, it returns an array with named
  axes, represented by an Indexed object:
  
  >>> i, j = symbols('i j', integer=True)
  >>> A[i, j, 2]
  A[i, j, 2]
  >>> type(A[i, j, 2])
  <class 'sympy.tensor.indexed.Indexed'>
  
  The IndexedBase constructor takes an optional shape argument.  If given,
  it overrides any shape information in the indices. (But not the index
  ranges!)
  
  >>> m, n, o, p = symbols('m n o p', integer=True)
  >>> i = Idx('i', m)
  >>> j = Idx('j', n)
  >>> A[i, j].shape
  (m, n)
  >>> B = IndexedBase('B', shape=(o, p))
  >>> B[i, j].shape
  (o, p)
  
  Assumptions can be specified with keyword arguments the same way as for Symbol:
  
  >>> A_real = IndexedBase('A', real=True)
  >>> A_real.is_real
  True
  >>> A != A_real
  True
  
  Assumptions can also be inherited if a Symbol is used to initialize the IndexedBase:
  
  >>> I = symbols('I', integer=True)
  >>> C_inherit = IndexedBase(I)
  >>> C_explicit = IndexedBase('I', integer=True)
  >>> C_inherit == C_explicit
  True
class_docstr_tok: ["Represent","the","base","or","stem","of","an","indexed","object","The","IndexedBase","class","represent","an","array","that","contains","elements",".","The","main","purpose","of","this","class","is","to","allow","the","convenient","creation","of","objects","of","the","Indexed","class",".","The","__getitem__","method","of","IndexedBase","returns","an","instance","of","Indexed",".","Alone",",","without","indices",",","the","IndexedBase","class","can","be","used","as","a","notation","for","e.g",".","matrix","equations",",","resembling","what","you","could","do","with","the","Symbol","class",".","But",",","the","IndexedBase","class","adds","functionality","that","is","not","available","for","Symbol","instances",":","-","An","IndexedBase","object","can","optionally","store","shape","information",".","This","can","be","used","in","to","check","array","conformance","and","conditions","for","numpy","broadcasting",".","(","TODO",")","-","An","IndexedBase","object","implements","syntactic","sugar","that","allows","easy","symbolic","representation","of","array","operations",",","using","implicit","summation","of","repeated","indices",".","-","The","IndexedBase","object","symbolizes","a","mathematical","structure","equivalent","to","arrays",",","and","is","recognized","as","such","for","code","generation","and","automatic","compilation","and","wrapping",".",">",">",">","from","sympy.tensor","import","IndexedBase",",","Idx",">",">",">","from","sympy","import","symbols",">",">",">","A","=","IndexedBase","(","'","A","'",")",";","A","A",">",">",">","type","(","A",")","<","class","'sympy.tensor.indexed.IndexedBase","'",">","When","an","IndexedBase","object","receives","indices",",","it","returns","an","array","with","named","axes",",","represented","by","an","Indexed","object",":",">",">",">","i",",","j","=","symbols","(","'","i","j","'",",","integer=True",")",">",">",">","A","[","i",",","j",",","2","]","A","[","i",",","j",",","2","]",">",">",">","type","(","A","[","i",",","j",",","2","]",")","<","class","'sympy.tensor.indexed.Indexed","'",">","The","IndexedBase","constructor","takes","an","optional","shape","argument",".","If","given",",","it","overrides","any","shape","information","in","the","indices",".","(","But","not","the","index","ranges","!",")",">",">",">","m",",","n",",","o",",","p","=","symbols","(","'m","n","o","p","'",",","integer=True",")",">",">",">","i","=","Idx","(","'","i","'",",","m",")",">",">",">","j","=","Idx","(","'","j","'",",","n",")",">",">",">","A","[","i",",","j","]",".shape","(","m",",","n",")",">",">",">","B","=","IndexedBase","(","'","B","'",",","shape=","(","o",",","p",")",")",">",">",">","B","[","i",",","j","]",".shape","(","o",",","p",")","Assumptions","can","be","specified","with","keyword","arguments","the","same","way","as","for","Symbol",":",">",">",">","A_real","=","IndexedBase","(","'","A","'",",","real=True",")",">",">",">","A_real.is_real","True",">",">",">","A","!","=","A_real","True","Assumptions","can","also","be","inherited","if","a","Symbol","is","used","to","initialize","the","IndexedBase",":",">",">",">","I","=","symbols","(","'","I","'",",","integer=True",")",">",">",">","C_inherit","=","IndexedBase","(","I",")",">",">",">","C_explicit","=","IndexedBase","(","'","I","'",",","integer=True",")",">",">",">","C_inherit","==","C_explicit","True"]
code: def __getitem__(self, indices, **kw_args):
      if is_sequence(indices):
          # Special case needed because M[*my_tuple] is a syntax error.
          if self.shape and len(self.shape) != len(indices):
              raise IndexException("Rank mismatch.")
          return Indexed(self, *indices, **kw_args)
      else:
          if self.shape and len(self.shape) != 1:
              raise IndexException("Rank mismatch.")
          return Indexed(self, indices, **kw_args)
  
imports: from collections.abc import Iterable
  from sympy.core.numbers import Number
  from sympy.core.assumptions import StdFactKB
  from sympy.core import Expr, Tuple, sympify, S
  from sympy.core.symbol import _filter_assumptions, Symbol
  from sympy.core.logic import fuzzy_bool, fuzzy_not
  from sympy.core.sympify import _sympify
  from sympy.functions.special.tensor_functions import KroneckerDelta
  from sympy.multipledispatch import dispatch
  from sympy.utilities.iterables import is_sequence, NotIterable
  from sympy.utilities.misc import filldedent
label_desc: Use image node_id 6 for calling the IndexedBase obj's underlying member method code with example usage: obj.__getitem__(indices) and returns: Indexed, Indexed