def mass_function(values, bins, scale=1, aktomassd=183):
    '\n    M(>Ak), mass weighted complimentary cdf\n    '
    if hasattr(bins, '__getitem__'):
        range = (np.nanmin(bins), np.nanmax(bins))
    else:
        range = None
    (h, bins) = np.histogram(values, bins=bins, range=range, density=False, weights=((values * aktomassd) * scale))
    c = np.cumsum(h).astype(float)
    return ((c.max() - c), bins)
M(>Ak), mass weighted complimentary cdf
def mass_function(values, bins, scale=1, aktomassd=183):
    '\n    \n    '
    if hasattr(bins, '__getitem__'):
        range = (np.nanmin(bins), np.nanmax(bins))
    else:
        range = None
    (h, bins) = np.histogram(values, bins=bins, range=range, density=False, weights=((values * aktomassd) * scale))
    c = np.cumsum(h).astype(float)
    return ((c.max() - c), bins)