code: def _tile_images(imgs, tile_shape, concatenated_image):
      
      y_num, x_num = tile_shape
      one_width = imgs[0].shape[1]
      one_height = imgs[0].shape[0]
      if concatenated_image is None:
          if len(imgs[0].shape) == 3:
              n_channels = imgs[0].shape[2]
              assert all(im.shape[2] == n_channels for im in imgs)
              concatenated_image = np.zeros(
                  (one_height * y_num, one_width * x_num, n_channels),
                  dtype=np.uint8,
              )
          else:
              concatenated_image = np.zeros(
                  (one_height * y_num, one_width * x_num), dtype=np.uint8)
      for y in six.moves.range(y_num):
          for x in six.moves.range(x_num):
              i = x + y * x_num
              if i >= len(imgs):
                  pass
              else:
                  concatenated_image[y * one_height:(y + 1) * one_height,
                                     x * one_width:(x + 1) * one_width] = imgs[i]
      return concatenated_image
docs: Concatenate images whose sizes are same.
  
      @param imgs: image list which should be concatenated
      @param tile_shape: shape for which images should be concatenated
      @param concatenated_image: returned image.
          if it is None, new image will be created.