<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _is_excluded(self, path, dir_only):
 """Check if file is excluded."""


        return self.npatterns and self._match_excluded(path, self.npatterns)