code: def CaffeLMDB(lmdb_path, shuffle=True, keys=None):
      """
      Read a Caffe-format LMDB file where each value contains a ``caffe.Datum`` protobuf.
      Produces datapoints of the format: [HWC image, label].
  
      Note that Caffe LMDB format is not efficient: it stores serialized raw
      arrays rather than JPEG images.
  
      Args:
          lmdb_path, shuffle, keys: same as :class:`LMDBData`.
  
      Example:
          .. code-block:: python
  
              ds = CaffeLMDB("/tmp/validation", keys='{:0>8d}')
      """
  
      cpb = get_caffe_pb()
      lmdb_data = LMDBData(lmdb_path, shuffle, keys)
  
      def decoder(k, v):
          try:
              datum = cpb.Datum()
              datum.ParseFromString(v)
              img = np.fromstring(datum.data, dtype=np.uint8)
              img = img.reshape(
                  datum.channels, datum.height, datum.width
              )
          except Exception:
              log_once("Cannot read key {}".format(k), "warn")
              return None
          return [img.transpose(1, 2, 0), datum.label]
  
      logger.warn(
          "Caffe LMDB format doesn't store jpeg-compressed images, \
          it's not recommended due to its inferior performance."
      )
      return LMDBDataDecoder(lmdb_data, decoder)
  
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 for calling a global function with example usage: CaffeLMDB(lmdb_path, shuffle, keys) and returns: LMDBDataDecoder, list, None