def METHOD_NAME(sph: object) -> float:
    if not sph.ADAPTIVE_GAIN:
        return sph.STIM_GAIN
    if sph.LAST_TRIAL_DATA and sph.LAST_TRIAL_DATA["trial_num"] >= 200:
        stim_gain = sph.AG_MIN_VALUE
    else:
        stim_gain = sph.AG_INIT_VALUE
    return stim_gain