'Args:
lmdb_path (str): a directory or a file.
shuffle (bool): shuffle the keys or not.
keys (list[str] or str): list of str as the keys, used only when shuffle is True.
It can also be a format string e.g. ``{:0>8d}`` which will be
formatted with the indices from 0 to *total_size - 1*.
If not provided, it will then look in the database for ``__keys__`` which
:func:`dump_dataflow_to_lmdb` used to store the list of keys.
If still not found, it will iterate over the database to find
all the keys.'

def __init__(self, lmdb_path, shuffle=True, keys=None):

    self._lmdb_path = lmdb_path
    self._shuffle = shuffle
    self.open_lmdb()
    self._size = self._txn.stat()['entries']
    self._set_keys(keys)
    logger.info('Found    {}    entries    in    {}'.format(self._size, self._lmdb_path))
    self._guard = DataFlowReentrantGuard()
