code: def check_y(y, verbose=True):
      if isinstance(y, pd.Series):
          y = np.array(y)
          helper.verbose_cat(
              "Parameter 'y' was a pandas.Series. Converted to a numpy.ndarray.",
              verbose=verbose,
          )
      elif isinstance(y, pd.DataFrame):
          if y.shape[1] != 1:
              raise ValueError("'y' must be only one column")
          y = y.to_numpy().flatten()
          helper.verbose_cat(
              "Parameter 'y' was a pandas.DataFrame. Converted to a numpy.ndarray.",
              verbose=verbose,
          )
      elif type(y).__name__ == "H2OFrame":  # can't import h2o
          helper.verbose_cat(
              "Parameter 'y' was a h2o.H2OFrame. Converted to a numpy.ndarray.",
              verbose=verbose,
          )
          y = y.as_data_frame().to_numpy().flatten()
      elif isinstance(y, np.ndarray) and len(y.shape) != 1:
          raise ValueError("'y' must have only one dimension")
      elif not isinstance(y, np.ndarray):
          raise TypeError(
              "'y' must be a numpy.ndarray (1d) or pandas.Series"
          )
  
      return y
  
file_path: DALEX/python/dalex/dalex/fairness/_basics/checks.py
imports: import numpy
  import pandas
  from .exceptions import *
  from ..._explainer import helper
label_desc: Use image node_id 5 for calling a global function with example usage: check_y(y, verbose) and returns: y