def ad_hoc_binning(
    intensity, 
    bin_caps=[2, 20],
    bin_labels=['low', 'medium', 'high']
):
    """Implements ad-hoc binning (3 bins) for nighttime lights
    
    Parameters
    ----------
    intensity : float
        The nighttime light intensity of a single pixel
    bin_caps : list
        Maximum values per bin (should contain n-1 bins as there is 
        no need to specify the maximum cap of the last bin)
    
    Returns
    ----------
    str
        Indicates nighttime light intensity (low, medium, or high)
    """
    bin_caps.append(1e100)
    for val, label in zip(bin_caps, bin_labels):
        if intensity <= val:
            return label