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","`","."]
code: def _set_keys(self, keys=None):
      def find_keys(txn, size):
          logger.warn(
              "Traversing the database to find keys is slow. Your should specify the keys."
          )
          keys = []
          with timed_operation(
              "Loading LMDB keys ...", log_start=True
          ), get_tqdm(total=size) as pbar:
              for k in self._txn.cursor():
                  assert k[0] != b"__keys__"
                  keys.append(k[0])
                  pbar.update()
          return keys
  
      self.keys = self._txn.get(b"__keys__")
      if self.keys is not None:
          self.keys = loads(self.keys)
          self._size -= 1  # delete this item
  
      if self._shuffle:  # keys are necessary when shuffle is True
          if keys is None:
              if self.keys is None:
                  self.keys = find_keys(self._txn, self._size)
          else:
              # check if key-format like '{:0>8d}' was given
              if isinstance(keys, six.string_types):
                  self.keys = [
                      keys.format(x) for x in np.arange(self._size)
                  ]
              else:
                  self.keys = keys
  
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 2 for calling the LMDBData obj's underlying member method code with example usage: obj._set_keys(keys) and returns: keys