def master_only(func: Callable) -> Callable:
    """Decorate those methods which should be executed in master process.

    Args:
        func (callable): Function to be decorated.

    Returns:
        callable: Return decorated function.
    """

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        if is_main_process():
            return func(*args, **kwargs)
    return wrapper
Decorate those methods which should be executed in master process.

Args:
func (callable): Function to be decorated.

Returns:
callable: Return decorated function.
projects/llava_sam2/evaluation/utils/dist.py