def METHOD_NAME(space_group_info, anomalous_flag,
             d_min=1.0, reflections_per_bin=200, n_bins=10, verbose=0):
  elements = ("N", "C", "C", "O") * 5
  structure_factors = random_structure.xray_structure(
    space_group_info,
    elements=elements,
    volume_per_atom=50.,
    min_distance=1.5,
    general_positions_only=True,
    use_u_aniso=False,
    u_iso=adptbx.b_as_u(10)
    ).structure_factors(
        anomalous_flag=anomalous_flag, d_min=d_min, algorithm="direct")
  if (0 or verbose):
    structure_factors.xray_structure().show_summary()
  for n_bins in [10,20]:
    f_calc = abs(structure_factors.f_calc())
    f_calc.setup_binner(
      auto_binning=True,
      reflections_per_bin=reflections_per_bin,
      n_bins=n_bins)
    f_obs = miller.array(
      miller_set=f_calc,
      data=f_calc.data()).set_observation_type_xray_amplitude()
    f_obs.use_binner_of(f_calc)
    f_obs_sq = f_obs.f_as_f_sq()
    f_obs_sq.use_binner_of(f_obs)
    for ma in (f_obs,f_obs_sq):
      if ma.is_xray_amplitude_array():
        dist = statistics.cumulative_intensity_distribution(f_obs=ma)
      else:
        dist = statistics.cumulative_intensity_distribution(f_obs_sq=ma)
      n_bins_used = f_obs.binner().n_bins_used()
      x_index = {}
      x_index[0.1] = n_bins_used//10
      x_index[0.5] = n_bins_used//2
      x_index[0.9] = 9*n_bins_used//10
      if space_group_info.group().is_centric():
        assert 0.23 < dist.y[x_index[0.1]] < 0.32
        assert 0.49 < dist.y[x_index[0.5]] < 0.57
        assert 0.65 < dist.y[x_index[0.9]] < 0.70
      else:
        assert 0.08 < dist.y[x_index[0.1]] < 0.21
        assert 0.37 < dist.y[x_index[0.5]] < 0.49
        assert 0.57 < dist.y[x_index[0.9]] < 0.65