def checkvalue(value, label, minimum, maximum):
    """
    Checks that value is an integer and within the specified range
    """
    if not isinstance(value, int):
        raise TypeError(label)
    if  not minimum <= value <= maximum:
        raise ValueError(label + " outside of range")
    return True