class_docstr: Superclass for Product and Sum.
  
  See Also
  ========
  
  sympy.concrete.expr_with_limits.ExprWithLimits
  sympy.concrete.products.Product
  sympy.concrete.summations.Sum
class_docstr_tok: ["Superclass","for","Product","and","Sum",".","See","Also","========","sympy.concrete.expr_with_limits.ExprWithLimits","sympy.concrete.products.Product","sympy.concrete.summations.Sum"]
docstr: Return the index of a dummy variable in the list of limits.
  
  Explanation
  ===========
  
  ``index(expr, x)``  returns the index of the dummy variable ``x`` in the
  limits of ``expr``. Note that we start counting with 0 at the inner-most
  limits tuple.
  
  Examples
  ========
  
  >>> from sympy.abc import x, y, a, b, c, d
  >>> from sympy import Sum, Product
  >>> Sum(x*y, (x, a, b), (y, c, d)).index(x)
  0
  >>> Sum(x*y, (x, a, b), (y, c, d)).index(y)
  1
  >>> Product(x*y, (x, a, b), (y, c, d)).index(x)
  0
  >>> Product(x*y, (x, a, b), (y, c, d)).index(y)
  1
  
  See Also
  ========
  
  reorder_limit, reorder, sympy.concrete.summations.Sum.reverse_order,
  sympy.concrete.products.Product.reverse_order
docstr_tok: ["Return","the","index","of","a","dummy","variable","in","the","list","of","limits",".","Explanation","===========","``","index","(","expr",",","x",")","``","returns","the","index","of","the","dummy","variable","``","x","``","in","the","limits","of","``","expr","``",".","Note","that","we","start","counting","with","0","at","the","inner-most","limits","tuple",".","Examples","========",">",">",">","from","sympy.abc","import","x",",","y",",","a",",","b",",","c",",","d",">",">",">","from","sympy","import","Sum",",","Product",">",">",">","Sum","(","x","*","y",",","(","x",",","a",",","b",")",",","(","y",",","c",",","d",")",")",".index","(","x",")","0",">",">",">","Sum","(","x","*","y",",","(","x",",","a",",","b",")",",","(","y",",","c",",","d",")",")",".index","(","y",")","1",">",">",">","Product","(","x","*","y",",","(","x",",","a",",","b",")",",","(","y",",","c",",","d",")",")",".index","(","x",")","0",">",">",">","Product","(","x","*","y",",","(","x",",","a",",","b",")",",","(","y",",","c",",","d",")",")",".index","(","y",")","1","See","Also","========","reorder_limit",",","reorder",",","sympy.concrete.summations.Sum.reverse_order",",","sympy.concrete.products.Product.reverse_order"]
code: def index(expr, x):
      """
      Return the index of a dummy variable in the list of limits.
  
      Explanation
      ===========
  
      ``index(expr, x)``  returns the index of the dummy variable ``x`` in the
      limits of ``expr``. Note that we start counting with 0 at the inner-most
      limits tuple.
  
      Examples
      ========
  
      >>> from sympy.abc import x, y, a, b, c, d
      >>> from sympy import Sum, Product
      >>> Sum(x*y, (x, a, b), (y, c, d)).index(x)
      0
      >>> Sum(x*y, (x, a, b), (y, c, d)).index(y)
      1
      >>> Product(x*y, (x, a, b), (y, c, d)).index(x)
      0
      >>> Product(x*y, (x, a, b), (y, c, d)).index(y)
      1
  
      See Also
      ========
  
      reorder_limit, reorder, sympy.concrete.summations.Sum.reverse_order,
      sympy.concrete.products.Product.reverse_order
      """
      variables = [limit[0] for limit in expr.limits]
  
      if variables.count(x) != 1:
          raise ValueError(
              expr, "Number of instances of variable not equal to one"
          )
      else:
          return variables.index(x)
  
file_path: sympy/sympy/concrete/expr_with_intlimits.py
imports: from sympy.concrete.expr_with_limits import ExprWithLimits
  from sympy.core.singleton import S
  from sympy.core.relational import Eq
label_desc: Use image node_id 2 for calling the ExprWithIntLimits obj's underlying member method code with example usage: obj.index(expr, x) and returns: variables