def is_leader():
    """
    Returns ``True`` if the rank of the current process is 0.
    """
    if _dist.is_initialized():
        return _dist.get_rank() == 0
    return True

    Returns ``True`` if the rank of the current process is 0.
    
coremltools/optimize/torch/_utils/dist_utils.py