code: def load_hierarchical_lmdb_dataset(self, data_dir):
      lmdb_sets = {}
      dataset_idx = 0
      for dirpath, dirnames, filenames in os.walk(data_dir + "/"):
          if not dirnames:
              env = lmdb.open(
                  dirpath,
                  max_readers=32,
                  readonly=True,
                  lock=False,
                  readahead=False,
                  meminit=False,
              )
              txn = env.begin(write=False)
              num_samples = int(txn.get("num-samples".encode()))
              lmdb_sets[dataset_idx] = {
                  "dirpath": dirpath,
                  "env": env,
                  "txn": txn,
                  "num_samples": num_samples,
              }
              dataset_idx += 1
      return lmdb_sets
  
imports: import numpy
  import os
  from paddle.io import Dataset
  import lmdb
  import cv2
  import string
  import six
  import pickle
  from PIL import Image
  from .imaug import transform, create_operators
label_desc: Use image node_id 2 for calling the LMDBDataSet obj's underlying member method code with example usage: obj.load_hierarchical_lmdb_dataset(data_dir) and returns: lmdb_sets