Tests if any of the specified debug flags are enabled.

@param state the JShell instance
@param flag the {@code DBG_*} bits to check
@return true if any of the flags are enabled
348489
public static boolean isDebugEnabled(JShell state, int flag) {
        if (debugMap == null) {
            return false;
        }
        Integer flags = debugMap.get(state);
        if (flags == null) {
            return false;
        }
        return (flags & flag) != 0;
    }
23628
@Override
    protected boolean onStateChange(int[] state) {
        final int color = state == null ? mColorStateList.getDefaultColor() : mColorStateList.getColorForState(state, mColor);
        boolean bFlag = mColor != color;
        if (bFlag) {
            mColor = color;
        }
        return bFlag;
    }
674720
public static boolean isTerminating(Service.State state) {
        return state == Service.State.STOPPING
                || state == Service.State.TERMINATED
                || state == Service.State.FAILED;
    }
933761
static boolean checkFlagConsistency(int flags, boolean hasWidth) {
    // Check that we specify at most one of 'prefix plus' and 'prefix space'.
    if ((flags & (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES))
        == (FLAG_PREFIX_PLUS_FOR_POSITIVE_VALUES | FLAG_PREFIX_SPACE_FOR_POSITIVE_VALUES)) {
      return false;
    }
    // Check that we specify at most one of 'left align' and 'leading zeros'.
    if ((flags & (FLAG_LEFT_ALIGN | FLAG_SHOW_LEADING_ZEROS))
        == (FLAG_LEFT_ALIGN | FLAG_SHOW_LEADING_ZEROS)) {
      return false;
    }
    // Check that if 'left align' or 'leading zeros' is specified, we also have a width value.
    if ((flags & (FLAG_LEFT_ALIGN | FLAG_SHOW_LEADING_ZEROS)) != 0 && !hasWidth) {
      return false;
    }
    return true;
  }
168906
public boolean hasState() {
		for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) {
			if (operatorSubtaskState != null && operatorSubtaskState.hasState()) {
				return true;
			}
		}
		return false;
	}
803658
public synchronized void setState(DebugState newState)
	{
		if (!states.contains(newState))
		{
			switch (newState)
			{
				case Disconnected:
					Assert.isLegal(canChange(DebugState.Disconnected), "Cannot disconnect a terminated state");
				case Terminated:
					Assert.isLegal(canChange(DebugState.Terminated), "Cannot terminate a terminated state");
					states.clear();
					states.add(newState);
					break;
				case Suspended:
					Assert.isLegal(canChange(DebugState.Suspended), "Can only suspend if resumed");
					states.remove(DebugState.Resumed);
					states.add(newState);
					break;
				case IsStepping:
					Assert.isLegal(canChange(DebugState.IsStepping), "Cannot step if not suspended");
					states.add(newState);
					break;
				case Resumed:
					Assert.isLegal(canChange(DebugState.Resumed), "Cannot resume in a terminated state");
					if (states.contains(DebugState.IsStepping))
					{
						states.clear();
						states.add(DebugState.IsStepping);
					} else
					{
						states.clear();
					}
					states.add(newState);
					break;
				case Deadlocked:
					states.add(newState);
					break;
			}
		}
	}
896705
function enableAnomalyMail(flag) {
	emailOn = flag
	if (!isEmailOn()) { // notify if off state
		var printableState = typeof flag === 'number' ?
			'disabled until: ' + (new Date(flag)).toISOString().substring(0, 10) :
			'disabled'
		var callersLocation = haraldutil.getLocation({offset: 1, folder: false, object: false, fileLine: true, dropExt: true})
		log(id, printableState, callersLocation)
	}
	return emailOn
}
351083
public boolean checkAccess(AccessFlags flags){

        boolean isPublic = flags.is(AccessFlags.ACC_PUBLIC);
        boolean isProtected = flags.is(AccessFlags.ACC_PROTECTED);
        boolean isPrivate = flags.is(AccessFlags.ACC_PRIVATE);
        boolean isPackage = !(isPublic || isProtected || isPrivate);

        if ((showAccess == AccessFlags.ACC_PUBLIC) && (isProtected || isPrivate || isPackage))
            return false;
        else if ((showAccess == AccessFlags.ACC_PROTECTED) && (isPrivate || isPackage))
            return false;
        else if ((showAccess == 0) && (isPrivate))
            return false;
        else
            return true;
    }
1212006
function  ( flag ){
    if( flag === undefined ) flag = true;
    this._dat[ 0|SCISSOR_ENABLE ] = flag|0;
    this._set |= SCISSOR_ENABLE_SET|0;
    return this;
  }
1344479
private boolean evaluateConditionFlags(String flags) {
        int p = 0;
        while (true) {
            p = skipBlanks(flags, p);
            if (p >= flags.length()) {
                break;
            }
            boolean complement = false;
            if (flags.charAt(p) == '!') {
                complement = true;
                p++;
            }
            p = skipBlanks(flags, p);
            if (p >= flags.length()) {
                break;
            }
            int p0 = p;
            p = skipNonBlanks(flags, p0 + 1);
            String flag = flags.substring(p0, p).toUpperCase();
            if ((conditionFlags != null && conditionFlags.contains(flag)) ^ complement) {
                return true;
            }
        }
        return false;
    }
611611
function(flag) {
			flag = flag !== false; // Confusing use of '!'
			/*jshint -W018 */ if (!!this._enableUpdate === !!flag) {
				return flag;
			}
			/*jshint +W018 */
			this._enableUpdate = flag;
			if (flag) {
				this.debug("enableUpdate(true): redraw "); //, this._dirtyRoots);
				this.render();
			} else {
				// 	this._dirtyRoots = null;
				this.debug("enableUpdate(false)...");
			}
			return !flag; // return previous value
		}
597722
def setFlag(self, flag, state=True):
        
        has_flag = self.testFlag(flag)
        if has_flag and not state:
            self.setFlags(self.flags() ^ flag)
        elif not has_flag and state:
            self.setFlags(self.flags() | flag)
846318
def set_flagstate(flagset):
    
    if not flagset <= _all_flags:
        raise ValueError("unrecognized flags in flagset")

    for f in flagset:
        set_flag(f)
    for f in _all_flags - flagset:
        clear_flag(f)
5555
public function has($flag)
    {
        // We'll extract the given flag into an array of possible flags, and
        // see if our AccountControl object contains any of them.
        $flagsUsed = array_intersect($this->extractFlags($flag), $this->values);

        return in_array($flag, $flagsUsed);
    }
795676
function isUSAState (state, strict) {
    state = state && NODE_RATIFY.isString(state) ? _toTitleCase(state) : null;
    var topLevel = (US_STATE_CODE_TO_NAME[state] || US_STATE_NAME_TO_CODE[state]);

    if(strict) {
        return topLevel ? true : false;
    } else {
        return (US_INHABITED_TERRITORIES_CODE_TO_NAME[state] || US_INHABITED_TERRITORIES_NAME_TO_CODE[state] || topLevel) ? true : false;
    }
}
1013763
def debug(self, state=None):
        
        if state is None:
            return self.__debug
        self.__debug = bool(state)
        return self.__debug
470354
protected void setFlag(final int mask, final boolean flag) {
		// Only store the flag value if it is not the default.
		if (flag != isFlagSet(mask)) {
			ComponentModel model = getOrCreateComponentModel();
			model.setFlags(switchFlag(model.getFlags(), mask, flag));
		}
	}