code: def get_subapp_instance(cls, app: Application) -> Application:
      app.clear_instance()  # since Application is singleton, need to clear main app
      return cls.instance(parent=app)
  
imports: import io
  import os
  import typing
  import pytest
  from traitlets import Unicode
  from traitlets.config.application import Application
  from traitlets.config.configurable import Configurable
  from traitlets.config.loader import KVArgParseConfigLoader
label_desc: Use image node_id 1 for calling the SubApp2 obj's underlying member method code with example usage: obj.get_subapp_instance(cls, app) and returns: cls