code: def load(self, dbfile, password=None, keyfile=None, readonly=False):
          
          
          self._clear()
          buf = None
          is_stream = hasattr(dbfile, 'read') 
          if is_stream:
              buf = dbfile.read()
          else:
              if not os.path.exists(dbfile):
                  raise IOError("File does not exist: {0}".format(dbfile))
              
              with open(dbfile, 'rb') as fp:
                  buf = fp.read()
                  
          self.load_from_buffer(buf, password=password, keyfile=keyfile, readonly=readonly)
          
          # One we have successfully loaded the file, go ahead and set the internal attribute
          # (in the LockingDatabase subclass, this will effectivley take out the lock on the file)
          if not is_stream:
              self.filepath = dbfile
docs: Load the database from file/stream.
          
          :param dbfile: The database file path/stream.
          :type dbfile: str or file-like object
          :param password: The password for the database.
          :type password: str
          :param keyfile: Path to a keyfile (or a stream) that can be used instead of or in conjunction with password for database.
          :type keyfile: str or file-like object
          :param readonly: Whether to open the database read-only.
          :type readonly: bool