code: def test_augmentations_serialization_to_file_with_custom_parameters(
      augmentation_cls,
      params,
      p,
      seed,
      image,
      mask,
      always_apply,
      data_format,
  ):
      with patch("builtins.open", OpenMock()):
          aug = augmentation_cls(
              p=p, always_apply=always_apply, **params
          )
          filepath = "serialized.{}".format(data_format)
          A.save(aug, filepath, data_format=data_format)
          deserialized_aug = A.load(filepath, data_format=data_format)
          set_seed(seed)
          aug_data = aug(image=image, mask=mask)
          set_seed(seed)
          deserialized_aug_data = deserialized_aug(
              image=image, mask=mask
          )
          assert np.array_equal(
              aug_data["image"], deserialized_aug_data["image"]
          )
          assert np.array_equal(
              aug_data["mask"], deserialized_aug_data["mask"]
          )
  
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 3 for calling a global function with example usage: test_augmentations_serialization_to_file_with_custom_parameters(augmentation_cls, params, p, seed, image, mask, always_apply, data_format) without return types