code: def result_reduce_ddp_fn(strategy):
      tensor = torch.tensor([1.0])
      sync = _Sync(strategy.reduce, _should=True, _op="SUM")
      actual = sync(tensor)
      assert actual.item() == dist.get_world_size()
  
file_path: pytorch-lightning/tests/tests_pytorch/core/test_results.py
imports: from functools import partial
  import torch
  import torch.distributed
  from lightning.fabric.plugins.environments import LightningEnvironment
  from lightning.pytorch.accelerators import CPUAccelerator, CUDAAccelerator, MPSAccelerator
  from lightning.pytorch.strategies import DDPStrategy
  from lightning.pytorch.strategies.launchers import _MultiProcessingLauncher
  from lightning.pytorch.trainer.connectors.logger_connector.result import _Sync
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.models.test_tpu import wrap_launch_function
label_desc: Use image node_id 2 for calling a global function with example usage: result_reduce_ddp_fn(strategy) without return types