code: def test_both_ends_capping(df_normal_dist):
      # test case 2: both tails
      transformer = ArbitraryOutlierCapper(
          max_capping_dict={"var": 0.20857275540714884},
          min_capping_dict={"var": -0.19661115230025186},
      )
      X = transformer.fit_transform(df_normal_dist)
  
      # expected output
      df_transf = df_normal_dist.copy()
      df_transf["var"] = np.where(
          df_transf["var"] > 0.20857275540714884,
          0.20857275540714884,
          df_transf["var"],
      )
      df_transf["var"] = np.where(
          df_transf["var"] < -0.19661115230025186,
          -0.19661115230025186,
          df_transf["var"],
      )
  
      # test fit params
      assert np.round(
          transformer.right_tail_caps_["var"], 3
      ) == np.round(0.20857275540714884, 3)
      assert np.round(
          transformer.left_tail_caps_["var"], 3
      ) == np.round(-0.19661115230025186, 3)
      # test transform output
      pd.testing.assert_frame_equal(X, df_transf)
      assert np.round(X["var"].max(), 3) <= np.round(
          0.20857275540714884, 3
      )
      assert np.round(X["var"].min(), 3) >= np.round(
          -0.19661115230025186, 3
      )
      assert np.round(df_normal_dist["var"].max(), 3) > np.round(
          0.20857275540714884, 3
      )
      assert np.round(df_normal_dist["var"].min(), 3) < np.round(
          -0.19661115230025186, 3
      )
  
file_path: feature_engine/tests/test_outliers/test_arbitrary_capper.py
imports: import numpy
  import pandas
  import pytest
  from feature_engine.outliers import ArbitraryOutlierCapper
label_desc: Use image node_id 2 for calling a global function with example usage: test_both_ends_capping(df_normal_dist) without return types