class_docstr: Abstract base class for time series panel tasks, e.g., classifiers, regressors.
  
  The class contains boilerplate for checks and data conversions,
  which are common to multiple descendants, most importantly,
  BaseClassifier and BaseRegressor.
docstr: Check and coerce X/y for fit/transform functions.
  
  Parameters
  ----------
  y : pd.DataFrame, pd.Series or np.ndarray
  return_to_mtype : bool
      whether to return the mtype of y output
  
  Returns
  -------
  y_inner : object of sktime compatible time series type
      can be Series, Panel, Hierarchical
  y_metadata : dict
      metadata of y, returned by check_is_scitype
  y_mtype : str, only returned if return_to_mtype=True
      mtype of y_inner, after convert
docstr_tok: ["Check","and","coerce","X\/y","for","fit\/transform","functions",".","Parameters","--","--","--","--","--","y",":","pd.DataFrame",",","pd.Series","or","np.ndarray","return_to_mtype",":","bool","whether","to","return","the","mtype","of","y","output","Returns","--","--","--","-","y_inner",":","object","of","sktime","compatible","time","series","type","can","be","Series",",","Panel",",","Hierarchical","y_metadata",":","dict","metadata","of","y",",","returned","by","check_is_scitype","y_mtype",":","str",",","only","returned","if","return_to_mtype=True","mtype","of","y_inner",",","after","convert"]
code: def _check_y(self, y=None, return_to_mtype=False):
      """Check and coerce X/y for fit/transform functions.
  
      Parameters
      ----------
      y : pd.DataFrame, pd.Series or np.ndarray
      return_to_mtype : bool
          whether to return the mtype of y output
  
      Returns
      -------
      y_inner : object of sktime compatible time series type
          can be Series, Panel, Hierarchical
      y_metadata : dict
          metadata of y, returned by check_is_scitype
      y_mtype : str, only returned if return_to_mtype=True
          mtype of y_inner, after convert
      """
      if y is None:
          if return_to_mtype:
              return None, None, None
          else:
              return None, None
  
      capa_multioutput = self.get_tag("capability:multioutput")
      y_inner_mtype = self.get_tag("y_inner_mtype")
  
      y_valid, y_msg, y_metadata = check_is_scitype(
          y, "Table", return_metadata=["is_univariate"]
      )
  
      if not y_valid:
          allowed_msg = (
              f"In {self.TASK}, y must be of a supported type, "
              f"for instance 1D or 2D numpy arrays, pd.DataFrame, or pd.Series. "
              f"Allowed compatible mtype format specifications are:"
              f" {MTYPE_LIST_TABLE} ."
          )
          check_is_error_msg(
              y_msg,
              var_name="y",
              allowed_msg=allowed_msg,
              raise_exception=True,
          )
  
      y_uni = y_metadata["is_univariate"]
      y_mtype = y_metadata["mtype"]
  
      requires_vectorization = not capa_multioutput and not y_uni
  
      if requires_vectorization:
          y_df = convert(
              y,
              from_type=y_mtype,
              to_type="pd_DataFrame_Table",
              as_scitype="Table",
              store=self._converter_store_y,
          )
          y_vec = VectorizedDF([y_df], iterate_cols=True)
          if return_to_mtype:
              return y_vec, y_metadata, "pd_DataFrame_Table"
          else:
              return y_vec, y_metadata
  
      y_inner, y_inner_mtype = convert(
          y,
          from_type=y_mtype,
          to_type=y_inner_mtype,
          as_scitype="Table",
          store=self._converter_store_y,
          return_to_mtype=True,
      )
  
      if return_to_mtype:
          return y_inner, y_metadata, y_inner_mtype
      else:
          return y_inner, y_metadata
  
file_path: sktime/sktime/base/_base_panel.py
imports: import numpy
  import pandas
  from sktime.base import BaseEstimator
  from sktime.datatypes import MTYPE_LIST_PANEL, MTYPE_LIST_TABLE, VectorizedDF, check_is_error_msg, check_is_scitype, convert
  from sktime.utils.warnings import warn
label_desc: Use image node_id 6 for calling the BasePanelMixin obj's underlying member method code with example usage: obj._check_y(y, return_to_mtype) and returns: y_inner,  y_metadata,  y_inner_mtype, y_inner,  y_metadata, None,  None,  None, None,  None, y_vec,  y_metadata,  str, y_vec,  y_metadata