def METHOD_NAME(
    npart,
    nproc,
    ndim,
    periodic=False,
    overwrite=False,
    display=False,
    suppress_final_output=False,
):
    r"""Get timing stats using :package:`cProfile`.
    Args:
        npart (int): Number of particles.
        nproc (int): Number of processors.
        ndim (int): Number of dimensions.
        periodic (bool, optional): If True, the domain is assumed to be
            periodic. Defaults to False.
        overwrite (bool, optional): If True, the existing file for this
            set of input parameters if overwritten. Defaults to False.
        suppress_final_output (bool, optional): If True, the final output
            from spawned MPI processes is suppressed. This is mainly for
            timing purposes. Defaults to False.
        display (bool, optional): If True, display the profile results.
            Defaults to False.
    """
    perstr = ""
    outstr = ""
    if periodic:
        perstr = "_periodic"
    if suppress_final_output:
        outstr = "_noout"
    fname_stat = f"stat_{npart}part_{nproc}proc_{ndim}dim{perstr}{outstr}.txt"
    if overwrite or not os.path.isfile(fname_stat):
        cProfile.run(
            "from yt.utilities.lib.cykdtree.tests import run_test; "
            + f"run_test({npart}, {ndim}, nproc={nproc}, "
            + f"periodic={periodic}, "
            + f"suppress_final_output={suppress_final_output})",
            fname_stat,
        )
    if display:
        p = pstats.Stats(fname_stat)
        p.sort_stats("time").print_stats(10)
        return p
    return fname_stat