code: def _check_column_dtypes(func):
      """Checks columns of DataFrame inputs
  
      This includes the checks on:
  
      * whether the input columns exist in the input DataFrames
      * whether the data types of col_user as well as col_item are matched in the two input DataFrames.
  
      Args:
          func (function): function that will be wrapped
  
      Returns:
          function: Wrapper function for checking dtypes.
      """
  
      @wraps(func)
      def check_column_dtypes_wrapper(
          rating_true,
          rating_pred,
          col_user=DEFAULT_USER_COL,
          col_item=DEFAULT_ITEM_COL,
          col_prediction=DEFAULT_PREDICTION_COL,
          *args,
          **kwargs,
      ):
          """Check columns of DataFrame inputs
  
          Args:
              rating_true (pandas.DataFrame): True data
              rating_pred (pandas.DataFrame): Predicted data
              col_user (str): column name for user
              col_item (str): column name for item
              col_rating (str): column name for rating
              col_prediction (str): column name for prediction
          """
          # Some ranking metrics don't have the rating column, so we don't need to check.
          expected_true_columns = {col_user, col_item}
          if "col_rating" in kwargs:
              expected_true_columns.add(kwargs["col_rating"])
          if not has_columns(rating_true, expected_true_columns):
              raise ColumnMismatchError(
                  "Missing columns in true rating DataFrame"
              )
  
          if not has_columns(
              rating_pred, {col_user, col_item, col_prediction}
          ):
              raise ColumnMismatchError(
                  "Missing columns in predicted rating DataFrame"
              )
  
          if not has_same_base_dtype(
              rating_true, rating_pred, columns=[col_user, col_item]
          ):
              raise ColumnTypeMismatchError(
                  "Columns in provided DataFrames are not the same datatype"
              )
  
          return func(
              rating_true=rating_true,
              rating_pred=rating_pred,
              col_user=col_user,
              col_item=col_item,
              col_prediction=col_prediction,
              *args,
              **kwargs,
          )
  
      return check_column_dtypes_wrapper
  
imports: import numpy
  import pandas
  from functools import wraps
  from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score, explained_variance_score, roc_auc_score, log_loss
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_PREDICTION_COL, DEFAULT_RELEVANCE_COL, DEFAULT_SIMILARITY_COL, DEFAULT_ITEM_FEATURES_COL, DEFAULT_ITEM_SIM_MEASURE, DEFAULT_K, DEFAULT_THRESHOLD
  from recommenders.datasets.pandas_df_utils import has_columns, has_same_base_dtype, lru_cache_df
label_desc: Use image node_id 1 for calling a global function with example usage: _check_column_dtypes(func) and returns: check_column_dtypes_wrapper, func