def METHOD_NAME(si_recording, lagc):
    """"""
    if isinstance(lagc, bool) and not lagc:
        agc_window_length_s = None
        apply_agc = False
    else:
        assert lagc > 0
        ts = 1 / si_recording.sampling_frequency
        window_s = lagc * ts
        agc_window_length_s = window_s
        apply_agc = True
    si_agc_params = {"apply_agc": apply_agc, "agc_window_length_s": agc_window_length_s}
    return si_agc_params