def METHOD_NAME(
    duration=10,
    num_channels=4,
    num_units=10,
    sampling_frequency=30000.0,
    num_segments=2,
    average_peak_amplitude=-100,
    upsample_factor=None,
    contact_spacing_um=40.0,
    num_columns=1,
    spike_times=None,
    spike_labels=None,
    # score_detection=1,
    firing_rate=3.0,
    seed=None,
):
    """
    Returns a generated dataset with "toy" units and spikes on top on white noise.
    This is useful to test api, algos, postprocessing and visualization without any downloading.
    This a rewrite (with the lazy approach) of the old spikeinterface.extractor.toy_example() which itself was also
    a rewrite from the very old spikeextractor.toy_example() (from Jeremy Magland).
    In this new version, the recording is totally lazy and so it does not use disk space or memory.
    It internally uses NoiseGeneratorRecording + generate_templates + InjectTemplatesRecording.
    For better control, you should use the  `generate_ground_truth_recording()`, but provides better control over
    the parameters.
    Parameters
    ----------
    duration: float (or list if multi segment)
        Duration in seconds (default 10).
    num_channels: int
        Number of channels (default 4).
    num_units: int
        Number of units (default 10).
    sampling_frequency: float
        Sampling frequency (default 30000).
    num_segments: int
        Number of segments (default 2).
    spike_times: ndarray (or list of multi segment)
        Spike time in the recording.
    spike_labels: ndarray (or list of multi segment)
        Cluster label for each spike time (needs to specified both together).
    # score_detection: int (between 0 and 1)
    #    Generate the sorting based on a subset of spikes compare with the trace generation.
    firing_rate: float
        The firing rate for the units (in Hz).
    seed: int
        Seed for random initialization.
    Returns
    -------
    recording: RecordingExtractor
        The output recording extractor.
    sorting: SortingExtractor
        The output sorting extractor.
    """
    if upsample_factor is not None:
        raise NotImplementedError(
            "InjectTemplatesRecording do not support yet upsample_factor but this will be done soon"
        )
    assert num_channels > 0
    assert num_units > 0
    if isinstance(duration, int):
        duration = float(duration)
    if isinstance(duration, float):
        durations = [duration] * num_segments
    else:
        durations = duration
        assert isinstance(duration, list)
        assert len(durations) == num_segments
        assert all(isinstance(d, float) for d in durations)
    unit_ids = np.arange(num_units, dtype="int64")
    # generate probe
    channel_locations = generate_channel_locations(num_channels, num_columns, contact_spacing_um)
    probe = Probe(ndim=2)
    probe.set_contacts(positions=channel_locations, shapes="circle", shape_params={"radius": 5})
    probe.create_auto_shape(probe_type="rect", margin=20.0)
    probe.set_device_channel_indices(np.arange(num_channels, dtype="int64"))
    # generate templates
    # this is hard coded now but it use to be like this
    ms_before = 1.5
    ms_after = 3.0
    unit_locations = generate_unit_locations(
        num_units, channel_locations, margin_um=15.0, minimum_z=5.0, maximum_z=50.0, seed=seed
    )
    templates = generate_templates(
        channel_locations,
        unit_locations,
        sampling_frequency,
        ms_before,
        ms_after,
        upsample_factor=upsample_factor,
        seed=seed,
        dtype="float32",
    )
    if average_peak_amplitude is not None:
        # ajustement au mean amplitude
        amps = np.min(templates, axis=(1, 2))
        templates *= average_peak_amplitude / np.mean(amps)
    # construct sorting
    if spike_times is not None:
        assert isinstance(spike_times, list)
        assert isinstance(spike_labels, list)
        assert len(spike_times) == len(spike_labels)
        assert len(spike_times) == num_segments
        sorting = NumpySorting.from_times_labels(spike_times, spike_labels, sampling_frequency, unit_ids=unit_ids)
    else:
        sorting = generate_sorting(
            num_units=num_units,
            sampling_frequency=sampling_frequency,
            durations=durations,
            firing_rates=firing_rate,
            empty_units=None,
            refractory_period_ms=4.0,
            seed=seed,
        )
    recording, sorting = generate_ground_truth_recording(
        durations=durations,
        sampling_frequency=sampling_frequency,
        sorting=sorting,
        probe=probe,
        templates=templates,
        ms_before=ms_before,
        ms_after=ms_after,
        dtype="float32",
        seed=seed,
        noise_kwargs=dict(noise_level=10.0, strategy="on_the_fly"),
    )
    return recording, sorting