def check_byte(b):
    """
    Clamp the supplied value to an integer between 0 and 255 inclusive

    :param b:
        A number
    :return:
        Integer representation of the number, limited to be between 0 and 255
    """
    i = int(b)
    if i < 0:
        i = 0
    elif i > 255:
        i = 255
    return i