class_docstr: A dataset for loading image files stored in a folder structure.
  
  like::
  
      root/car/0001.jpg
      root/car/xxxa.jpg
      root/car/yyyb.jpg
      root/bus/123.jpg
      root/bus/023.jpg
      root/bus/wwww.jpg
  
  Parameters
  ----------
  root : str
      Path to root directory.
  flag : {0, 1}, default 1
      If 0, always convert loaded images to greyscale (1 channel).
      If 1, always convert loaded images to colored (3 channels).
  transform : callable, default None
      DEPRECATED FUNCTION ARGUMENTS.
      A function that takes data and label and transforms them::
  
          transform = lambda data, label: (data.astype(np.float32)/255, label)
  
  Attributes
  ----------
  synsets : list
      List of class names. `synsets[i]` is the name for the integer label `i`
  items : list of tuples
      List of all images in (filename, label) pairs.
class_docstr_tok: ["A","dataset","for","loading","image","files","stored","in","a","folder","structure",".","like",":",":","root\/car\/0001.jpg","root\/car\/xxxa.jpg","root\/car\/yyyb.jpg","root\/bus\/123.jpg","root\/bus\/023.jpg","root\/bus\/wwww.jpg","Parameters","--","--","--","--","--","root",":","str","Path","to","root","directory",".","flag",":","{","0",",","1","}",",","default","1","If","0",",","always","convert","loaded","images","to","greyscale","(","1","channel",")",".","If","1",",","always","convert","loaded","images","to","colored","(","3","channels",")",".","transform",":","callable",",","default","None","DEPRECATED","FUNCTION","ARGUMENTS",".","A","function","that","takes","data","and","label","and","transforms","them",":",":","transform","=","lambda","data",",","label",":","(","data.astype","(","np.float32",")","\/255",",","label",")","Attributes","--","--","--","--","--","synsets",":","list","List","of","class","names",".","`","synsets","[","i","]","`","is","the","name","for","the","integer","label","`","i","`","items",":","list","of","tuples","List","of","all","images","in","(","filename",",","label",")","pairs","."]
code: def __len__(self):
      return len(self.items)
  
imports: import os
  import gzip
  import tarfile
  import struct
  import warnings
  import numpy
  from ..None import dataset
  from ...utils import download, check_sha1, _get_repo_file_url
  from ....None import ndarray, image, recordio, base
  from ....None import numpy
  from ....util import is_np_array, default_array
  from ....base import numeric_types
label_desc: Use image node_id 4 for calling the ImageFolderDataset obj's underlying member method code with example usage: obj.__len__() and returns: len