code: def get_feature_label_correlation(
      train_df: pd.DataFrame,
      train_label_name: Optional[Hashable],
      test_df: pd.DataFrame,
      test_label_name: Optional[Hashable],
      ppscore_params: dict,
      n_show_top: int,
      min_pps_to_show: float = 0.05,
      random_state: int = None,
      with_display: bool = True,
      dataset_names: Tuple[str] = DEFAULT_DATASET_NAMES,
  ):
      """
      Calculate the PPS for train, test and difference for feature label correlation checks.
  
      The PPS represents the ability of a feature to single-handedly predict another feature or label.
      This function calculates the PPS per feature for both train and test, and returns the data and display graph.
  
      Uses the ppscore package - for more info, see https://github.com/8080labs/ppscore
  
      Args:
          train_df: pd.DataFrame
              DataFrame of all train features and label
          train_label_name:: str
              name of label column in train dataframe
          test_df:
              DataFrame of all test features and label
          test_label_name: str
              name of label column in test dataframe
          ppscore_params: dict
              dictionary of additional parameters for the ppscore predictor function
          n_show_top: int
              Number of features to show, sorted by the magnitude of difference in PPS
          min_pps_to_show: float, default 0.05
              Minimum PPS to show a class in the graph
          random_state: int, default None
              Random state for the ppscore.predictors function
          dataset_names: tuple, default: DEFAULT_DATASET_NAMES
              The names to show in the display for the first and second datasets.
  
      Returns:
          CheckResult
              value: dictionaries of PPS values for train, test and train-test difference.
              display: bar graph of the PPS of each feature.
      """
      df_pps_train = pps.predictors(
          df=train_df,
          y=train_label_name,
          random_seed=random_state,
          **ppscore_params,
      )
      df_pps_test = pps.predictors(
          df=test_df,
          y=test_label_name,
          random_seed=random_state,
          **ppscore_params,
      )
  
      s_pps_train = df_pps_train.set_index("x", drop=True)["ppscore"]
      s_pps_test = df_pps_test.set_index("x", drop=True)["ppscore"]
      s_difference = s_pps_train - s_pps_test
  
      ret_value = {
          "train": s_pps_train.to_dict(),
          "test": s_pps_test.to_dict(),
          "train-test difference": s_difference.to_dict(),
      }
  
      if not with_display:
          return ret_value, None
  
      sorted_order_for_display = (
          np.abs(s_difference)
          .sort_values(ascending=False)
          .head(n_show_top)
          .index
      )
      s_pps_train_to_display = s_pps_train[sorted_order_for_display]
      s_pps_test_to_display = s_pps_test[sorted_order_for_display]
  
      fig = get_pps_figure(
          per_class=False, n_of_features=len(sorted_order_for_display)
      )
      fig.add_trace(
          pd_series_to_trace(
              s_pps_train_to_display,
              DEFAULT_DATASET_NAMES[0],
              dataset_names[0],
          )
      )
      fig.add_trace(
          pd_series_to_trace(
              s_pps_test_to_display,
              DEFAULT_DATASET_NAMES[1],
              dataset_names[1],
          )
      )
  
      # display only if not all scores are above min_pps_to_show
      display = (
          [fig]
          if any(s_pps_train > min_pps_to_show)
          or any(s_pps_test > min_pps_to_show)
          else None
      )
  
      return ret_value, display
  
file_path: deepchecks/deepchecks/core/check_utils/feature_label_correlation_utils.py
imports: from typing import Optional, Tuple
  import numpy
  import pandas
  import plotly.graph_objects
  import deepchecks.ppscore
  from deepchecks.utils.plot import DEFAULT_DATASET_NAMES, colors
  from deepchecks.utils.strings import format_percent
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 4 for calling a global function with example usage: get_feature_label_correlation(train_df, train_label_name, test_df, test_label_name, ppscore_params, n_show_top, min_pps_to_show, random_state, with_display, dataset_names) and returns: ret_value,  display, ret_value,  None