code: def _get_state_from_file(
      state_path, logger=logging.getLogger(__name__)
  ):
      state_key = os.path.join(state_path, "state.ini")
      tmp_state_file = state_key
  
      if not os.path.exists(tmp_state_file):
          msg = f"Missing config file at {tmp_state_file}"
          logger.log(logging.CRITICAL, msg)
          raise ValueError(msg)
  
      config = _ConfigParser(allow_no_value=True)
      config.optionxform = str
      config.read(tmp_state_file)
  
      if not config.has_section("Service Info"):
          msg = (
              "Config error: Expected [Service Info] section in "
              f"{tmp_state_file}"
          )
          logger.log(logging.CRITICAL, msg)
          raise ValueError(msg)
  
      return config
  
imports: import logging
  import os
  from tabpy.tabpy_server.app.app_parameters import ConfigParameters, SettingsParameters
label_desc: Use image node_id 2 for calling a global function with example usage: _get_state_from_file(state_path, logger) and returns: config