code: def test_binning(r, target, observed, exp_bin_edges, expected_repr):
      r.initialize_from_array(np.array([]), mx.context.cpu())
      target_transf, _, rep_params = r(target, observed, None, [])
      bin_edges = rep_params[1]
  
      assert np.allclose(
          exp_bin_edges.asnumpy(), bin_edges.asnumpy()
      ), f"Bin edges mismatch. Expected: {exp_bin_edges} VS Actual: {bin_edges.asnumpy()}."
      assert np.allclose(
          expected_repr.asnumpy(), target_transf.asnumpy()
      ), f"Representation mismatch. Expected: {expected_repr} VS Actual: {target_transf}."
  
imports: import mxnet
  import numpy
  import pytest
  from gluonts.mx.representation import CustomBinning
label_desc: Use image node_id 1 for calling a global function with example usage: test_binning(r, target, observed, exp_bin_edges, expected_repr) without return types