code: def _valid_file(self, base, name):
          
  
          valid = False
          fullpath = os.path.join(base, name)
          if self.file_check is not None and self.compare_file(fullpath[self._base_len:] if self.file_pathname else name):
              valid = True
          if valid and (not self.show_hidden and util.is_hidden(fullpath)):
              valid = False
          return self.on_validate_file(base, name) if valid else valid
docs: Return whether a file can be searched.