def get_local_rank(local_process_group):
    """Gets the rank of the current process within the local processes group.

    Args:
        local_process_group: the local process group

    Returns:
        the rank of the current process
    """
    if not dist.is_available():
        return 0

    if not dist.is_initialized():
        return 0

    return dist.get_rank(group=local_process_group)
Gets the rank of the current process within the local processes group.

    Args:
        local_process_group: the local process group

    Returns:
        the rank of the current process
    
fiftyone/utils/torch.py