code: def test_serialization_v2_to_dict():
      transform = A.Compose([A.HorizontalFlip()])
      transform_dict = A.to_dict(transform)["transform"]
      assert transform_dict == {
          "__class_fullname__": "Compose",
          "p": 1.0,
          "transforms": [
              {
                  "__class_fullname__": "HorizontalFlip",
                  "always_apply": False,
                  "p": 0.5,
              }
          ],
          "bbox_params": None,
          "keypoint_params": None,
          "additional_targets": {},
          "is_check_shapes": True,
      }
  
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 18 for calling a global function with example usage: test_serialization_v2_to_dict() without return types