code: def get_synced_timer_histogram(
      timer: TimerProtocol,
      percentiles: Sequence[float],
      pg: Optional[dist.ProcessGroup] = None,
  ) -> Dict[str, Dict[str, float]]:
      """Synchronizes the input timer's recorded durations across ranks.
  
      Args:
          timer: The TimerProtocol object whose recorded durations will be synced.
          percentiles: The percentiles to compute. Values should be in the range [0, 100].
          pg (optional): The process group to use for synchronization. Defaults to the global process group.
  
      Returns:
          A dictionary mapping the action names to a dictionary of the computed percentiles, along with the mean duration of each action.
  
      Raises:
          ValueError: If the input percentiles are not in the range [0, 100].
      """
      return get_synced_durations_histogram(
          timer.recorded_durations, percentiles=percentiles, pg=pg
      )
  
imports: import datetime
  import logging
  import os
  from collections import defaultdict
  from contextlib import contextmanager
  from time import perf_counter
  from typing import Any, Dict, Generator, List, Optional, Protocol, runtime_checkable, Sequence, Tuple, TypeVar
  import numpy
  import torch
  import torch.distributed
  from tabulate import tabulate
  from torchtnt.utils.distributed import PGWrapper
label_desc: Use image node_id 7 for calling a global function with example usage: get_synced_timer_histogram(timer, percentiles, pg) and returns: get_synced_durations_histogram