code: def error_if_not_vector(tensor, identifier):
      """Raise a `ValueError` if the `Tensor` is not 1-D."""
      if len(list(tensor.shape)) != 1:
          raise ValueError(
              "`{}` must be a 1-D tensor.".format(identifier)
          )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import gradient
  from tensorflow.python.util import nest
label_desc: Use image node_id 5 for calling a global function with example usage: error_if_not_vector(tensor, identifier) without return types