code: def check_y(x=None, y=None, y_name="y_target"):
      """
      Check that ypred given has the right shape and expected value.
  
      Parameters
      ----------
      y: pandas.DataFrame (optional)
          User-specified prediction values.
      x: pandas.DataFrame
          Dataset used by the model to perform the prediction (preprocessed or not).
      y_name: str
          Name of y ("y_target" or "y_pred")
      """
      if y is not None:
          if not isinstance(y, (pd.DataFrame, pd.Series)):
              raise ValueError(
                  f"{y_name} must be a one column pd.Dataframe or pd.Series."
              )
          if not y.index.equals(x.index):
              raise ValueError(
                  f"x and {y_name} should have the same index."
              )
          if isinstance(y, pd.DataFrame):
              if y.shape[1] > 1:
                  raise ValueError(
                      f"{y_name} must be a one column pd.Dataframe or pd.Series."
                  )
              if y.dtypes.iloc[0] not in [
                  float,
                  int,
                  np.int32,
                  np.float32,
                  np.int64,
                  np.float64,
              ]:
                  raise ValueError(
                      f"{y_name} must contain int or float only"
                  )
          if isinstance(y, pd.Series):
              if y.dtype not in [
                  float,
                  int,
                  np.int32,
                  np.float32,
                  np.int64,
                  np.float64,
              ]:
                  raise ValueError(
                      f"{y_name} must contain int or float only"
                  )
              y = y.to_frame()
              if isinstance(y.columns[0], (int, float)):
                  y.columns = [y_name]
      return y
  
imports: import copy
  import numpy
  import pandas
  from shapash.utils.category_encoder_backend import no_dummies_category_encoder, supported_category_encoder, dummies_category_encoder
  from shapash.utils.columntransformer_backend import no_dummies_sklearn, supported_sklearn
  from shapash.utils.model import extract_features_model
  from shapash.utils.model_synoptic import dict_model_feature
  from shapash.utils.transform import preprocessing_tolist, check_transformers
  from shapash.utils.columntransformer_backend import columntransformer, get_feature_names, get_list_features_names
label_desc: Use image node_id 5 for calling a global function with example usage: check_y(x, y, y_name) and returns: y