code: def _nest_choose(is_accepted, proposed, current):
      """Like `choose` but not limited to list, tuple, namedtuple."""
      result_parts = choose(
          is_accepted,
          tf.nest.flatten(proposed, expand_composites=True),
          tf.nest.flatten(current, expand_composites=True),
      )
      return tf.nest.pack_sequence_as(
          proposed, result_parts, expand_composites=True
      )
  
imports: import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 8 for calling a global function with example usage: _nest_choose(is_accepted, proposed, current) and returns: tf