docs: def check_io_access(ioobj, access, is_file=False):
      ''' check if a file/folder exists and has a given IO access '''
      if ((is_file and not os.path.isfile(ioobj)) or
          (not is_file and not os.path.isdir(ioobj)) or
              not os.access(ioobj, access)):
              _objtype = "File" if is_file else "Directory"
              raise IOError("Error accessing %s: %s" % (_objtype, ioobj))