code: def _sample_bernoulli(p):
      """Sample from Bernoulli(p)."""
      return tf_prob.distributions.Bernoulli(
          probs=p, dtype=tf.int64
      ).sample()
  
imports: import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 2 for calling a global function with example usage: _sample_bernoulli(p) and returns: tf_prob