class_docstr: Dataset of image and label pairs built from a list of paths and labels.
  
  This dataset reads an external image file like :class:`ImageDataset`. The
  difference from :class:`ImageDataset` is that this dataset also returns a
  label integer. The paths and labels are given as either a list of pairs or
  a text file contains paths/labels pairs in distinct lines. In the latter
  case, each path and corresponding label are separated by white spaces. This
  format is same as one used in Caffe.
  
  .. note::
     **This dataset requires the Pillow package being installed.** In order
     to use this dataset, install Pillow (e.g. by using the command ``pip
     install Pillow``). Be careful to prepare appropriate libraries for image
     formats you want to use (e.g. libpng for PNG images, and libjpeg for JPG
     images).
  
  .. warning::
     **You are responsible for preprocessing the images before feeding them
     to a model.** For example, if your dataset contains both RGB and
     grayscale images, make sure that you convert them to the same format.
     Otherwise you will get errors because the input dimensions are different
     for RGB and grayscale images.
  
  Args:
      pairs (str or list of tuples): If it is a string, it is a path to a
          text file that contains paths to images in distinct lines. If it is
          a list of pairs, the ``i``-th element represents a pair of the path
          to the ``i``-th image and the corresponding label. In both cases,
          each path is a relative one from the root path given by another
          argument.
      root (str): Root directory to retrieve images from.
      dtype: Data type of resulting image arrays. ``chainer.config.dtype`` is
          used by default (see :ref:`configuration`).
      label_dtype: Data type of the labels.
code: def __len__(self):
      return len(self._pairs)
  
imports: import bisect
  import io
  import os
  import threading
  import zipfile
  import numpy
  import six
  import chainer
  from chainer.dataset import dataset_mixin
label_desc: Use image node_id 2 for calling the LabeledImageDataset obj's underlying member method code with example usage: obj.__len__() and returns: len