code: def get_callable(path: str):
      """
      This function is similar to the _locate function in Hydra library
      Locate an object by name or dotted path, importing as necessary.
      """
      if path == "":
          raise ImportError("Empty path")
      import builtins
      from importlib import import_module
  
      parts = [part for part in path.split(".") if part]
      module = None
      for n in reversed(range(len(parts))):
          try:
              mod = ".".join(parts[:n])
              module = import_module(mod)
          except Exception as e:
              if n == 0:
                  raise ImportError(
                      f"Error loading module '{path}'"
                  ) from e
              continue
          if module:
              break
      if module:
          obj = module
      else:
          obj = builtins
      for part in parts[n:]:
          mod = mod + "." + part
          if not hasattr(obj, part):
              try:
                  import_module(mod)
              except Exception as e:
                  raise ImportError(
                      f"Encountered error: `{e}` when loading module '{path}'"
                  ) from e
          obj = getattr(obj, part)
      if isinstance(obj, type):
          obj_type: type = obj
          return obj_type
      elif callable(obj):
          obj_callable = obj
          return obj_callable
      else:
          # dummy case
          raise ValueError(
              f"Invalid type ({type(obj)}) found for {path}"
          )
  
file_path: shapash/shapash/report/common.py
imports: from typing import Union, Optional
  from enum import Enum
  from numbers import Number
  import pandas
  import os
  from pandas.api.types import is_string_dtype, is_numeric_dtype, is_bool_dtype
label_desc: Use image node_id 4 for calling a global function with example usage: get_callable(path) and returns: obj_type, obj_callable