class_docstr: Defines the DataBalanceManager for finding data balance measures
  on a dataset.
class_docstr_tok: ["Defines","the","DataBalanceManager","for","finding","data","balance","measures","on","a","dataset","."]
docstr: Load the DataBalanceManager from the given path.
  
  :param path: The directory path to load the DataBalanceManager from.
  :type path: str
  :param rai_insights: The loaded parent RAIInsights.
  :type rai_insights: RAIInsights
  :return: The DataBalanceManager after loading.
  :rtype: DataBalanceManager
docstr_tok: ["Load","the","DataBalanceManager","from","the","given","path",".",":","param","path",":","The","directory","path","to","load","the","DataBalanceManager","from",".",":","type","path",":","str",":","param","rai_insights",":","The","loaded","parent","RAIInsights",".",":","type","rai_insights",":","RAIInsights",":","return",":","The","DataBalanceManager","after","loading",".",":","rtype",":","DataBalanceManager"]
code: def _load(path, rai_insights):
      """
      Load the DataBalanceManager from the given path.
  
      :param path: The directory path to load the DataBalanceManager from.
      :type path: str
      :param rai_insights: The loaded parent RAIInsights.
      :type rai_insights: RAIInsights
      :return: The DataBalanceManager after loading.
      :rtype: DataBalanceManager
      """
      # create the DataBalanceManager without any properties using the
      # __new__ function, similar to pickle
      inst = DataBalanceManager.__new__(DataBalanceManager)
  
      inst.__dict__["_train"] = rai_insights.train
      inst.__dict__["_test"] = rai_insights.test
  
      is_added = False
      cols_of_interest = None
      task_type = rai_insights.task_type
      target_column = rai_insights.target_column
      classes = (
          list(map(str, rai_insights._classes))
          if rai_insights._classes is not None
          else []
      )
      df = pd.concat([rai_insights.train, rai_insights.test])
      data_balance_measures = None
  
      all_db_dirs = DirectoryManager.list_sub_directories(path)
      if len(all_db_dirs) != 0:
          dir_manager = DirectoryManager(
              parent_directory_path=path,
              sub_directory_name=all_db_dirs[0],
          )
          config_dir = dir_manager.get_config_directory()
  
          # Load manager
          with open(config_dir / MANAGER_JSON, "r") as f:
              manager_info = json.load(f)
              is_added = manager_info[Keys.IS_ADDED]
              task_type = manager_info[Keys.TASK_TYPE]
              cols_of_interest = manager_info[Keys.COLS_OF_INTEREST]
              target_column = manager_info[Keys.TARGET_COLUMN]
              classes = manager_info[Keys.CLASSES]
  
          # Load from data json
          data_path = dir_manager.get_data_directory() / DATA_JSON
          if data_path.exists():
              df = pd.read_json(data_path, orient="split")
  
          # Load measures
          measures_path = config_dir / MEASURES_JSON
          if measures_path.exists():
              with open(measures_path, "r") as f:
                  data_balance_measures = json.load(f)
  
      inst.__dict__["_is_added"] = is_added
      inst.__dict__["_task_type"] = task_type
      inst.__dict__["_cols_of_interest"] = cols_of_interest
      inst.__dict__["_target_column"] = target_column
      inst.__dict__["_classes"] = classes
      inst.__dict__["_df"] = df
      inst.__dict__["_data_balance_measures"] = data_balance_measures
  
      return inst
  
imports: import json
  import warnings
  from pathlib import Path
  from typing import Dict, List
  import numpy
  import pandas
  from responsibleai._interfaces import TaskType
  from responsibleai._internal.constants import DataBalanceManagerKeys
  from responsibleai._internal.constants import FileFormats, ListProperties, ManagerNames
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.databalanceanalysis import AggregateBalanceMeasures, DistributionBalanceMeasures, FeatureBalanceMeasures
  from responsibleai.databalanceanalysis.data_balance_utils import prepare_df, transform_measures_to_dict
  from responsibleai.managers.base_manager import BaseManager
label_desc: Use image node_id 11 for calling the DataBalanceManager obj's underlying member method code with example usage: obj._load(path, rai_insights) and returns: inst