Checks whether flag_string contain a --flagfile=<foo> directive.
335258
def _is_flag_file_directive(self, flag_string):
    """"""
    if isinstance(flag_string, type('')):
      if flag_string.startswith('--flagfile='):
        return 1
      elif flag_string == '--flagfile':
        return 1
      elif flag_string.startswith('-flagfile='):
        return 1
      elif flag_string == '-flagfile':
        return 1
      else:
        return 0
    return 0
1154411
def matches(self, regex, flags=0):
        
        return self._generate_test(
            lambda value: re.match(regex, value, flags),
            ('matches', self._path, regex)
        )
761454
public static function findPostsByFlag ($flag, $post_type = PostTypes::ANY)
    {
        return Post::findByExactMeta($flag, Checkbox::ON, $post_type);
    }
993449
public static function hasFlag(string $flag) : bool
    {
        // Standardize the flag name - remove starting hyphens.
        $flag = ltrim($flag, '-');

        // Return the check right away if it's already cached.
        if (isset(static::$flags[$flag])) {
            return static::$flags[$flag];
        }

        // Grab the output of phpinfo(). If INFO_ALL is already available, we will just parse it instead of
        // fetching INFO_GENERAL specifically for our case. Then we are simply going to check if the --string
        // appears in the info.
        $result = strpos(static::$info[INFO_ALL] ?? static::getInfo(INFO_GENERAL), '--'.$flag);

        // Cache the result and return it.
        return static::$flags[$flag] = false !== $result;
    }
347707
def contains_glob(path_to_directory, pattern, wanted=None):
    """"""
    if not path_to_directory:
        return False
    needed = make_needed(pattern, path_to_directory, wanted)
    for name in _names_in_directory(path_to_directory):
        if needed(name):
            return True
    return False
1210680
function shouldIgnore(filename) {
  if (!ignore && !only) {
    return getRelativePath(filename).split(_path2["default"].sep).indexOf("node_modules") >= 0;
  } else {
    return util.shouldIgnore(filename, ignore || [], only);
  }
}
1225075
private INodeFileUnderConstruction checkLease(String src, String holder)
    throws IOException {
    INodeFile file = dir.getFileINode(src);
    return checkLease(src, holder, file);
  }
527361
def is_fasta(filename):
    
    if re.search("\.fa*s[ta]*$", filename, flags=re.I):
        return True
    elif re.search("\.fa$", filename, flags=re.I):
        return True
    else:
        return False
181584
def flag(short_name, long_name, description, &block)
			return define_value(short_name, long_name, description, true, false, block)
		end
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;
  }
62196
private boolean isSpecialFlagSet(final OptionSet parsedArguments, final String flagName){
        if (parsedArguments.has(flagName)){
            Object value = parsedArguments.valueOf(flagName);
            return  (value == null || !value.equals("false"));
        } else{
            return false;
        }
    }
1308709
function isIgnoredFile(file) {
    if (options.ignore !== undefined) {
      var result = false;

      options.ignore.forEach(function(pattern) {
        if (minimatch(file, pattern)) {
          result = true;
          return false;
        }
      });

      return result;
    }

    return false;
  }
665692
def is_potential_flag(token: str, parser: argparse.ArgumentParser) -> bool:
    """"""
    # if it's an empty string, it was meant to be a positional
    if not token:
        return False

    # if it doesn't start with a prefix, it was meant to be positional
    if not token[0] in parser.prefix_chars:
        return False

    # if it's just a single character, it was meant to be positional
    if len(token) == 1:
        return False

    # if it looks like a negative number, it was meant to be positional
    # unless there are negative-number-like options
    if parser._negative_number_matcher.match(token):
        if not parser._has_negative_number_optionals:
            return False

    # if it contains a space, it was meant to be a positional
    if ' ' in token:
        return False

    # Looks like a flag
    return True
766427
def __add_flag (rule_or_module, variable_name, condition, values):
    
    assert isinstance(rule_or_module, basestring)
    assert isinstance(variable_name, basestring)
    assert is_iterable_typed(condition, property_set.PropertySet)
    assert is_iterable(values) and all(
        isinstance(v, (basestring, type(None))) for v in values)
    f = Flag(variable_name, values, condition, rule_or_module)

    # Grab the name of the module
    m = __re_first_segment.match (rule_or_module)
    assert m
    module = m.group(1)

    __module_flags.setdefault(module, []).append(f)
    __flags.setdefault(rule_or_module, []).append(f)
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;
    }
1348112
private boolean isValidFile(String s, Set<JavaFileObject.Kind> fileKinds) {
        JavaFileObject.Kind kind = getKind(s);
        return fileKinds.contains(kind);
    }
672356
def find_root_with_flag(flag, default=nil)
      root_path = self.called_from[0]

      while root_path && ::File.directory?(root_path) && !::File.exist?("#{root_path}/#{flag}")
        parent = ::File.dirname(root_path)
        root_path = parent != root_path && parent
      end

      root = ::File.exist?("#{root_path}/#{flag}") ? root_path : default
      raise "Could not find root path for #{self}" unless root

      RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ?
      Pathname.new(root).expand_path : Pathname.new(root).realpath
    end