Exclude paths like QtFoo/Bar, but grab frameworks
495304
def missing_headers
      super
      @missing_headers.reject! do | path |
        m = path.match( /^(Qt\w+)\/(\w+?(?:\.h)?)$/ )
        if m
          framework      = m[ 1 ]
          @frameworks << framework
          framework_path = Compiler::GCC.framework_path( framework, qt_major )
          header_path    = "#{ framework_path }/#{ m[ 2 ] }"
          File.exist?( header_path )
        else
          false
        end
      end

      @frameworks.each do | framework |
        @include_paths << Compiler::GCC.framework_path( framework, qt_major )
        @include_paths << "/usr/include/#{ framework }"
      end

      # Last chance: exclude headers of the form 'Aaaaaa' if found under frameworks
      @missing_headers.reject! do | header |
        @frameworks.any? do | framework |
          framework_path = Compiler::GCC.framework_path( framework, qt_major )
          header_path    = "#{ framework_path }/#{ header }"
          File.exist?( header_path )
        end
      end

      @missing_headers
    end
310754
def exclude?(path)
      exclude.include?(path) ||
        exclude.include?(path.split(METHOD_SEPARATOR).first)
    end
231179
def no_args(**kwargs):
    """"""
    from benchbuild.utils.cmd import uchroot as uchrt

    prefixes = CFG["container"]["prefixes"].value
    p_paths, p_libs = env(prefixes)
    uchrt = run.with_env_recursive(
        uchrt,
        LD_LIBRARY_PATH=path.list_to_path(p_libs),
        PATH=path.list_to_path(p_paths))

    return uchrt
112069
def recurse_tree(rootpath, excludes, opts):
    # type: (unicode, List[unicode], Any) -> List[unicode]
    
    if INITPY in os.listdir(rootpath):
        path_prefix = path.sep.join(rootpath.split(path.sep)[:-1])
    else:
        path_prefix = rootpath

    toplevels = []
    followlinks = getattr(opts, 'followlinks', False)
    includeprivate = getattr(opts, 'includeprivate', False)
    implicit_namespaces = getattr(opts, 'implicit_namespaces', False)
    for root, subs, files in walk(rootpath, followlinks=followlinks):
        # document only Python module files (that aren't excluded)
        py_files = sorted(f for f in files
                          if path.splitext(f)[1] in PY_SUFFIXES and
                          not is_excluded(path.join(root, f), excludes))
        is_pkg = INITPY in py_files
        if is_pkg:
            py_files.remove(INITPY)
            py_files.insert(0, INITPY)
        elif root != rootpath:
            # only accept non-package at toplevel unless using implicit
            # namespaces
            if not implicit_namespaces:
                del subs[:]
                continue
        # remove hidden ('.') and private ('_') directories, as well as
        # excluded dirs
        if includeprivate:
            exclude_prefixes = ('.',)  # type: Tuple[unicode, ...]
        else:
            exclude_prefixes = ('.', '_')
        subs[:] = sorted(sub for sub in subs
                         if not sub.startswith(exclude_prefixes) and
                         not is_excluded(path.join(root, sub), excludes))

        pkg = root[len(path_prefix):].lstrip(path.sep).replace(path.sep, '.')
        for py_file in py_files:
            if not shall_skip(path.join(root, py_file), opts):
                if py_file == INITPY:
                    module = ''
                else:
                    module = path.splitext(py_file)[0]
                toplevels.append(makename(pkg, module))

    return toplevels
846975
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def visible(app):
        return VisibleFilter(app, conf)
    return visible
24800
function dumpTree(dirname, shouldPrune, cb) {
    var args = ['-type', 'f'];
    if(shouldPrune) {
        args = EXCLUDED_ARGS.concat(args);
    }

    find(dirname, args, cb);
}
900109
def _get_paths(self):
        """"""
        ret = []
        ret += ['%s/library/' % os.path.dirname(os.path.dirname(__file__))]        
        
        ret += self._extra_dirs
        for basedir in _basedirs:
            fullpath = os.path.join(basedir, self.subdir)
            if fullpath not in ret:
                ret.append(fullpath)
        ret += self.config.split(os.pathsep)
        ret += self._get_package_path()
        return ret
48234
function filter(options, includes, root, filepath, stat) {
  var paths = path.relative(root, filepath).split(path.sep);
  // always include test/tests directory when running jpm test
  if (options.command === "test") {
    if (/^tests?$/.test(paths[0])) {
      if (paths.length === 1 && stat.isDirectory()) {
        return true;
      }
      if (paths.length > 1) {
        return true;
      }
    }
  }
  return includes.indexOf(filepath) !== -1;
}
1045698
def get_exclude_paths(registry):
    
    # TODO(#63): remove deprecated `skip_validation` setting in v2.0.
    regexes = registry.settings.get(
        'pyramid_swagger.skip_validation',
        registry.settings.get(
            'pyramid_swagger.exclude_paths',
            DEFAULT_EXCLUDED_PATHS
        )
    )

    # being nice to users using strings :p
    if not isinstance(regexes, list) and not isinstance(regexes, tuple):
        regexes = [regexes]

    return [re.compile(r) for r in regexes]
1071175
def collect(basepath, exclude=None, processPlugins=True):
    
    if exclude is None:
        exclude = ['.py', '.pyc', '.pyo', '.css', '.exe']

    imports = []
    datas = []

    # walk the folder structure looking for all packages and data files
    basename = os.path.basename(basepath)
    basepath = os.path.abspath(basepath)
    baselen = len(basepath) - len(basename)

    plugfiles = []

    for root, folders, files in os.walk(basepath):
        if '.svn' in root or '.git' in root:
            continue

        # mark the plugins file for load
        plugdata = None
        if processPlugins and '__plugins__.py' in files:
            filename = os.path.join(root, '__plugins__.py')
            package = projex.packageFromPath(filename) + '.__plugins__'
            pkgpath = projex.packageRootPath(filename)

            if pkgpath not in sys.path:
                sys.path.insert(0, pkgpath)

            # import the plugins module
            __import__(package)
            pkg = sys.modules[package]

            recurse = getattr(pkg, '__recurse__', False)
            plugdata = {'recurse': recurse,
                        'packages': [],
                        'path': root}

            plugfiles.append(plugdata)

        # look for any recursion plugins
        else:
            for data in plugfiles:
                if data['recurse'] and root.startswith(data['path']):
                    plugdata = data
                    break

        if plugdata is not None:
            packages = plugdata['packages']

            # include package plugins
            for folder in folders:
                pkgpath = os.path.join(root, folder, '__init__.py')
                if os.path.exists(pkgpath):
                    packages.append(projex.packageFromPath(pkgpath))

        for file_ in files:
            module, ext = os.path.splitext(file_)

            # look for python modules
            if ext == '.py':
                package_path = projex.packageFromPath(os.path.join(root, file_))
                if not package_path:
                    continue

                if module != '__init__':
                    package_path += '.' + module

                imports.append(package_path)

                # test to see if this is a plugin file
                if plugdata is not None and module not in ('__init__',
                                                           '__plugins__'):
                    plugdata['packages'].append(package_path)

            # look for data
            elif ext not in exclude:
                src = os.path.join(root, file_)
                targ = os.path.join(root[baselen:])
                datas.append((src, targ))

    # save the plugin information
    for plugdata in plugfiles:
        fname = os.path.join(plugdata['path'], '__plugins__.py')
        packages = plugdata['packages']

        plugs = ',\n'.join(map(lambda x: "r'{0}'".format(x), packages))
        data = [
            '__recurse__ = {0}'.format(plugdata['recurse']),
            '__toc__ = [{0}]'.format(plugs)
        ]

        # write the data to the system
        f = open(fname, 'w')
        f.write('\n'.join(data))
        f.close()

    return imports, datas
669373
def _get_fqn(cls, path):
        
        name_list = [path.stem]
        current_path = path
        # move to parent path until parent path is a python package
        while cls.is_pkg(current_path.parent):
            name_list.append(current_path.parent.name)
            current_path = current_path.parent
        return list(reversed(name_list))
310709
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def blacklist(app):
        return BlacklistFilter(app, conf)
    return blacklist
499230
def normalize_excludes(excludes):
    """"""
    return [os.path.normpath(os.path.abspath(exclude)) for exclude in excludes]
1335659
def normalize_excludes(rootpath, excludes):
    
    sep = os.path.sep
    f_excludes = []
    for exclude in excludes:
        if not os.path.isabs(exclude) and not exclude.startswith(rootpath):
            exclude = os.path.join(rootpath, exclude)
        if not exclude.endswith(sep):
            exclude += sep
        f_excludes.append(exclude)
    return f_excludes
517977
def _GetFilePaths(self, path, pathtype, kb):
    """"""

    environ_vars = artifact_utils.GetWindowsEnvironmentVariablesMap(kb)
    path_guesses = path_detection_windows.DetectExecutablePaths([path],
                                                                environ_vars)

    if not path_guesses:
      # TODO(user): yield a ParserAnomaly object
      return []

    return [
        rdf_paths.PathSpec(path=path, pathtype=pathtype)
        for path in path_guesses
    ]
354677
function ignore(dir, options) {
  var jpmignore = path.join(dir, ".jpmignore");
  var defaultRules = ["*.zip", ".*", "test/", ".jpmignore", "*.xpi"];

  return utils.getManifest({addonDir: options.addonDir})
    .then(function(manifest) {
      return fs.exists(jpmignore);
    })
    .then(function(exists) {
      if (exists) {
        if (options.verbose) {
          console.log(".jpmignore found");
        }
        return fs.stat(jpmignore)
          .then(function(stat) {
            if (stat.isFile()) {
              return fs.readFile(jpmignore)
                .then(function(data) {
                  return data.toString().replace(/[\r\n]/, "\n").split("\n");
                });
            } else {
              console.warn(
                ".jpmignore is not a file, fallback to use " +
                  "default filter rules");
              return defaultRules;
            }
          });
      } else {
        if (options.verbose) {
          console.warn(
            ".jpmignore does not exist, fallback to use default filter rules");
        }
        return defaultRules;
      }
    })
    .then(function(lines) {
      // Add "manifest.json" to always exclude it from the xpi (See
      // https://github.com/mozilla-jetpack/jpm/pull/566 for rationale),
      // but ensure the "webextension/manifest.json", that is used for the
      // webextension embedded in an SDK hybrid add-on, is always included
      // (See https://github.com/mozilla-jetpack/jpm/pull/578 for rationale).
      lines = ["manifest.json", "!webextension/manifest.json"].concat(lines);

      var rules = lines.filter(function(e) {
        // exclude blank lines and comments
        return !/^\s*(#|$)/.test(e);
      });
      // http://git-scm.com/docs/gitignore
      // the last matching pattern decides the outcome
      // reverse rules and break at first matched rule when filtering
      return rules.reverse().map(function(rule) {
        return new Minimatch(rule, {
          matchBase: true,
          dot: true,
          flipNegate: true
        });
      });
    })
    .then(function(rules) {
      return listdir(dir, rules, dir, true);
    });
}
1028827
function stripCommonPath(paths) {
  var prefix = commonPrefix(paths);
  var prefixLength = prefix.lastIndexOf('/') + 1;

  return paths.map(function(str) {
    return str.slice(prefixLength);
  });
}