def METHOD_NAME(rng_state_dicts: List[Dict[str, Any]]):
    """Restore the RNG state.
    Args:
        rng_state_dicts (List[Dict[str, Any]]): The list of RNG state dicts to restore,
            as returned by :func:`get_rng_state`.
    """
    if dist.get_world_size() > len(rng_state_dicts):
        warnings.warn(
            textwrap.dedent(f"""\
                The current world size ({dist.get_world_size()} is greater than the number of RNG state(s) serialized
                ({len(rng_state_dicts)}). Only the first {len(rng_state_dicts)} rank(s) will have their RNG restored.
                """))
    if dist.get_world_size() < len(rng_state_dicts):
        warnings.warn(
            textwrap.dedent(f"""\
            The current world size ({dist.get_world_size()} is less than the number of RNG state(s) serialized
            ({len(rng_state_dicts)}). Only the first {dist.get_world_size()} RNG state(s) will be consumed;
            the remaining will be ignored."""))
    if dist.get_global_rank() < len(rng_state_dicts):
        rng_state_dict = rng_state_dicts[dist.get_global_rank()]
        torch.set_rng_state(rng_state_dict['torch'])
        random.setstate(rng_state_dict['python'])
        np.random.set_state(rng_state_dict['numpy'])
        is_cuda_available = torch.cuda.is_available() and torch.cuda.is_initialized()
        has_cuda_rng_state = 'cuda' in rng_state_dict
        log.debug('Restoring the RNG state')
        if is_cuda_available and has_cuda_rng_state:
            torch.cuda.set_rng_state(rng_state_dict['cuda'])
        if is_cuda_available and not has_cuda_rng_state:
            warnings.warn(
                textwrap.dedent(f"""\
                The checkpoint did not include the CUDA RNG state. The CUDA RNG will have a
                non-deterministic state."""))
        if not is_cuda_available and has_cuda_rng_state:
            warnings.warn(
                textwrap.dedent(f"""\
                The checkpoint included CUDA RNG state, but CUDA is not being used.
                As such, the CUDA RNG state will be ignored."""))