code: def test_fastnlp_oneflow_broadcast_object():
      local_rank = int(os.environ["LOCAL_RANK"])
      if os.environ["LOCAL_RANK"] == "0":
          obj = {
              "tensor": oneflow.full(
                  (2,), local_rank, oneflow.int
              ).cuda(),
              "numpy": np.full(
                  shape=(2,), fill_value=local_rank, dtype=int
              ),
              "bool": local_rank % 2 == 0,
              "float": local_rank + 0.1,
              "int": local_rank,
              "dict": {"rank": local_rank},
              "list": [local_rank] * 2,
              "str": f"{local_rank}",
              "tensors": [
                  oneflow.full((2,), local_rank, oneflow.int).cuda(),
                  oneflow.full((2,), local_rank, oneflow.int).cuda(),
              ],
          }
      else:
          obj = None
      # device=oneflow.cuda.current_devuce
      data = fastnlp_oneflow_broadcast_object(
          obj, src=0, device=local_rank
      )
      i = 0
      assert data["tensor"][0] == 0
      assert data["numpy"][0] == 0
      assert data["bool"] == (i % 2 == 0)
      assert np.allclose(data["float"], i + 0.1)
      assert data["int"] == i
      assert data["dict"]["rank"] == i
      assert data["list"][0] == i
      assert data["str"] == f"{i}"
      assert data["tensors"][0][0] == i
  
      for obj in [local_rank, bool(local_rank == 1), str(local_rank)]:
          data = fastnlp_oneflow_broadcast_object(
              obj, src=0, device=local_rank
          )
          assert int(data) == 0
  
file_path: fastNLP/tests/core/drivers/oneflow_driver/test_dist_utils.py
imports: import sys
  import os
  import pytest
  import numpy
  from fastNLP.envs.imports import _NEED_IMPORT_ONEFLOW
  from fastNLP.core.drivers.oneflow_driver.dist_utils import _tensor_to_object, _object_to_tensor, fastnlp_oneflow_all_gather, fastnlp_oneflow_broadcast_object
label_desc: Use image node_id 3 for calling a global function with example usage: test_fastnlp_oneflow_broadcast_object() without return types