old_contents: # Copyright (c) Jupyter Development Team.
  # Distributed under the terms of the Modified BSD License.
  
  from jupyterlab_server import LabServerApp
  from jupyter_server.utils import url_path_join as ujoin
  import json
  import os
  from traitlets import Unicode
  
  HERE = os.path.dirname(__file__)
  
  # Turn off the Jupyter configuration system so configuration files on disk do
  # not affect this app. This helps this app to truly be standalone.
  os.environ["JUPYTER_NO_CONFIG"]="1"
  
  with open(os.path.join(HERE, 'package.json')) as fid:
      version = json.load(fid)['version']
  
  def _jupyter_server_extension_paths():
      return [
          {
              'module': 'main',
              'app': ExampleApp
          }
      ]
  
  class ExampleApp(LabServerApp):
      extension_url = '/example'
      name = __name__
      app_name = 'JupyterLab Example App'
      app_settings_dir = os.path.join(HERE, 'build', 'application_settings')
      app_version = version
      app_url = '/example'
      schemas_dir = os.path.join(HERE, 'build', 'schemas')
      static_dir = os.path.join(HERE, 'build')
      templates_dir = os.path.join(HERE, 'templates')
      themes_dir = os.path.join(HERE, 'build', 'themes')
      user_settings_dir = os.path.join(HERE, 'build', 'user_settings')
      workspaces_dir = os.path.join(HERE, 'build', 'workspaces')
  
  if __name__ == '__main__':
      ExampleApp.launch_instance()
  
new_contents: # Copyright (c) Jupyter Development Team.
  # Distributed under the terms of the Modified BSD License.
  
  from jupyterlab_server import LabServerApp
  from jupyter_server.utils import url_path_join as ujoin
  import json
  import os
  from traitlets import Unicode
  
  HERE = os.path.dirname(__file__)
  
  # Turn off the Jupyter configuration system so configuration files on disk do
  # not affect this app. This helps this app to truly be standalone.
  os.environ["JUPYTER_NO_CONFIG"]="1"
  
  with open(os.path.join(HERE, 'package.json')) as fid:
      version = json.load(fid)['version']
  
  def _jupyter_server_extension_paths():
      return [
          {
              'module': __name__,
              'app': ExampleApp
          }
      ]
  
  class ExampleApp(LabServerApp):
      extension_url = '/example'
      name = __name__
      app_name = 'JupyterLab Example App'
      app_settings_dir = os.path.join(HERE, 'build', 'application_settings')
      app_version = version
      app_url = '/example'
      schemas_dir = os.path.join(HERE, 'build', 'schemas')
      static_dir = os.path.join(HERE, 'build')
      templates_dir = os.path.join(HERE, 'templates')
      themes_dir = os.path.join(HERE, 'build', 'themes')
      user_settings_dir = os.path.join(HERE, 'build', 'user_settings')
      workspaces_dir = os.path.join(HERE, 'build', 'workspaces')
  
  if __name__ == '__main__':
      ExampleApp.launch_instance()
  
subject: use _main_ as module name for app example