def METHOD_NAME():
    num_seg = 2
    file_path = cache_folder / "test_BaseSorting.npz"
    file_path.parent.mkdir(exist_ok=True)
    create_sorting_npz(num_seg, file_path)
    sorting = NpzSortingExtractor(file_path)
    # print(sorting)
    assert sorting.get_num_segments() == 2
    assert sorting.get_num_units() == 3
    # annotations / properties
    sorting.annotate(yep="yop")
    assert sorting.get_annotation("yep") == "yop"
    sorting.set_property("amplitude", [-20, -40.0, -55.5])
    values = sorting.get_property("amplitude")
    assert np.all(values == [-20, -40.0, -55.5])
    # dump/load dict
    d = sorting.to_dict(include_annotations=True, include_properties=True)
    sorting2 = BaseExtractor.from_dict(d)
    sorting3 = load_extractor(d)
    check_sortings_equal(sorting, sorting2, check_annotations=True, check_properties=True)
    check_sortings_equal(sorting, sorting3, check_annotations=True, check_properties=True)
    # dump/load json
    sorting.dump_to_json(cache_folder / "test_BaseSorting.json")
    sorting2 = BaseExtractor.load(cache_folder / "test_BaseSorting.json")
    sorting3 = load_extractor(cache_folder / "test_BaseSorting.json")
    check_sortings_equal(sorting, sorting2, check_annotations=True, check_properties=False)
    check_sortings_equal(sorting, sorting3, check_annotations=True, check_properties=False)
    # dump/load pickle
    sorting.dump_to_pickle(cache_folder / "test_BaseSorting.pkl")
    sorting2 = BaseExtractor.load(cache_folder / "test_BaseSorting.pkl")
    sorting3 = load_extractor(cache_folder / "test_BaseSorting.pkl")
    check_sortings_equal(sorting, sorting2, check_annotations=True, check_properties=True)
    check_sortings_equal(sorting, sorting3, check_annotations=True, check_properties=True)
    # cache old format : npz_folder
    folder = cache_folder / "simple_sorting_npz_folder"
    sorting.set_property("test", np.ones(len(sorting.unit_ids)))
    sorting.save(folder=folder, format="npz_folder")
    sorting2 = BaseExtractor.load_from_folder(folder)
    assert isinstance(sorting2, NpzFolderSorting)
    # cache new format : numpy_folder
    folder = cache_folder / "simple_sorting_numpy_folder"
    sorting.set_property("test", np.ones(len(sorting.unit_ids)))
    sorting.save(folder=folder, format="numpy_folder")
    sorting2 = BaseExtractor.load_from_folder(folder)
    assert isinstance(sorting2, NumpyFolderSorting)
    # but also possible
    sorting3 = BaseExtractor.load(folder)
    check_sortings_equal(sorting, sorting2, check_annotations=True, check_properties=True)
    check_sortings_equal(sorting, sorting3, check_annotations=True, check_properties=True)
    # save to memory
    sorting4 = sorting.save(format="memory")
    check_sortings_equal(sorting, sorting4, check_annotations=True, check_properties=True)
    with pytest.warns(DeprecationWarning):
        num_spikes = sorting.get_all_spike_trains()
    # print(spikes)
    spikes = sorting.to_spike_vector()
    # print(spikes)
    assert sorting._cached_spike_vector is not None
    spikes = sorting.to_spike_vector(extremum_channel_inds={0: 15, 1: 5, 2: 18})
    # print(spikes)
    num_spikes_per_unit = sorting.count_num_spikes_per_unit()
    total_spikes = sorting.count_total_num_spikes()
    # select units
    keep_units = [0, 1]
    sorting_select = sorting.select_units(unit_ids=keep_units)
    for unit in sorting_select.get_unit_ids():
        assert unit in keep_units
    # remove empty units
    empty_units = [1, 3]
    sorting_empty = generate_sorting(empty_units=empty_units)
    sorting_clean = sorting_empty.remove_empty_units()
    for unit in sorting_clean.get_unit_ids():
        assert unit not in empty_units
    sorting4 = sorting.to_numpy_sorting()
    sorting5 = sorting.to_multiprocessing(n_jobs=2)
    # create a clone with the same share mem buffer
    sorting6 = load_extractor(sorting5.to_dict())
    assert isinstance(sorting6, SharedMemorySorting)
    del sorting6
    del sorting5