code: def test_adding_custom_function():
      width = 80
      height = 80
  
      tmpdir = tempfile.mkdtemp()
      tmps = []
  
      for i in range(10):
          tmps.append(
              tempfile.NamedTemporaryFile(
                  dir=tmpdir, suffix=".JPEG", delete=False
              )
          )
  
          bytestream = io.BytesIO()
  
          im = Image.new("RGB", (width, height))
          im.save(bytestream, "JPEG")
  
          tmps[i].file.write(bytestream.getvalue())
          tmps[i].flush()
  
      p = Augmentor.Pipeline(tmpdir)
  
      assert len(p.augmentor_images) == len(tmps)
  
      # Use the DoubleImageSize custom operation above
      #
      # First instantiate a new object of the custom operation
      double_image_size_operation = DoubleImageSize(
          probability=1, custom_parameter_integer=5
      )
  
      # Add to pipeline
      p.add_operation(double_image_size_operation)
  
      # Executed the pipeline as normal, and your custom operation will be executed
      p.sample(10)
  
file_path: Augmentor/tests/test_custom_operations.py
imports: import os
  import sys
  import Augmentor
  from Augmentor.Operations import Operation
  import tempfile
  from PIL import Image
  import io
label_desc: Use image node_id 1 for calling a global function with example usage: test_adding_custom_function() without return types