Checks if a file passes match an excluded path.

@return boolean Returns `true` if match an excluded path, `false` otherwise.
494865
protected function _excluded($path)
    {
        foreach ($this->_exclude as $exclude) {
            if (fnmatch($exclude, $path)) {
                return true;
            }
        }
        return false;
    }
1245167
public function accept()
    {
        if (!$this->matchRegexps && !$this->noMatchRegexps) {
            return true;
        }

        $fileinfo = $this->current();

        if ($fileinfo->isDir() || !$fileinfo->isReadable()) {
            return false;
        }

        $content = $fileinfo->getContents();
        if (!$content) {
            return false;
        }

        return $this->isAccepted($content);
    }
1021685
public function match($include = '', $exclude = '')
    {
        $extract = true;
        if ($include && !preg_match($include, $this->getPath())) {
            $extract = false;
        }
        if ($exclude && preg_match($exclude, $this->getPath())) {
            $extract = false;
        }

        return $extract;
    }
636516
public static boolean excludePath(String path) {
        String[] excludePatterns = SiteProperties.getExcludePatterns();
        if (ArrayUtils.isNotEmpty(excludePatterns)) {
            return RegexUtils.matchesAny(path, excludePatterns);
        } else {
            return false;
        }
    }
127331
protected function fileExists()
    {
        $this->clearStatCache(true);
        return (file_exists($this->file_path) && is_file($this->file_path));
    }
1193024
public static function checkOnDisk()
    {
        $args = func_get_args();
        if (count($args) == 2)
            $module = $args[0] . DIRECTORY_SEPARATOR . $args[1];
        elseif (count($args) == 1)
            $module = $args[1];
        else
            throw  new \Exception();
        $module = str_replace('\\', DIRECTORY_SEPARATOR, $module);
        return (bool)app('files')->exists(app_path('Modules') . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'Module.php');
    }
1027491
protected function isUrlExcluded()
    {
        $excludedUrls = $this->getAttributes('exclude_unknown_urls', null);
        $siteUrls = $this->getAttributes('urls', null);

        if (!empty($excludedUrls) && !empty($siteUrls)) {
            $url = $this->request->getParam('url');
            $parsedUrl = parse_url($url);

            $trackingUrl = new SiteUrls();
            $urls = $trackingUrl->groupUrlsByHost(array($this->idSite => $siteUrls));

            $idSites = $trackingUrl->getIdSitesMatchingUrl($parsedUrl, $urls);
            $isUrlExcluded = !isset($idSites) || !in_array($this->idSite, $idSites);

            return $isUrlExcluded;
        }

        return false;
    }
1013416
function isIgnoringFiles(path){
    if (!ignoring_files.length) return false;

    for (var i = 0, l = ignoring_files.length; i < l; i++){
        if (minimatch(path, ignoring_files[i])) return true;
    }

    return false;
}
695532
private function should_ignore() {
        $parts = explode('.', $this->relative_path);
        $ext = strtolower(end($parts));
        return in_array($ext, $this->should_ignore_extensions);
    }
4964
protected function exclude(string $path): bool
    {
        foreach ($this->exclude as $pattern) {
            $replacements = [
                '\\,' => ',',
                '*' => '.*',
            ];

            $pattern = strtr($pattern, $replacements);

            if (preg_match("|{$pattern}|i", $path) === 1) {
                return true;
            }
        }

        return false;
    }
1273136
private function validateExcludeRegex(string $path): bool
    {
        $excludeRegex = $this->config->getExcludeRegex();
        return $excludeRegex === null || Validator::regex($excludeRegex)->validate($path) !== true;
    }
1311819
public boolean isExcluded(String path) {

        path = normalizePath(path);
        List<String> pathList = new ArrayList<String>(m_allPaths);
        // m_allPaths is already sorted, we need the reverse ordering so children come before their parents
        // (we want to find the deepest parent folder of 'path' that is marked as include/exclude)
        Collections.reverse(pathList);
        for (String pathInList : pathList) {
            if (CmsStringUtil.isPrefixPath(pathInList, path)) {
                return m_excludes.contains(pathInList);
            }
        }
        return false;
    }
722053
public boolean matches(String path) {
        List<String> segments;

        segments = Filesystem.SEPARATOR.split(path);
        if (segments.size() < minDepth || segments.size() > maxDepth) {
            return false;
        }
        if (predicates.size() > 0) {
            throw new UnsupportedOperationException("cannot match with predicates");
        }
        return matches(0, segments, new ArrayList<>(includes), new ArrayList<>(excludes));
    }
1308976
def is_file_excluded(filename, excludes):
    
    # check if you need to exclude this file
    return any([exclude and re.match(exclude, filename) is not None
                for exclude in excludes])
123616
public function isExcluded($exclusions, $path, $file = '')
    {
        if ($file) {
            if (!$file instanceof SplFileInfo) {
                $path = make_path([$path, $file]);
            } else {
                $path = $file->getPathname();
            }
        }

        foreach ($exclusions ?: [] as $excluded) {
            if (starts_with($path, $excluded)) {
                return true;
            }
        }

        return false;
    }
819298
def _is_request_in_exclude_path(self, request):
        """"""
        if self._exclude_paths:
            for path in self._exclude_paths:
                if request.path.startswith(path):
                    return True
            return False
        else:
            return False
278924
protected function is_file_excluded( File $phpcsFile, $path_to_file ) {
		$exclude = $this->clean_custom_array_property( $this->exclude, true, true );

		if ( ! empty( $exclude ) ) {
			$exclude      = array_map( array( $this, 'normalize_directory_separators' ), $exclude );
			$path_to_file = $this->normalize_directory_separators( $path_to_file );

			if ( ! isset( $phpcsFile->config->basepath ) ) {
				$phpcsFile->addWarning(
					'For the exclude property to work with relative file path files, the --basepath needs to be set.',
					0,
					'MissingBasePath'
				);
			}
			else {
				$base_path    = $this->normalize_directory_separators( $phpcsFile->config->basepath );
				$path_to_file = Common::stripBasepath( $path_to_file, $base_path );
			}

			// Lowercase the filename to not interfere with the lowercase/dashes rule.
			$path_to_file = strtolower( ltrim( $path_to_file, '/' ) );

			if ( isset( $exclude[ $path_to_file ] ) ) {
				// Filename is on the exclude list.
				return true;
			}
		}

		return false;
	}