code: def test_cat_cols_to_bins_with_max_num_categories_and_sort_by_dist1():
      # Makes sure that doesn't ignore cats missing in test
      dist1 = np.array(list("aaabbbccd"))
      dist2 = np.array(list("aacdee"))
      res = preprocess_2_cat_cols_to_same_bins(
          dist1=dist1,
          dist2=dist2,
          max_num_categories=3,
          sort_by="dist1",
      )
  
      assert_that(list(res[0]), equal_to([3, 3, 2, 1]))
      assert_that(list(res[1]), equal_to([2, 0, 1, 3]))
      assert_that(
          list(res[2]), equal_to(["a", "b", "c", OTHER_CATEGORY_NAME])
      )
  
file_path: deepchecks/tests/utils/preprocessing_test.py
imports: import numpy
  from hamcrest import assert_that, calling, equal_to, raises
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.utils.distribution.preprocessing import OTHER_CATEGORY_NAME, preprocess_2_cat_cols_to_same_bins, value_frequency
label_desc: Use image node_id 2 for calling a global function with example usage: test_cat_cols_to_bins_with_max_num_categories_and_sort_by_dist1() without return types