code: def add_file(self, path, compress):
          
          if not os.path.isfile(path):
              raise ValueError('{} is not a file'.format(path))
          self.fileobj.seek(self.last_offset)
  
          with open(path, 'rb') as f:
              flags = os.stat(path).st_mode & 0o777
              self.add_fileobj(f, path, compress, flags)
docs: Add a single file to the MAR file.
  
          Args:
              path (str): path to a file to add to this MAR file.
              compress (str): One of 'xz', 'bz2', or None. Defaults to None.