<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _amplitude_bounds(counts, bkg, model):
 """ Compute bounds for the root of `_f_cash_root_cython`. Parameters counts : `~numpy.ndarray` Count map. bkg : `~numpy.ndarray` Background map. model : `~numpy.ndarray` Source template (multiplied with exposure). """


    if isinstance(counts, list):
        counts = np.concatenate([t.flat for t in counts])
        bkg = np.concatenate([t.flat for t in bkg])
        model = np.concatenate([t.flat for t in model])

    s_model = np.sum(model)
    s_counts = np.sum(counts)

    sn = bkg / model
    imin = np.argmin(sn)
    sn_min = sn[imin]
    c_min = counts[imin]

    b_min = c_min / s_model - sn_min
    b_max = s_counts / s_model - sn_min
    return max(b_min, 0), b_max