class_docstr: Generator for Thompson sampling.
  
  The generator performs Thompson sampling on the data passed in via `fit`.
  Arms are given weight proportional to the probability that they are
  winners, according to Monte Carlo simulations.
class_docstr_tok: ["Generator","for","Thompson","sampling",".","The","generator","performs","Thompson","sampling","on","the","data","passed","in","via","`","fit","`",".","Arms","are","given","weight","proportional","to","the","probability","that","they","are","winners",",","according","to","Monte","Carlo","simulations","."]
docstr: 1. Require that all Xs have the same arms, i.e. we have observed
  all arms for all metrics. If so, we can safely use Xs[0] exclusively.
  2. Require that all rows of X are unique, i.e. only one observation
  per parameterization.
docstr_tok: ["1",".","Require","that","all","Xs","have","the","same","arms",",","i.e",".","we","have","observed","all","arms","for","all","metrics",".","If","so",",","we","can","safely","use","Xs","[","0","]","exclusively",".","2",".","Require","that","all","rows","of","X","are","unique",",","i.e",".","only","one","observation","per","parameterization","."]
code: def _validate_Xs(self, Xs: List[List[TParamValueList]]) -> None:
      """
      1. Require that all Xs have the same arms, i.e. we have observed
      all arms for all metrics. If so, we can safely use Xs[0] exclusively.
      2. Require that all rows of X are unique, i.e. only one observation
      per parameterization.
      """
      if not all(x == Xs[0] for x in Xs[1:]):
          raise ValueError(
              "ThompsonSampler requires that all elements of Xs are identical; "
              "i.e. that we have observed all arms for all metrics."
          )
  
      X = Xs[0]
      uniqueX = {self._hash_TParamValueList(x) for x in X}
      if len(uniqueX) != len(X):
          raise ValueError(
              "ThompsonSampler requires all rows of X to be unique; "
              "i.e. that there is only one observation per parameterization."
          )
  
imports: import hashlib
  import json
  from typing import Dict, List, Optional, Tuple
  import numpy
  from ax.core.types import TGenMetadata, TParamValue, TParamValueList
  from ax.exceptions.constants import TS_MIN_WEIGHT_ERROR, TS_NO_FEASIBLE_ARMS_ERROR
  from ax.exceptions.model import ModelError
  from ax.models.discrete_base import DiscreteModel
  from ax.models.types import TConfig
  from ax.utils.common.docutils import copy_doc
label_desc: Use image node_id 8 for calling the ThompsonSampler obj's underlying member method code with example usage: obj._validate_Xs(Xs) without return types