code: def test_regular_events():
      np.random.seed(0)
      dt = 0.01
      steps = np.concatenate(
          [
              np.unique(np.random.randint(0, 500, 100)),
              np.unique(np.random.randint(500, 1000, 200)),
          ]
      )
      t = dt * steps
  
      with catch_warnings(AstroMLDeprecationWarning):
          bins = bayesian_blocks(t, fitness="regular_events", dt=dt)
  
      assert_(len(bins) == 3)
      assert_allclose(bins[1], 5, rtol=0.05)
  
file_path: astroML/astroML/density_estimation/tests/test_bayesian_blocks.py
imports: import numpy
  from numpy.testing import assert_allclose, assert_
  from astropy.tests.helper import catch_warnings
  from astroML.density_estimation import bayesian_blocks
  from astroML.utils.exceptions import AstroMLDeprecationWarning
label_desc: Use image node_id 5 for calling a global function with example usage: test_regular_events() without return types