code: def features_to_nonpadding(features, inputs_or_targets="inputs"):
      """See transformer.features_to_nonpadding."""
      key = inputs_or_targets + "_segmentation"
      if features and key in features:
          return tf.minimum(tf.to_float(features[key]), 1.0)
      return None
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  from tensor2tensor.layers import common_attention
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import transformer_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: features_to_nonpadding(features, inputs_or_targets) and returns: None, tf