code: def _unsorted_segment_reduction_or_zero(
      reducer, values, indices, num_groups
  ):
      """Common code for unsorted_segment_{min,max}_or_zero (below)."""
      reduced = reducer(values, indices, num_groups)
      present_indices = tf.math.unsorted_segment_max(
          tf.ones_like(indices, dtype=reduced.dtype),
          indices,
          num_groups,
      )
      present_indices = tf.clip_by_value(present_indices, 0, 1)
      present_indices = tf.reshape(
          present_indices,
          [num_groups] + [1] * (reduced.shape.ndims - 1),
      )
      reduced *= present_indices
      return reduced
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from graph_nets import _base
  from graph_nets import graphs
  from graph_nets import utils_tf
  import tensorflow
label_desc: Use image node_id 9 for calling a global function with example usage: _unsorted_segment_reduction_or_zero(reducer, values, indices, num_groups) and returns: reduced