Return a boolean indicating whether a flag name is supported on
    the specified compiler.
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
108434
def flags(flags):
        
        names = sorted(
            descr for key, descr in OpCodeDebug.STREAM_CONSTANT.items() if key & flags
        )
        return ", ".join(names)
215543
def supported_tags(self, interpreter=None, force_manylinux=True):
    """"""
    if interpreter and not self.is_extended:
      # N.B. If we don't get an extended platform specifier, we generate
      # all possible ABI permutations to mimic earlier pex version
      # behavior and make cross-platform resolution more intuitive.
      return _get_supported_for_any_abi(
        platform=self.platform,
        impl=interpreter.identity.abbr_impl,
        version=interpreter.identity.impl_ver,
        force_manylinux=force_manylinux
      )
    else:
      return _get_supported(
        platform=self.platform,
        impl=self.impl,
        version=self.version,
        abi=self.abi,
        force_manylinux=force_manylinux
      )
624016
static int parseValidFlags(String flagChars, boolean hasUpperVariant) {
    int flags = hasUpperVariant ? FLAG_UPPER_CASE : 0;
    for (int i = 0; i < flagChars.length(); i++) {
      int flagIdx = indexOfFlagCharacter(flagChars.charAt(i));
      if (flagIdx < 0) {
        throw new IllegalArgumentException("invalid flags: " + flagChars);
      }
      flags |= 1 << flagIdx;
    }
    return flags;
  }
133187
def is_supported(value, check_all=False, filters=None, iterate=False):
    """"""
    assert filters is not None
    if value is None:
        return True
    if not is_editable_type(value):
        return False
    elif not isinstance(value, filters):
        return False
    elif iterate:
        if isinstance(value, (list, tuple, set)):
            valid_count = 0
            for val in value:
                if is_supported(val, filters=filters, iterate=check_all):
                    valid_count += 1
                if not check_all:
                    break
            return valid_count > 0
        elif isinstance(value, dict):
            for key, val in list(value.items()):
                if not is_supported(key, filters=filters, iterate=check_all) \
                   or not is_supported(val, filters=filters,
                                       iterate=check_all):
                    return False
                if not check_all:
                    break
    return True
531375
def pretty_flags(flags):
    """"""
    names = []
    result = "0x%08x" % flags
    for i in range(32):
        flag = 1 << i
        if flags & flag:
            names.append(COMPILER_FLAG_NAMES.get(flag, hex(flag)))
            flags ^= flag
            if not flags:
                break
    else:
        names.append(hex(flags))
    names.reverse()
    return "%s (%s)" % (result, " | ".join(names))
438402
function validate(flags) {
  if (!flags) return false;

  if (flags.binary)
    throw new Error('binary stream not supported');

  if (flags.masked)
    throw new Error('masked stream not supported');

  return true;
}
1077271
public static final boolean dbFlag(final String flag) {
        return flag != null
                && (FLAG_TRUE.equalsIgnoreCase(flag) || FLAG_TRUE_OTHER.equalsIgnoreCase(flag));
    }
582923
private boolean matches(String classname, AccessFlags flags) {
        if (options.apiOnly && !flags.is(AccessFlags.ACC_PUBLIC)) {
            return false;
        } else if (options.includePattern != null) {
            return options.includePattern.matcher(classname.replace('/', '.')).matches();
        } else {
            return true;
        }
    }
632674
private static boolean isVMMultidexCapable() {
        boolean isMultidexCapable = false;
        String vmVersion = System.getProperty("java.vm.version");
        try {
            Matcher matcher = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?").matcher(vmVersion);
            if (matcher.matches()) {
                int major = Integer.parseInt(matcher.group(1));
                int minor = Integer.parseInt(matcher.group(2));
                isMultidexCapable = (major > 2) || ((major == 2) && (minor >= 1));
            }
        } catch (Exception ignore) {
        }
        String multidex = isMultidexCapable ? "has Multidex support" : "does not have Multidex support";
        Log.i(AndServer.TAG, String.format("VM with version %s %s.", vmVersion, multidex));
        return false;
    }
891183
def DEFINE_boolean(flag_name, default_value, docstring):  # pylint: disable=invalid-name
    

    # Register a custom function for 'bool' so --flag=True works.
    def str2bool(bool_str):
        """Return a boolean value from a give string."""
        return bool_str.lower() in ('true', 't', '1')

    get_context_parser().add_argument(
        '--' + flag_name,
        nargs='?',
        const=True,
        help=docstring,
        default=default_value,
        type=str2bool)

    # Add negated version, stay consistent with argparse with regard to
    # dashes in flag names.
    get_context_parser().add_argument(
        '--no' + flag_name,
        action='store_false',
        dest=flag_name.replace('-', '_'))
331341
def _supports_avx():
    """"""
    if os.path.exists("/proc/cpuinfo"):
        with open("/proc/cpuinfo") as in_handle:
            for line in in_handle:
                if line.startswith("flags") and line.find("avx") > 0:
                    return True
899750
def compile(pattern, flags=0, auto_compile=None):  # noqa A001
    """"""

    if isinstance(pattern, Bre):
        if auto_compile is not None:
            raise ValueError("Cannot compile Bre with a different auto_compile!")
        elif flags != 0:
            raise ValueError("Cannot process flags argument with a compiled pattern")
        return pattern
    else:
        if auto_compile is None:
            auto_compile = True

        return Bre(compile_search(pattern, flags), auto_compile)
1254851
def filter_flags(parsed_flags, valid_flags):
    """"""
    def valid_argv(argv):
        """Figures out if a flag parsed from the flagfile matches a flag in
        the command about to be run."""
        flagname_match = FLAG_RE.match(argv)
        if not flagname_match:
            return True
        flagname = flagname_match.group()
        return flagname in valid_flags
    return list(filter(valid_argv, parsed_flags))
181584
def flag(short_name, long_name, description, &block)
			return define_value(short_name, long_name, description, true, false, block)
		end
164666
def add_openmp_flags_if_available(extension):
    

    if _ASTROPY_DISABLE_SETUP_WITH_OPENMP_:
        log.info("OpenMP support has been explicitly disabled.")
        return False

    openmp_flags = get_openmp_flags()
    using_openmp = check_openmp_support(openmp_flags=openmp_flags)

    if using_openmp:
        compile_flags = openmp_flags.get('compiler_flags')
        link_flags = openmp_flags.get('linker_flags')
        log.info("Compiling Cython/C/C++ extension with OpenMP support")
        extension.extra_compile_args.extend(compile_flags)
        extension.extra_link_args.extend(link_flags)
    else:
        log.warn("Cannot compile Cython/C/C++ extension with OpenMP, reverting "
                 "to non-parallel code")

    return using_openmp
363685
@Deprecated
    @Override
    public boolean getFlag(int flagType) {
        boolean val = false;
        boolean leftFlag = left.getFlag(flagType);
        if (right != null) {
            if ("and".equals(operator) && leftFlag) {
                boolean rightFlag = right.getFlag(flagType);
                val = leftFlag && rightFlag;
            } else if ("or".equals(operator)) {
                boolean rightFlag = right.getFlag(flagType);
                val = leftFlag || rightFlag;
            }
        } else {
            if ("not".equals(operator)) {
                val = (!leftFlag);
            } else {
                val = leftFlag;
            }
        }
        return val;
    }