code: def init_context(context):
      context.logger.info("Init context...  0%")
  
      app_dir = os.environ.get(
          "MONAI_LABEL_APP_DIR",
          "/opt/conda/monailabel/sample-apps/pathology",
      )
      studies = os.environ.get(
          "MONAI_LABEL_STUDIES", "/opt/monailabel/studies"
      )
      model = os.environ.get(
          "MONAI_LABEL_MODELS", "segmentation_nuclei"
      )
      pretrained_path = os.environ.get(
          "MONAI_PRETRAINED_PATH",
          "https://github.com/Project-MONAI/MONAILabel/releases/download/data",
      )
      conf = {
          "preload": "true",
          "models": model,
          "pretrained_path": pretrained_path,
      }
  
      root_dir = os.path.dirname(
          os.path.dirname(os.path.dirname(__file__))
      )
      app_dir = (
          app_dir
          if os.path.exists(app_dir)
          else os.path.join(root_dir, "sample-apps", "pathology")
      )
      studies = (
          studies
          if os.path.exists(os.path.dirname(studies))
          else os.path.join(root_dir, "studies")
      )
  
      app = app_instance(app_dir, studies, conf)
  
      context.user_data.model = model
      context.user_data.model_handler = app
      context.logger.info("Init context...100%")
  
file_path: MONAILabel/plugins/cvat/main.py
imports: import base64
  import io
  import json
  import logging
  import os
  from distutils.util import strtobool
  import numpy
  from PIL import Image
  from monailabel.interfaces.utils.app import app_instance
label_desc: Use image node_id 1 for calling a global function with example usage: init_context(context) without return types