code: def generate_driver(
      labels,
      features,
      device=[0, 1],
      fp16=False,
      output_from_new_proc="all",
  ):
      torch_model = TorchNormalModel_Classification_1(labels, features)
      torch_opt = torch.optim.Adam(
          params=torch_model.parameters(), lr=0.01
      )
      device = [torch.device(i) for i in device]
      driver = TorchDDPDriver(
          model=torch_model,
          parallel_device=device,
          fp16=fp16,
          output_from_new_proc=output_from_new_proc,
      )
      driver.set_optimizers(torch_opt)
      driver.setup()
  
      return driver
  
imports: import os
  import pytest
  from pathlib import Path
  from fastNLP.core.drivers.torch_driver.ddp import TorchDDPDriver
  from fastNLP import prepare_torch_dataloader
  from fastNLP.core.samplers import RandomSampler, UnrepeatedSampler, BucketedBatchSampler, UnrepeatedRandomSampler, UnrepeatedSequentialSampler
  from tests.helpers.models.torch_model import TorchNormalModel_Classification_1
  from tests.helpers.datasets.torch_data import TorchNormalDataset, TorchNormalXYDataset
  from tests.helpers.utils import magic_argv_env_context, recover_logger, Capturing
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP import logger
  from fastNLP.core.drivers.torch_driver.dist_utils import fastnlp_torch_all_gather
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
label_desc: Use image node_id 1 for calling a global function with example usage: generate_driver(labels, features, device, fp16, output_from_new_proc) and returns: driver