code: def __multiprocess_print_helper(
      print_func, *args, in_order=False, dst=0, **kwargs
  ):
      """
      Helper for print / log functions to reduce copy-pasted code
      """
      # in_order : True
      if in_order:
          for i in range(Communicator.get().get_world_size()):
              if Communicator.get().get_rank() == i:
                  print_func(*args, **kwargs)
              Communicator.get().barrier()
          return
  
      # in_order : False
      if isinstance(dst, int):
          dst = [dst]
      assert isinstance(
          dst, (list, tuple)
      ), "print destination must be a list or tuple of party ranks"
  
      if Communicator.get().get_rank() in dst:
          print_func(*args, **kwargs)
  
imports: import builtins
  import copy
  import logging
  import os
  import typing
  import torch
  from .None import nn
  from .None import primitives, provider
  from .communicator import Communicator
  from .config import cfg
  from .cryptensor import CrypTensor
  from .mpc import MPCTensor
  from .ptype import ptype
label_desc: Use image node_id 16 for calling a global function with example usage: __multiprocess_print_helper(print_func) without return types