code: def check_path(path):
      if not isinstance(path, (str, list, np.ndarray, pd.Series)):
          raise TypeError(
              "path must be str or list or numpy.ndarray or pd.Series"
          )
      if isinstance(path, str):
          if path != "average":
              raise ValueError(
                  "if path is str, then it must be 'average'"
              )
          else:
              return path
  
      path_ = np.array(path)
      if not np.issubdtype(path_[0], int):
          raise TypeError(
              "if path is array-like, then must be array of integers"
          )
  
      return path_
  
file_path: DALEX/python/dalex/dalex/predict_explanations/_shap/checks.py
imports: from copy import deepcopy
  from warnings import warn
  import numpy
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: check_path(path) and returns: path_, path