code: def handle_deprecations(doc):
      if "parser" in doc:
          warnings.warn(
              "The parser attribute is deprecated, use expect instead",
              DeprecationWarning,
              stacklevel=2,
          )
          doc["expect"] = doc.get("expect", []) + [doc.pop("parser")]
      if "body" in doc:
          warnings.warn(
              "The body attribute is deprecated, use expect instead",
              DeprecationWarning,
              stacklevel=2,
          )
          doc["expect"] = doc.get("expect", []) + [doc.pop("body")]
  
imports: from __future__ import unicode_literals
  import inspect
  import warnings
  import logging
  from collections import namedtuple
  import six
  from flask import request
  from flask.views import http_method_funcs
  from ._http import HTTPStatus
  from .errors import abort
  from .marshalling import marshal, marshal_with
  from .model import Model, OrderedModel, SchemaModel
  from .reqparse import RequestParser
  from .utils import merge
label_desc: Use image node_id 2 for calling a global function with example usage: handle_deprecations(doc) without return types