code: def _is_path_excluded(self, path):
          
          exclude = self._exclude
          if not exclude:
              return False
          basename = os.path.basename(path)
          if self._fnmatch(basename, exclude):
              return True
  
          absolute_path = os.path.abspath(path)
          match = self._fnmatch(absolute_path, exclude)
          return match
docs: Check if a path is excluded.
  
          :param str path:
              Path to check against the exclude patterns.
          :returns:
              True if there are exclude patterns and the path matches,
              otherwise False.