code: def helper(input_filename, expected_filename, config_file):
      """ """
  
      input_filename = os.path.join(BASE_DIR, input_filename)
      expected_df = pd.read_csv(
          os.path.join(BASE_DIR, expected_filename)
      )
  
      if config_file:
          config_file = os.path.join(BASE_DIR, config_file)
  
      config = Configs.load_configs(config_file)
  
      test_df, _ = audit(
          pd.read_csv(os.path.join(BASE_DIR, input_filename)), config
      )
  
      # match expected_df columns
      shared_columns = [
          c for c in expected_df.columns if c in test_df.columns
      ]
  
      try:
          expected_df = expected_df[shared_columns]
          test_df = test_df[shared_columns]
          combined_data = pd.merge(
              expected_df,
              test_df,
              on=["attribute_name", "attribute_value"],
          )
      # subtract expected_df from test_df
      except:
          # collect output for
          print("could not merge")
          return (test_df, expected_df)
      # see if close enough to 0
  
      s = ""
      EPS = 1e-6
      for col in shared_columns:
          if col not in {"attribute_value", "attribute_name"}:
              print("testing {} ...".format(col))
  
              try:
                  # TypeError: numpy boolean subtract, the `-` operator, is
                  # deprecated, use the bitwise_xor, the `^` operator, or the
                  # logical_xor function instead.
                  # found online that casting as float64 will go around, but
                  # would like to get Jesse's take on best way to avoid issue.
                  if (
                      np.mean(
                          combined_data[col + "_x"].astype("float64")
                          - combined_data[col + "_y"].astype("float64")
                      )
                      > EPS
                  ):
                      exp_mean = np.mean(combined_data[col + "_x"])
                      aeq_mean = np.mean(combined_data[col + "_y"])
                      s += "{} fails: Expected {} on average, but aequitas returned {}\n".format(
                          col, exp_mean, aeq_mean
                      )
  
                      pytest.fail(s)
  
              except:
                  if not all(
                      combined_data[col + "_x"]
                      == combined_data[col + "_y"]
                  ):
                      s += "{} fails: at least one entry was not the same between data sets\n".format(
                          col
                      )
                      pytest.fail(s)
  
file_path: aequitas/src/tests/test_bias_report.py
imports: import os
  import sys
  import pytest
  import pandas
  import numpy
  from aequitas_cli.aequitas_audit import audit
  from aequitas_cli.utils.configs_loader import Configs
label_desc: Use image node_id 1 for calling a global function with example usage: helper(input_filename, expected_filename, config_file) and returns: test_df,  expected_df