code: def _log_average_probs_maybe_check_args(
      sample_axis, event_axis, validate_args
  ):
      """Assertions for `log_average_probs`."""
      assertions = []
      msg = "Arguments `sample_axis` and `event_axis` must be distinct."
      sample_setdiff = ps.setdiff1d(sample_axis, event_axis)
      if ps.is_numpy(sample_setdiff):
          if not np.array_equal(
              sample_setdiff, tf.get_static_value(sample_axis)
          ):
              raise ValueError(msg)
      elif validate_args:
          assertions.append(
              _assert_array_equal(
                  sample_setdiff,
                  sample_axis,
                  message=msg,
                  name="sample_setdiff_rank_check",
              )
          )
      event_setdiff = ps.setdiff1d(event_axis, sample_axis)
      if ps.is_numpy(event_setdiff):
          if not np.array_equal(
              event_setdiff, tf.get_static_value(event_axis)
          ):
              raise ValueError(msg)
      elif validate_args:
          assertions.append(
              _assert_array_equal(
                  event_setdiff,
                  event_axis,
                  message=msg,
                  name="event_setdiff_rank_check",
              )
          )
      return assertions
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_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.generic import reduce_logmeanexp
label_desc: Use image node_id 15 for calling a global function with example usage: _log_average_probs_maybe_check_args(sample_axis, event_axis, validate_args) and returns: assertions