code: def _sub_policy_with_unique_names(
      sub_policies: Sequence[
          Sequence[Tuple[Augmentation, float, Optional[int]]]
      ]
  ) -> Sequence[Sequence[Tuple[Augmentation, float, Optional[int]]]]:
      """
      Check if the augmentations used in the sub-policies have unique names.
      If not, rename them by adding enumeration to the names.
      The aim is to have non-ambiguous presentation.
      """
      all_augments = [
          aug
          for sub_policy in sub_policies
          for aug, p, mag in sub_policy
      ]
      augments = set(all_augments)
      names = set(aug.name for aug in augments)
      if len(names) == len(augments):
          return tuple(tuple(sub_policy) for sub_policy in sub_policies)
      num_digits = len(str(len(augments) - 1))
      remap_aug = {}
      i = 0
      for augment in all_augments:
          if augment not in remap_aug:
              remap_aug[augment] = augment.augmentation(
                  name=f"{str(i).zfill(num_digits)}__{augment.name}"
              )
              i += 1
      return tuple(
          tuple((remap_aug[aug], p, mag) for aug, p, mag in sub_policy)
          for sub_policy in sub_policies
      )
  
file_path: DALI/dali/python/nvidia/dali/auto_aug/core/policy.py
imports: import warnings
  from nvidia.dali.auto_aug.core._augmentation import Augmentation
  from typing import Optional, Sequence, Tuple
label_desc: Use image node_id 1 for calling a global function with example usage: _sub_policy_with_unique_names(sub_policies) and returns: tuple, tuple