test if {@code robotflags} field has flag {@code flag} set.
@param flag one flag to test
@return {@code true} if {@code flag} is set.
509379
public boolean isRobotFlagSet(char flag) {
		String flags = getRobotFlags();
		return flags != null && flags.indexOf(flag) >= 0;
	}
637666
public final boolean setScheduledForFlush(boolean flag) {
        if (flag) {
            // If the current tag is set to false, switch it to true
            return scheduledForFlush.compareAndSet(false, true);
        }

        scheduledForFlush.set(false);
        return true;
    }
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)
166527
@SuppressWarnings({"deprecation", "WeakerAccess"})
    protected boolean isFlagPresent(final AttributeAccess.Flag flag) {
        if (flags == null) { return false; }
        for (AttributeAccess.Flag f : flags) {
            if (f.equals(flag)) { return true; }
        }
        return false;
    }
945935
protected boolean containsFlag(final char flag, final String flags) {
        if (flags == null) return false;
        return flags.indexOf(flag) >= 0;
    }
431702
public boolean isField(final String fieldName) {
    if (fieldName != null) {
        return (KEYWORD_LIST.contains(
                fieldName.toUpperCase(Locale.US))
                || fieldName.toUpperCase().startsWith(PROP_FIELD));
    }
    return false;
  }
968953
def has_flag(compiler, flagname):
    
    with TemporaryDirectory() as tmpdir, \
            stdchannel_redirected(sys.stderr, os.devnull), \
            stdchannel_redirected(sys.stdout, os.devnull):
        f = tempfile.mktemp(suffix='.cpp', dir=tmpdir)
        with open(f, 'w') as fh:
            fh.write('int main (int argc, char **argv) { return 0; }')
        try:
            compiler.compile([f], extra_postargs=[flagname], output_dir=tmpdir)
        except setuptools.distutils.errors.CompileError:
            return False
    return True
313914
static void checkHeapFlags(final int flags) {  //only used by checkPreLongsFlagsCap and test
    final int allowedFlags =
        READ_ONLY_FLAG_MASK | EMPTY_FLAG_MASK | COMPACT_FLAG_MASK | ORDERED_FLAG_MASK;
    final int flagsMask = ~allowedFlags;
    if ((flags & flagsMask) > 0) {
      throw new SketchesArgumentException(
         "Possible corruption: Invalid flags field: " + Integer.toBinaryString(flags));
    }
  }
103754
public function hasFlags(array $flags, bool $matchAll = false) : bool
    {
        $matched = false;
        $userFlags = $this->getUserFlags();

        foreach ($flags as $flag) {
            if (in_array($flag, $userFlags)) {
                if ($matchAll) {
                    $matched = true;
                    continue;
                }

                $matched = true;
            } else {
                if ($matchAll) {
                    return false;
                }

                $matched = false;
            }
        }

        return $matched;
    }
452164
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case RESTART_FLAG:
      return isSetRestartFlag();
    }
    throw new IllegalStateException();
  }
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));
		}
	}
164458
public boolean isAttrFlagSet(String name, int flags)
    {
        return (null != m_attrs)
            ? ((m_attrs.getIgnoreCase(name) & flags) != 0)
            : false;
    }
1069497
protected void ensureNoFlags(final String flags) {
        if (flags == null || flags.isEmpty()) return;
        throw FormatException.formatFlagsMismatch(flags, getFormatName());
    }
885152
public function setFlag(string $flag, $numbers): bool
    {
        return \imap_setflag_full($this->resource->getStream(), $this->prepareMessageIds($numbers), $flag, \ST_UID);
    }
1253373
private function isFlagEnabled($flag): bool
    {
        $flag = $this->parseFlag($flag);

        return $flag === ($this->flags & $flag);
    }
1212988
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case START_TOKEN:
      return isSetStart_token();
    case END_TOKEN:
      return isSetEnd_token();
    case ENDPOINTS:
      return isSetEndpoints();
    case RPC_ENDPOINTS:
      return isSetRpc_endpoints();
    case ENDPOINT_DETAILS:
      return isSetEndpoint_details();
    }
    throw new IllegalStateException();
  }
1356079
public static String isValidReason(Geometry geometry, int flag) {
        if (geometry != null) {
            if (flag == 0) {
                return validReason(geometry, false);
            } else if (flag == 1) {
                return validReason(geometry, true);
            } else {
                throw new IllegalArgumentException("Supported arguments are 0 or 1.");
            }
        }
        return "Null Geometry";
    }