code: def testSampleDeterministicScalarVsVector(self):
      p = [0.2, 0.6]
      dist = bernoulli.Bernoulli(probs=p, validate_args=True)
      n = 1000
  
      def _seed(seed=None):
          seed = test_util.test_seed() if seed is None else seed
          if tf.executing_eagerly():
              tf.random.set_seed(seed)
          return seed
  
      seed = _seed()
      self.assertAllEqual(
          self.evaluate(dist.sample(n, _seed(seed=seed))),
          self.evaluate(dist.sample([n], _seed(seed=seed))),
      )
      n = tf1.placeholder_with_default(np.int32(1000), shape=None)
      seed = _seed()
      sample1 = dist.sample(n, _seed(seed=seed))
      sample2 = dist.sample([n], _seed(seed=seed))
      sample1, sample2 = self.evaluate([sample1, sample2])
      self.assertAllEqual(sample1, sample2)
  
imports: import numpy
  from scipy import special
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 18 for calling the BernoulliTest obj's underlying member method code with example usage: obj.testSampleDeterministicScalarVsVector() and returns: seed