code: def wait_for_endpoint_loaded(python_service, object_uri):
      """
      This method waits for the object to be loaded.
      """
      logger.info("Waiting for object to be loaded...")
      while True:
          msg = ListObjects()
          list_object_msg = python_service.manage_request(msg)
          if not isinstance(list_object_msg, ObjectList):
              logger.error(
                  f"Error loading endpoint {object_uri}: {list_object_msg}"
              )
              return
  
          for uri, info in list_object_msg.objects.items():
              if uri == object_uri:
                  if info["status"] != "LoadInProgress":
                      logger.info(
                          f'Object load status: {info["status"]}'
                      )
                      return
  
          sleep(0.1)
  
file_path: TabPy/tabpy/tabpy_server/psws/callbacks.py
imports: import logging
  from tabpy.tabpy_server.app.app_parameters import SettingsParameters
  from tabpy.tabpy_server.common.messages import LoadObject, DeleteObjects, ListObjects, ObjectList
  from tabpy.tabpy_server.common.endpoint_file_mgr import cleanup_endpoint_files
  from tabpy.tabpy_server.common.util import format_exception
  from tabpy.tabpy_server.management.state import TabPyState, get_query_object_path
  from tabpy.tabpy_server.management import util
  from time import sleep
  from tornado import gen
label_desc: Use image node_id 1 for calling a global function with example usage: wait_for_endpoint_loaded(python_service, object_uri) without return types