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","."]
code: def _verify_classes(
      self, classes: Union[str, List[str]]
  ) -> List[str]:
      categories = [
          "bedroom",
          "bridge",
          "church_outdoor",
          "classroom",
          "conference_room",
          "dining_room",
          "kitchen",
          "living_room",
          "restaurant",
          "tower",
      ]
      dset_opts = ["train", "val", "test"]
  
      try:
          classes = cast(str, classes)
          verify_str_arg(classes, "classes", dset_opts)
          if classes == "test":
              classes = [classes]
          else:
              classes = [c + "_" + classes for c in categories]
      except ValueError:
          if not isinstance(classes, Iterable):
              msg = "Expected type str or Iterable for argument classes, but got type {}."
              raise ValueError(msg.format(type(classes)))
  
          classes = list(classes)
          msg_fmtstr_type = "Expected type str for elements in argument classes, but got type {}."
          for c in classes:
              verify_str_arg(
                  c, custom_msg=msg_fmtstr_type.format(type(c))
              )
              c_short = c.split("_")
              category, dset_opt = "_".join(c_short[:-1]), c_short[-1]
  
              msg_fmtstr = (
                  "Unknown value '{}' for {}. Valid values are {{{}}}."
              )
              msg = msg_fmtstr.format(
                  category, "LSUN class", iterable_to_str(categories)
              )
              verify_str_arg(
                  category, valid_values=categories, custom_msg=msg
              )
  
              msg = msg_fmtstr.format(
                  dset_opt, "postfix", iterable_to_str(dset_opts)
              )
              verify_str_arg(
                  dset_opt, valid_values=dset_opts, custom_msg=msg
              )
  
      return classes
  
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 2 for calling the LSUN obj's underlying member method code with example usage: obj._verify_classes(classes) and returns: classes