Generate postgresql numeric range and label for insertion.

    Parameters
    ----------
    items: iterable labels for ranges.
    lower_bound: numeric lower bound
    upper_bound: numeric upper bound

def generate_numeric_range(items, lower_bound, upper_bound):
    """Generate postgresql numeric range and label for insertion.

    Parameters
    ----------
    items: iterable labels for ranges.
    lower_bound: numeric lower bound
    upper_bound: numeric upper bound
    """

    quantile_grid = create_quantiles(items, lower_bound, upper_bound)
    labels, bounds = (zip(*quantile_grid))
    ranges = ((label, NumericRange(*bound))
              for label, bound in zip(labels, bounds))
    return ranges