code: def test_greyscale_operation_ground_truth():
      standard_image_directory = tempfile.mkdtemp()
      ground_truth_image_directory = tempfile.mkdtemp(
          prefix="ground-truth_"
      )
  
      # Create images in each directory, but with the same names.
      # First create a number of image names.
      image_names = []
      num_of_images = random.randint(1, 10)
      for i in range(num_of_images):
          image_names.append("im%s.png" % i)
  
      # Create random images, one set of 'standard' images
      # and another set of ground truth images.
      standard_images = []
      ground_truth_images = []
  
      for image_name in image_names:
          im = Image.fromarray(
              np.uint8(np.random.rand(80, 80, 3) * 255)
          )  # (80, 80) for Greyscale
          im_path = os.path.join(
              os.path.abspath(standard_image_directory), image_name
          )
          im.save(im_path, "PNG")
          standard_images.append(im_path)
  
      for image_name in image_names:
          im = Image.fromarray(
              np.uint8(np.random.rand(80, 80, 3) * 255)
          )  # (80, 80) for Greyscale
          im_path = os.path.join(
              os.path.abspath(ground_truth_image_directory), image_name
          )
          im.save(im_path, "PNG")
          ground_truth_images.append(im_path)
  
      num_samples = 10
  
      ###############################
      # SCENARIO 1
      # Standard.
      ###############################
      p = Augmentor.Pipeline(standard_image_directory)
      # Add the ground truth directory.
      p.ground_truth(ground_truth_image_directory)
  
      p.greyscale(probability=1)
      p.sample(num_samples)
  
      generated_files = glob.glob(
          os.path.join(standard_image_directory, "output/*")
      )
      assert (num_samples * 2) == len(generated_files)
  
      ###############################
      # SCENARIO 2
      # Chain with another operation.
      ###############################
      p = Augmentor.Pipeline(standard_image_directory)
      p.ground_truth(ground_truth_image_directory)
  
      p.greyscale(probability=1)
      p.histogram_equalisation(probability=1)
  
      p.sample(num_samples)
  
      shutil.rmtree(standard_image_directory)
      shutil.rmtree(ground_truth_image_directory)
  
imports: import pytest
  import os
  import sys
  import Augmentor
  import tempfile
  import io
  import shutil
  import glob
  import random
  import numpy
  from PIL import Image
  from Augmentor.Operations import CropRandom, HSVShifting
label_desc: Use image node_id 4 for calling a global function with example usage: test_greyscale_operation_ground_truth() without return types