def getwithinrange(value, min=0, max=255):
    if min is not None and value < min:
        return min
    elif max is not None and value > max:
        return max
    else:
        return value
sort_menus goes through the items and sorts them based on
dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py/getwithinrange--crossover with--dataset/ETHPy150Open borgstrom/django-simple-menu/menu/menu.py/Menu.sort_menus