def bitmask_bool(bitmask, value):
    """
    Returns True or False depending on whether a particular bit has been set.

    Microsoft uses bitmasks as a compact way of denoting a number of boolean
    settings.  The second bit, for example, might be the ADS_UF_ACCOUNTDISABLE
    bit, so if the second bit is a 1, then the account is disabled, and if it is
    a 0, then it is not.

    As an example, to create the 'disabled' property of a User object, we use the
    userAccountControl property and ADS_UF_ACCOUNTDISABLE constant.

    bitmask_bool(user.user_account_control, constants.ADS_UF_ACCOUNTDISABLE)
    This will return True if the bit is set in user.user_account_control.

    @param: bitmask: a number representing a bitmask
    @param value:  the value to be checked (usually a known constant)

    @return: True if the bit has been set, False if it has not.
    """
    if int(bitmask) & int(value):
        return True
    else:
        return False