class_docstr: Base class of array-like domains.
class_docstr_tok: ["Base","class","of","array-like","domains","."]
code: def __getitem__(cls, dtype_shape):
      dtype, shape = dtype_shape
      assert dtype is not None
      assert shape is not None
  
      # in some JAX versions, shape can be np.int64 type
      if get_tracing_state() or get_backend() == "jax":
          if dtype not in (None, "real"):
              dtype = int(dtype)
          if shape is not None:
              shape = tuple(map(int, shape))
  
      assert cls.dtype in (None, dtype)
      assert cls.shape in (None, shape)
      key = dtype, shape
      result = ArrayType._type_cache.get(key, None)
      if result is None:
          if dtype == "real":
              assert all(
                  isinstance(size, int) and size >= 0 for size in shape
              )
              name = (
                  "Reals[{}]".format(",".join(map(str, shape)))
                  if shape
                  else "Real"
              )
              result = RealsType(name, (), {"shape": shape})
          elif isinstance(dtype, int):
              assert dtype >= 0
              name = "Bint[{}]".format(
                  ",".join(map(str, (dtype,) + shape))
              )
              result = BintType(
                  name, (), {"dtype": dtype, "shape": shape}
              )
          else:
              raise ValueError("invalid dtype: {}".format(dtype))
          ArrayType._type_cache[key] = result
      return result
  
imports: import copyreg
  import functools
  import inspect
  import operator
  import warnings
  from functools import reduce
  from weakref import WeakValueDictionary
  import funsor.ops
  from funsor.ops.builtin import parse_ellipsis, parse_slice
  from funsor.util import broadcast_shape, get_backend, get_tracing_state, quote
label_desc: Use image node_id 1 for calling the ArrayType obj's underlying member method code with example usage: obj.__getitem__(cls, dtype_shape) and returns: result