class_docstr: A dataset for loading image files specified by a list of entries.
  
  like::
  
      # if written to text file *.lst
      0       0       root/car/0001.jpg
      1       0       root/car/xxxa.jpg
      2       0       root/car/yyyb.jpg
      3       1       root/bus/123.jpg
      4       1       root/bus/023.jpg
      5       1       root/bus/wwww.jpg
  
      # if as a pure list, each item is a list [imagelabel: float or list of float, imgpath]
      [[0, root/car/0001.jpg]
       [0, root/car/xxxa.jpg]
       [0, root/car/yyyb.jpg]
       [1, root/bus/123.jpg]
       [1, root/bus/023.jpg]
       [1, root/bus/wwww.jpg]]
  
  Parameters
  ----------
  root : str
      Path to root directory.
  imglist : str or list
      Specify the path of imglist file or a list directly
  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).
  
  Attributes
  ----------
  items : list of tuples
      List of all images in (filename, label) pairs.
class_docstr_tok: ["A","dataset","for","loading","image","files","specified","by","a","list","of","entries",".","like",":",":","#","if","written","to","text","file","*",".lst","0","0","root\/car\/0001.jpg","1","0","root\/car\/xxxa.jpg","2","0","root\/car\/yyyb.jpg","3","1","root\/bus\/123.jpg","4","1","root\/bus\/023.jpg","5","1","root\/bus\/wwww.jpg","#","if","as","a","pure","list",",","each","item","is","a","list","[","imagelabel",":","float","or","list","of","float",",","imgpath","]","[","[","0",",","root\/car\/0001.jpg","]","[","0",",","root\/car\/xxxa.jpg","]","[","0",",","root\/car\/yyyb.jpg","]","[","1",",","root\/bus\/123.jpg","]","[","1",",","root\/bus\/023.jpg","]","[","1",",","root\/bus\/wwww.jpg","]","]","Parameters","--","--","--","--","--","root",":","str","Path","to","root","directory",".","imglist",":","str","or","list","Specify","the","path","of","imglist","file","or","a","list","directly","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",")",".","Attributes","--","--","--","--","--","items",":","list","of","tuples","List","of","all","images","in","(","filename",",","label",")","pairs","."]
code: def __getitem__(self, idx):
      key = self._imgkeys[idx]
      img = image.imread(self._imglist[key][1], self._flag)
      label = self._imglist[key][0]
      return img, label
  
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 2 for calling the ImageListDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: img,  label