text: 
  
  
  class ModelPhase(object):
      """
      Standard name for model phase in PaddleSeg
  
      The following standard keys are defined:
      * `TRAIN`: training mode.
      * `EVAL`: testing/evaluation mode.
      * `PREDICT`: prediction/inference mode.
      * `VISUAL` : visualization mode
      """
  
      TRAIN = 'train'
      EVAL = 'eval'
      PREDICT = 'predict'
      VISUAL = 'visual'
  
      @staticmethod
      def is_train(phase):
          return phase == ModelPhase.TRAIN
  
      @staticmethod
      def is_predict(phase):
          return phase == ModelPhase.PREDICT
  
      @staticmethod
      def is_eval(phase):
          return phase == ModelPhase.EVAL
  
      @staticmethod
      def is_visual(phase):
          return phase == ModelPhase.VISUAL
  
      @staticmethod
      def is_valid_phase(phase):
          """ Check valid phase """
          if ModelPhase.is_train(phase) or ModelPhase.is_predict(phase) \
                  or ModelPhase.is_eval(phase) or ModelPhase.is_visual(phase):
              return True
  
          return False
  