code: def check_method_data(data):
      if not isinstance(data, (pd.DataFrame, np.ndarray)):
          raise TypeError(
              "'data' has to be pandas.DataFrame or numpy.ndarray"
          )
  
      if isinstance(data, np.ndarray) and data.ndim != 2:
          raise ValueError("'data' must have 2 dimensions")
  
imports: import numpy
  import pandas
  from copy import deepcopy
  from warnings import warn
  from .helper import verbose_cat, is_y_in_data, get_model_info
  from .yhat import get_predict_function_and_model_type
label_desc: Use image node_id 2 for calling a global function with example usage: check_method_data(data) without return types