code: def isvalid(path, access=None, extensions=None, filetype=None, minsize=None):
      
      return ((access is None or os.access(path, access)) and
              (extensions is None or checkext(path, extensions)) and
              (((filetype == 'all' and os.path.exists(path)) or
                (filetype == 'dir' and os.path.isdir(path)) or
                (filetype == 'file' and os.path.isfile(path))) or
               filetype is None) and
              (minsize is None or (not os.path.isfile(path) or
                                   os.path.getsize(path) > minsize)))
docs: Check whether file meets access, extension, size, and type criteria.