code: def test_encoder_probabilities() -> None:
      weights = np.array(
          [
              [0, 0, 0],
              [0, 0, 100],
              [np.nan, 0, 1],
              [np.inf, np.inf, np.inf],
              [np.inf, np.inf, 12],
              [0, -np.inf, 0],
          ]
      )
      rng = np.random.RandomState(12)
      enc = discretization.Encoder(weights, rng=rng)
      proba = enc.probabilities()
      expected = [
          [0.333, 0.333, 0.333],
          [0, 0, 1],
          [0, 0.269, 0.731],
          [0.333, 0.333, 0.333],
          [0.5, 0.5, 0],
          [0.5, 0, 0.5],
      ]
      np.testing.assert_array_almost_equal(proba, expected, decimal=3)
  
file_path: nevergrad/nevergrad/parametrization/test_discretization.py
imports: import typing
  import warnings
  import numpy
  from ..common import testing
  from .None import discretization
label_desc: Use image node_id 3 for calling a global function with example usage: test_encoder_probabilities() without return types