code: def testSampleWithNonZeroCountsAndNanSuccessProbability(self):
      # With non-zero counts, should forward the nan from the success probability,
      # but should not interfere with the rest of the batch.
      # Testing this case because it came up from us using Binomial as a
      # subroutine in BetaBinomial (b/163433191).
      total_count = tf.constant([23.0, 6.0], dtype=tf.float32)
      probs = tf.constant([1.0, np.nan], dtype=tf.float32)
      expected_samples = [23.0, np.nan]
      dist = binomial_lib.Binomial(
          total_count=total_count, probs=probs, validate_args=False
      )
      samples = self.evaluate(
          dist.sample(5, seed=test_util.test_seed())
      )
      self.assertAllEqual(samples, [expected_samples] * 5)
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import binomial
  from tensorflow_probability.python.internal import implementation_selection
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 27 for calling the BinomialTest obj's underlying member method code with example usage: obj.testSampleWithNonZeroCountsAndNanSuccessProbability() without return types