code: def _check_scan_dir(self, fs, path, info, depth):
          # type: (FS, Text, Info, int) -> bool
          
          if self.max_depth is not None and depth >= self.max_depth:
              return False
          return self.check_scan_dir(fs, path, info)
docs: Check if a directory contents should be scanned.