code: def check_cond_latents(cond_latents, hparams):
      """Shape checking for cond_latents."""
      if cond_latents is None:
          return
      if not isinstance(cond_latents[0], list):
          cond_latents = [cond_latents]
      exp_num_latents = hparams.num_cond_latents
      if hparams.latent_dist_encoder == "conv_net":
          exp_num_latents += int(hparams.cond_first_frame)
      if len(cond_latents) != exp_num_latents:
          raise ValueError(
              "Expected number of cond_latents: %d, got %d"
              % (exp_num_latents, len(cond_latents))
          )
      for cond_latent in cond_latents:
          if len(cond_latent) != hparams.n_levels - 1:
              raise ValueError(
                  "Expected level_latents to be %d, got %d"
                  % (hparams.n_levels - 1, len(cond_latent))
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import scipy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.utils import contrib
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_probability
label_desc: Use image node_id 9 for calling a global function with example usage: check_cond_latents(cond_latents, hparams) without return types