code: def __init__(self, name, domain, dimensionality=None):
      dims = np.array([len(d) for d in domain])
      if not np.all(dims == dims[0]):
          raise InvalidConfigError(
              "The dimensionalities of the bandit variable "
              + name
              + " have to be the same!"
          )
  
      if dimensionality is None:
          dimensionality = len(domain[0])
  
      super(BanditVariable, self).__init__(
          name, "bandit", domain, dimensionality
      )
  
imports: import numpy
  from copy import deepcopy
  from ..errors import InvalidConfigError
label_desc: Use image node_id 1 to create a new BanditVariable object from inherited base classes: Variable with example: obj = BanditVariable(name, domain, dimensionality)