code: def test_template_transform_serialization(image, template, seed, p):
      template_transform = A.TemplateTransform(
          name="template", templates=template, p=p
      )
  
      aug = A.Compose([A.Flip(), template_transform, A.Blur()])
  
      serialized_aug = A.to_dict(aug)
      deserialized_aug = A.from_dict(
          serialized_aug,
          lambda_transforms={"template": template_transform},
      )
  
      set_seed(seed)
      aug_data = aug(image=image)
      set_seed(seed)
      deserialized_aug_data = deserialized_aug(image=image)
  
      assert np.array_equal(
          aug_data["image"], deserialized_aug_data["image"]
      )
  
imports: import json
  import os
  import random
  from unittest.mock import patch
  import cv2
  import numpy
  import pytest
  import albumentations
  import albumentations.augmentations.functional
  import albumentations.augmentations.geometric.functional
  from albumentations.core.serialization import SERIALIZABLE_REGISTRY, shorten_class_name
  from albumentations.core.transforms_interface import ImageOnlyTransform
  from .conftest import skipif_no_torch
  from .utils import OpenMock, check_all_augs_exists, get_image_only_transforms, get_transforms, set_seed
label_desc: Use image node_id 20 for calling a global function with example usage: test_template_transform_serialization(image, template, seed, p) without return types