import cProfile


def profiler_setup(config):
    """
    Set up profiler based on config
    """

    if not config["profile"]:
        return

    profiler = cProfile.Profile()
    profiler.enable()

    return profiler