class_docstr: Read a LMDB database and produce (k,v) raw bytes pairs.
  The raw bytes are usually not what you're interested in.
  You might want to use
  :class:`LMDBDataDecoder` or apply a
  mapper function after :class:`LMDBData`.
class_docstr_tok: ["Read","a","LMDB","database","and","produce","(","k",",","v",")","raw","bytes","pairs",".","The","raw","bytes","are","usually","not","what","you","'re","interested","in",".","You","might","want","to","use",":","class",":","`","LMDBDataDecoder","`","or","apply","a","mapper","function","after",":","class",":","`","LMDBData","`","."]
docstr: 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 given, it will then look in the database for ``__keys__`` which
          :func:`LMDBSerializer.save` used to store the list of keys.
          If still not found, it will iterate over the database to find
          all the keys.
docstr_tok: ["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","given",",","it","will","then","look","in","the","database","for","``","__keys__","``","which",":","func",":","`","LMDBSerializer.save","`","used","to","store","the","list","of","keys",".","If","still","not","found",",","it","will","iterate","over","the","database","to","find","all","the","keys","."]
code: def __init__(self, lmdb_path, shuffle=True, keys=None):
      """
      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 given, it will then look in the database for ``__keys__`` which
              :func:`LMDBSerializer.save` used to store the list of keys.
              If still not found, it will iterate over the database to find
              all the keys.
      """
      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)
      )
  
      # Clean them up after finding the list of keys, since we don't want to fork them
      self._close_lmdb()
  
imports: import numpy
  import os
  import six
  from ..utils import logger
  from ..utils.argtools import log_once
  from ..utils.serialize import loads
  from ..utils.develop import create_dummy_class
  from ..utils.loadcaffe import get_caffe_pb
  from ..utils.timer import timed_operation
  from ..utils.utils import get_tqdm
  from .base import DataFlowReentrantGuard, RNGDataFlow
  from .common import MapData
label_desc: Use image node_id 1 to create a new LMDBData object from inherited base classes: RNGDataFlow with example: obj = LMDBData(lmdb_path, shuffle, keys)