class_docstr: Test ImageLoader
class_docstr_tok: ["Test","ImageLoader"]
code: def setUp(self):
      super(TestImageLoader, self).setUp()
      from PIL import Image
  
      self.current_dir = os.path.dirname(os.path.abspath(__file__))
      self.tif_image_path = os.path.join(
          self.current_dir, "a_image.tif"
      )
  
      # Create image file
      self.data_dir = tempfile.mkdtemp()
      self.face = misc.face()
      self.face_path = os.path.join(self.data_dir, "face.png")
      Image.fromarray(self.face).save(self.face_path)
      self.face_copy_path = os.path.join(self.data_dir, "face_copy.png")
      Image.fromarray(self.face).save(self.face_copy_path)
  
      # Create directory of multiple image files
      self.order_path = os.path.join(self.data_dir, "order_check")
      os.mkdir(self.order_path)
      self.face_path = os.path.join(self.order_path, "face.png")
      Image.fromarray(self.face).save(self.face_path)
      self.face_copy_path = os.path.join(
          self.order_path, "face_copy.png"
      )
      Image.fromarray(self.face).save(self.face_copy_path)
  
      # Zip directory of multiple image files
      self.order_zip_path = os.path.join(
          self.data_dir, "order_check.zip"
      )
      with zipfile.ZipFile(self.order_zip_path, "w") as zip_file:
          for foldername, subfolders, filenames in os.walk(
              self.order_path
          ):
              for filename in filenames:
                  file_path = os.path.join(foldername, filename)
                  arcname = os.path.relpath(file_path, self.order_path)
                  zip_file.write(file_path, arcname=arcname)
  
      # Create zip of image file
      self.zip_path = os.path.join(self.data_dir, "face.zip")
      zipf = zipfile.ZipFile(self.zip_path, "w", zipfile.ZIP_DEFLATED)
      zipf.write(self.face_path)
      zipf.close()
  
      # Create zip of multiple image files
      self.multi_zip_path = os.path.join(
          self.data_dir, "multi_face.zip"
      )
      zipf = zipfile.ZipFile(
          self.multi_zip_path, "w", zipfile.ZIP_DEFLATED
      )
      zipf.write(self.face_path)
      zipf.write(self.face_copy_path)
      zipf.close()
  
      # Create zip of multiple image files, multiple_types
      self.multitype_zip_path = os.path.join(
          self.data_dir, "multitype_face.zip"
      )
      zipf = zipfile.ZipFile(
          self.multitype_zip_path, "w", zipfile.ZIP_DEFLATED
      )
      zipf.write(self.face_path)
      zipf.write(self.tif_image_path)
      zipf.close()
  
      # Create image directory
      self.image_dir = tempfile.mkdtemp()
      face_path = os.path.join(self.image_dir, "face.png")
      Image.fromarray(self.face).save(face_path)
      face_copy_path = os.path.join(self.image_dir, "face_copy.png")
      Image.fromarray(self.face).save(face_copy_path)
  
imports: import os
  import unittest
  import tempfile
  from scipy import misc
  import deepchem
  import zipfile
  import numpy
label_desc: Use image node_id 1 for calling the TestImageLoader obj's underlying member method code with example usage: obj.setUp() without return types