code: def apply_pending_transforms(
      data: NdarrayOrTensor
      | Sequence[Any | NdarrayOrTensor]
      | Mapping[Any, NdarrayOrTensor],
      keys: tuple | None,
      overrides: dict | None = None,
      logger_name: bool | str = False,
  ):
      """
      apply_pending_transforms is called with either a tensor or a dictionary, some entries of which contain
      tensors.
  
      When operating on a dictionary of tensors, the 'keys' parameter determines what tensors should be checked.
      If 'keys' is not set, all keys of 'data' are considered.
  
      This method optionally takes a set of overrides that can be used to change specific parameters on the
      transform pipeline. See ``Compose`` for more details. This method takes a logger_name that can be used
      to override the default logger, to provide telemetry during the execution of pending transforms.
  
      This method is intended primarily for use by ``execute_compose`` and other methods that handle the
      underlying execution of transform pipelines. You should not need to use it in the general case, unless
      you are developing functionality to perform such operations.
  
      Args:
          data: a ``torch.Tensor`` or ``MetaTensor``, or dictionary of tensors.
          keys: an optional tuple of keys that filters the keys on 'data' if it is a dict
          overrides: An optional dictionary that specifies parameters that can be used to override transform
              arguments when they are called. When 'data' is a dict, this dictionary should contain a dictionary
              of overrides for each key that needs them
          logger_name: An optional name for a logger to be used when applying pending transforms. If None,
              logging is suppressed.
      Returns:
          an object of the same type as data if pending transforms were applied, or 'data' if they were not
      """
      if isinstance(data, list):
          return [
              apply_pending_transforms(d, keys, overrides, logger_name)
              for d in data
          ]
      if isinstance(data, tuple):
          return tuple(
              apply_pending_transforms(d, keys, overrides, logger_name)
              for d in data
          )
  
      if isinstance(data, dict):
          # get the keys from 'data' for metatensors with pending operations. If 'keys' is set, select
          # only data keys that are in 'keys'
          active_keys = [
              k for k in data.keys() if keys is None or k in keys
          ]
          keys_to_update = [
              k
              for k in active_keys
              if isinstance(data[k], MetaTensor)
              and data[k].has_pending_operations
          ]
  
          if len(keys_to_update) > 0:
              rdata = dict(data)
  
              for k in keys_to_update:
                  overrides_ = (
                      None
                      if overrides is None
                      else overrides.get(k, None)
                  )
                  rdata[k], _ = apply_pending(
                      data[k], overrides=overrides_
                  )
                  _log_applied_info(
                      rdata[k], key=k, logger_name=logger_name
                  )
  
              return rdata
      else:
          if (
              isinstance(data, MetaTensor)
              and data.has_pending_operations
          ):
              rdata, _ = apply_pending(data, overrides=overrides)
              _log_applied_info(rdata, logger_name=logger_name)
              return rdata
  
      return data
  
file_path: MONAI/monai/transforms/lazy/functional.py
imports: from __future__ import annotations
  from typing import Any, Mapping, Sequence
  import torch
  from monai.apps.utils import get_logger
  from monai.config import NdarrayOrTensor
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import to_affine_nd
  from monai.transforms.lazy.utils import affine_from_pending, combine_transforms, is_compatible_apply_kwargs, kwargs_from_pending, resample
  from monai.transforms.traits import LazyTrait
  from monai.transforms.transform import MapTransform
  from monai.utils import LazyAttr, look_up_option
label_desc: Use image node_id 3 for calling a global function with example usage: apply_pending_transforms(data, keys, overrides, logger_name) and returns: data, unknown, tuple, rdata, rdata