code: def get_kinetic_energy_fn(momentum_distribution):
      """Convert a momentum distribution to a kinetic energy function."""
      return lambda *args: -momentum_distribution.log_prob(*args)
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import preconditioning_utils
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.generic import log_add_exp
  from tensorflow_probability.python.mcmc.internal import leapfrog_integrator
  from tensorflow_probability.python.mcmc.internal import util
  from tensorflow_probability.python.mcmc.kernel import TransitionKernel
label_desc: Use image node_id 6 for calling a global function with example usage: get_kinetic_energy_fn(momentum_distribution) and returns: function