class_docstr: Categorical Sampler for discrete integer and categorical choices
  
  Parameters
  ----------
  tpe: `TPE` algorithm
      The tpe algorithm object which this sampler will be part of.
  observations: list
      Observed values in the dimension
  choices: list
      Candidate values for the dimension
class_docstr_tok: ["Categorical","Sampler","for","discrete","integer","and","categorical","choices","Parameters","--","--","--","--","--","tpe",":","`","TPE","`","algorithm","The","tpe","algorithm","object","which","this","sampler","will","be","part","of",".","observations",":","list","Observed","values","in","the","dimension","choices",":","list","Candidate","values","for","the","dimension"]
docstr: Sample required number of points
code: def sample(self, num: int = 1) -> numpy.ndarray:
      """Sample required number of points"""
      samples = self.tpe.rng.multinomial(
          n=1, pvals=self.weights, size=num
      )
  
      assert samples.shape == (num,) + (len(self.weights),)
  
      samples_index = samples.argmax(-1)
      assert samples_index.shape == (num,)
  
      return samples_index
  
imports: from __future__ import annotations
  import logging
  from typing import Any, Callable, ClassVar, Iterable, Sequence, TypeVar
  import numpy
  from scipy.stats import norm
  from scipy.stats.distributions import rv_frozen
  from orion.algo.base import BaseAlgorithm
  from orion.algo.base.parallel_strategy import ParallelStrategy, strategy_factory
  from orion.algo.space import Integer, Real, Space
  from orion.core.utils import format_trials
  from orion.core.utils.flatten import flatten
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 3 for calling the CategoricalSampler obj's underlying member method code with example usage: obj.sample(num) and returns: samples_index