code: def MakeTransport(
      use_rpc: bool,
      worker_map: Optional[Dict[int, str]],
      input_device: InputDevice,
  ) -> Transport:
      if use_rpc:
          if worker_map is None:
              raise ValueError(
                  "'RpcTransport' requires 'worker_map' to be set"
              )
          return RpcTransport(worker_map, input_device)
      else:
          return SendRecvTransport(worker_map, input_device)
  
imports: from abc import ABC
  from dataclasses import dataclass
  from queue import Empty
  from queue import Queue
  from typing import Dict, List, Optional
  import torch
  from fairscale.internal.object import pyobject_to_tensor, tensor_to_pyobject
  from fairscale.nn.model_parallel import get_pipeline_parallel_group
  from .types import MESSAGE_GENERATION_START, InputDevice, PipeMessage, Tensors
label_desc: Use image node_id 3 for calling a global function with example usage: MakeTransport(use_rpc, worker_map, input_device) and returns: RpcTransport, SendRecvTransport