def METHOD_NAME(seed: int,
                                  process_group: ProcessGroup = None,
                                  offset_by_rank: bool = True,
                                  offset_by_index: bool = True):
    """
    Create a randomizer with an offset. The offset is equal to the rank of the process and the index of the randomizer.
    Args:
        seed (int): The base random seed to set.
        process_group (ProcessGroup): the process group to get the rank from.
        offset_by_rank (bool): whether to offset by the rank of the process, i.e., the rank of the process will be added to the seed. Default: True.
        offset_by_index (bool): whether to offset by the index of the randomizer, i.e., the index of the randomizer will be added to the seed. Default: True.
    Returns:
        Randomizer: the randomizer with offset.
    """
    base_seed = seed
    if offset_by_rank and dist.is_initialized():
        rank = dist.get_rank(process_group)
        base_seed += rank
    if offset_by_index:
        # check if the randomizer index is synchronized
        is_synchronized = Randomizer.is_randomizer_index_synchronized(process_group)
        assert is_synchronized, ("We detect that the randomizer index is not synchronized across processes."
                                 "This is not allowed when we want to create a randomizer with offset by index."
                                 "Please call Randomizer.synchronize_index() first.")
        base_seed += Randomizer.index()
        Randomizer.increment_index()
    return Randomizer(seed=base_seed)