code: def hash_evaluator(
      test_data: pd.DataFrame,
      hash_columns: List[str] = None,
      eval_name: str = None,
      consider_index: bool = False,
  ) -> EvalReturnType:
      """
      Computes the hash of a pandas dataframe, filtered by hash columns. The
      purpose is to uniquely identify a dataframe, to be able to check if two
      dataframes are equal or not.
  
      Parameters
      ----------
      test_data : Pandas' DataFrame
          A Pandas' DataFrame to be hashed.
  
      hash_columns : List[str], optional (default=None)
          A list of column names to filter the dataframe before hashing. If None,
          it will hash the dataframe with all the columns
  
      eval_name : String, optional (default=None)
          the name of the evaluator as it will appear in the logs.
  
      consider_index: bool, optional (default=False)
          If true, will consider the index of the dataframe to calculate the hash.
          The default behaviour will ignore the index and just hash the content of
          the features.
  
      Returns
      -------
      log: dict
          A log-like dictionary with the hash of the dataframe
      """
      if hash_columns is None:
          hash_columns = test_data.columns
  
      def calculate_dataframe_hash(
          df: pd.DataFrame, eval_name: str
      ) -> EvalReturnType:
          # Get the hashes per row, them sum all of them in a single value
          return {eval_name: hash_pandas_object(df).sum()}
  
      if eval_name is None:
          eval_name = "hash_evaluator__" + "_".join(
              sorted(hash_columns)
          )
      eval_data = test_data[hash_columns]
  
      if not consider_index:  # set 0 for all indexes
          return calculate_dataframe_hash(
              eval_data.set_index(
                  np.zeros(len(eval_data), dtype="int")
              ),
              eval_name,
          )
  
      return calculate_dataframe_hash(eval_data, eval_name)
  
imports: import warnings
  from typing import Any, Callable, Iterable, List
  import numpy
  import pandas
  import toolz
  from pandas.util import hash_pandas_object
  from sklearn.metrics import average_precision_score, brier_score_loss, fbeta_score, log_loss, mean_absolute_error, mean_squared_error, precision_score, r2_score, recall_score, roc_auc_score
  from toolz import curry, last, first
  from scipy import optimize
  from sklearn.linear_model import LogisticRegression
  from fklearn.types import EvalFnType, EvalReturnType, PredictFnType, UncurriedEvalFnType
label_desc: Use image node_id 22 for calling a global function with example usage: hash_evaluator(test_data, hash_columns, eval_name, consider_index) and returns: calculate_dataframe_hash, dict, calculate_dataframe_hash