code: def _deprecate_kwarg(kwargs, old_kw, new_kw, new_kw_value):
      old_kwarg = kwargs.get(old_kw)
      if old_kwarg is not None:
          warnings.warn(
              "The `{}` argument is deprecated. Use `{}` instead.".format(
                  old_kw, new_kw
              ),
              DeprecationWarning,
          )
          if new_kw_value is not None:
              raise ValueError(
                  "Cannot set both `{}` and `{}`".format(old_kw, new_kw)
              )
          return old_kwarg
      return new_kw_value
  
file_path: gpytorch/gpytorch/utils/deprecation.py
imports: import functools
  import warnings
  from unittest.mock import MagicMock
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: _deprecate_kwarg(kwargs, old_kw, new_kw, new_kw_value) and returns: new_kw_value, old_kwarg