code: def test_rebalance_by_continuous():
      result1 = (
          rebalance_by_continuous(
              data2, "col2", buckets=3, by_quantile=False
          )
          .sort_values("col2")
          .reset_index(drop=True)
      )
  
      expected1 = (
          pd.DataFrame(
              {
                  "col2": [2, 1, 1, 3, 3, 3, 4, 5, 5],
              }
          )
          .sort_values("col2")
          .reset_index(drop=True)
      )
  
      assert result1.reset_index(drop=True).equals(
          expected1
      ), "not working with pd.cut"
  
      result1 = (
          rebalance_by_continuous(
              data2, "col2", buckets=3, by_quantile=True
          )
          .sort_values("col2")
          .reset_index(drop=True)
      )
  
      expected1 = (
          pd.DataFrame(
              {
                  "col2": [
                      2,
                      1,
                      1,
                      2,
                      1,
                      1,
                      1,
                      2,
                      4,
                      5,
                      5,
                      3,
                      5,
                      4,
                      3,
                      5,
                  ],
              }
          )
          .sort_values("col2")
          .reset_index(drop=True)
      )
  
      assert result1.equals(expected1), "not working with pd.qcut"
  
label_desc: Use image node_id 2 for calling a global function with example usage: test_rebalance_by_continuous() without return types