code: def _get_fp16_context(use_fp16=False):
      if use_fp16:
          return torch.cuda.amp.autocast()
      else:
          return contextlib.nullcontext()
  
file_path: fairscale/tests/nn/pipe/test_parity.py
imports: import contextlib
  import copy
  import numpy
  import pytest
  import torch
  from fairscale.fair_dev.testing.testing import skip_if_single_gpu
  from fairscale.nn import Pipe
label_desc: Use image node_id 3 for calling a global function with example usage: _get_fp16_context(use_fp16) and returns: torch, contextlib