code: def test_hash_evaluator():
      rows = 50
      np.random.seed(42)
  
      # Generate 120 different categories
      categories = [
          "".join(
              np.random.choice(
                  list(string.ascii_uppercase + string.digits), size=10
              )
          )
          for _ in range(120)
      ]
      # Create a dataframe with different datatypes
      df1 = pd.DataFrame(
          {
              "feature1": np.random.normal(size=rows),
              "featureCategorical": np.random.choice(
                  categories, size=rows
              ),
              "featureDuplicate": np.repeat([100, 200], int(rows / 2)),
          }
      )
  
      # Create a dataframe with shuffled rows
      df2 = df1.copy().sample(frac=1.0).reset_index(drop=True)
      df2["featureDuplicate"] = np.repeat([900, 1000], int(rows / 2))
      # create a dataframe changing one value of a feature in the row
      df3 = df1.copy()
      df3.iloc[0, 0] = 999.9
  
      # evaluate only in feature1 and featureCategorical
      eval_fn = hash_evaluator(
          hash_columns=["feature1", "featureCategorical"],
          eval_name="eval_name",
      )
      # evaluate hash in all columns
      eval_fn_all = hash_evaluator(eval_name="eval_name")
      eval_fn_order = hash_evaluator(
          hash_columns=["feature1", "featureCategorical"],
          eval_name="eval_name",
          consider_index=True,
      )
  
      # shuffle preserves the hash with the default parameters
      assert eval_fn(df1)["eval_name"] == eval_fn(df2)["eval_name"]
      # if considering the index, the order matters
      assert (
          eval_fn_order(df1)["eval_name"]
          != eval_fn_order(df2)["eval_name"]
      )
      # changing one value of the feature should change the hash
      assert eval_fn(df1)["eval_name"] != eval_fn(df3)["eval_name"]
      # if we consider all the features in the dataframe, it should return different hashes for different dataframes
      assert (
          eval_fn_all(df1)["eval_name"] != eval_fn_all(df2)["eval_name"]
      )
  
      # Assert that the hashes stay the same everytime this is run.
      # The hash function is update in python 3.9 requiring different checks for each version.
      python_version = sys.version_info
      if python_version.minor == 8:
          assert eval_fn_all(df1)["eval_name"] == -6356943988420224450
          assert eval_fn_all(df2)["eval_name"] == -4865376220991082723
          assert eval_fn_all(df3)["eval_name"] == 141388279445698461
      else:
          assert eval_fn_all(df1)["eval_name"] == 12089800085289327166
          assert eval_fn_all(df2)["eval_name"] == 13581367852718468893
          assert eval_fn_all(df3)["eval_name"] == 141388279445698461
  
imports: import sys
  import string
  import numpy
  import pandas
  import pytest
  from fklearn.validation.evaluators import auc_evaluator, brier_score_evaluator, combined_evaluators, correlation_evaluator, expected_calibration_error_evaluator, fbeta_score_evaluator, hash_evaluator, logloss_evaluator, mean_prediction_evaluator, mse_evaluator, permutation_evaluator, pr_auc_evaluator, precision_evaluator, r2_evaluator, recall_evaluator, roc_auc_evaluator, spearman_evaluator, linear_coefficient_evaluator, ndcg_evaluator, split_evaluator, temporal_split_evaluator, exponential_coefficient_evaluator, logistic_coefficient_evaluator
label_desc: Use image node_id 22 for calling a global function with example usage: test_hash_evaluator() without return types