code: def __init__(self, model_storage, engine_storage, **kwargs) -> None:
      # region check availability
      is_cloud = Config().get("cloud", False)
      if is_cloud is True:
          byom_enabled = os.environ.get(
              "MINDSDB_BYOM_ENABLED", "false"
          ).lower()
          if byom_enabled not in ("true", "1"):
              raise RuntimeError("BYOM is disabled on cloud")
      # endregion
  
      self.model_wrapper = None
  
      self.inhouse_model_wrapper = None
      self.model_wrappers = {}
  
      # region read and save set default byom type
      try:
          self._default_byom_type = BYOM_TYPE.VENV
          if os.environ.get("MINDSDB_BYOM_DEFAULT_TYPE") is not None:
              self._default_byom_type = BYOM_TYPE[
                  os.environ.get("MINDSDB_BYOM_DEFAULT_TYPE").upper()
              ]
          else:
              env_var = os.environ.get("MINDSDB_BYOM_DEFAULT_TYPE")
              if env_var == "SAVE":
                  self._default_byom_type = BYOM_TYPE["VENV"]
              elif env_var == "UNSAVE":
                  self._default_byom_type = BYOM_TYPE["INHOUSE"]
              else:
                  raise KeyError
      except KeyError:
          self._default_byom_type = BYOM_TYPE.VENV
      # endregion
  
      # region check if 'inhouse' BYOM is enabled
      env_var = os.environ.get("MINDSDB_BYOM_INHOUSE_ENABLED")
      if env_var is None:
          self._inhouse_enabled = False if is_cloud else True
      else:
          self._inhouse_enabled = env_var.lower() in ("true", "1")
      # endregion
  
      super().__init__(model_storage, engine_storage, **kwargs)
  
imports: import os
  import re
  import sys
  import shutil
  import pickle
  import tarfile
  import tempfile
  import traceback
  import subprocess
  from enum import Enum
  from pathlib import Path
  from datetime import datetime
  from typing import Optional, Dict, Union
  from collections import OrderedDict
  import pandas
  from pandas.api import types
  from mindsdb.utilities import log
  from mindsdb.utilities.config import Config
  from mindsdb.interfaces.storage import db
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.libs.const import PREDICTOR_STATUS
  from mindsdb.integrations.utilities.utils import format_exception_error
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  import mindsdb.utilities.profiler
  from .proc_wrapper import pd_decode, pd_encode, encode, decode, BYOM_METHOD, import_string, find_model_class
  from .__about__ import __version__
label_desc: Use image node_id 1 to create a new BYOMHandler object from inherited base classes: BaseMLEngine with example: obj = BYOMHandler(model_storage, engine_storage)