code: def testGetForAllModalities(self):
      for modality in modalities.ModalityType.get_choices():
          bottom = modalities.get_bottom(modality)
          loss = modalities.get_loss(modality)
          name = modalities.get_name(modality)
          targets_bottom = modalities.get_targets_bottom(modality)
          top = modalities.get_top(modality)
          weights_fn = modalities.get_weights_fn(modality)
          self.assertIsNotNone(
              bottom, msg="{} has no default bottom".format(modality)
          )
          self.assertIsNotNone(
              loss, msg="{} has no default loss".format(modality)
          )
          self.assertIsNotNone(
              name, msg="{} has no default name".format(modality)
          )
          self.assertIsNotNone(
              targets_bottom,
              msg="{} has no default targets_bottom".format(modality),
          )
          self.assertIsNotNone(
              top, msg="{} has no default top".format(modality)
          )
          self.assertIsNotNone(
              weights_fn,
              msg="{} has no default weights_fn".format(modality),
          )
  
file_path: tensor2tensor/tensor2tensor/layers/modalities_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import expert_utils
  from tensor2tensor.utils import test_utils
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the ModalityTest obj's underlying member method code with example usage: obj.testGetForAllModalities() without return types