class_docstr: Maintaining a global application instance.
class_docstr_tok: ["Maintaining","a","global","application","instance","."]
code: def __call__(cls, *args, **kwargs):
      global APP_INSTANCE
      if APP_INSTANCE is None:
          APP_INSTANCE = super(SingletonApplication, cls).__call__(
              *args, **kwargs
          )
      # else:
      #     raise RuntimeError('application instance already started.')
      return APP_INSTANCE
  
imports: import os
  from argparse import Namespace
  import tensorflow
  from six import with_metaclass
  from niftynet.engine.signal import TRAIN, INFER, EVAL
label_desc: Use image node_id 1 for calling the SingletonApplication obj's underlying member method code with example usage: obj.__call__(cls) and returns: APP_INSTANCE