class_docstr: `LSUN <https://www.yf.io/p/lsun>`_ dataset.
  
  You will need to install the ``lmdb`` package to use this dataset: run
  ``pip install lmdb``
  
  Args:
      root (string): Root directory for the database files.
      classes (string or list): One of {'train', 'val', 'test'} or a list of
          categories to load. e,g. ['bedroom_train', 'church_outdoor_train'].
      transform (callable, optional): A function/transform that takes in a PIL image
          and returns a transformed version. E.g, ``transforms.RandomCrop``
      target_transform (callable, optional): A function/transform that takes in the
          target and transforms it.
class_docstr_tok: ["`","LSUN","<","https",":","\/\/www.yf.io\/p\/lsun",">","`","_","dataset",".","You","will","need","to","install","the","``","lmdb","``","package","to","use","this","dataset",":","run","``","pip","install","lmdb","``","Args",":","root","(","string",")",":","Root","directory","for","the","database","files",".","classes","(","string","or","list",")",":","One","of","{","'train","'",",","'val","'",",","'test","'","}","or","a","list","of","categories","to","load",".","e",",","g",".","[","'bedroom_train","'",",","'church_outdoor_train","'","]",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a","PIL","image","and","returns","a","transformed","version",".","E.g",",","``","transforms.RandomCrop","``","target_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","the","target","and","transforms","it","."]
docstr: Args:
      index (int): Index
  
  Returns:
      tuple: Tuple (image, target) where target is the index of the target category.
docstr_tok: ["Args",":","index","(","int",")",":","Index","Returns",":","tuple",":","Tuple","(","image",",","target",")","where","target","is","the","index","of","the","target","category","."]
code: def __getitem__(self, index: int) -> Tuple[Any, Any]:
      """
      Args:
          index (int): Index
  
      Returns:
          tuple: Tuple (image, target) where target is the index of the target category.
      """
      target = 0
      sub = 0
      for ind in self.indices:
          if index < ind:
              break
          target += 1
          sub = ind
  
      db = self.dbs[target]
      index = index - sub
  
      if self.target_transform is not None:
          target = self.target_transform(target)
  
      img, _ = db[index]
      return img, target
  
imports: import io
  import os.path
  import pickle
  import string
  from collections.abc import Iterable
  from typing import Any, Callable, cast, List, Optional, Tuple, Union
  from PIL import Image
  from .utils import iterable_to_str, verify_str_arg
  from .vision import VisionDataset
label_desc: Use image node_id 3 for calling the LSUN obj's underlying member method code with example usage: obj.__getitem__(index) and returns: img,  target