code: def extract_media(request):
      """Extract the media from a flask Request.
  
      To avoid race conditions when using greenlets we cannot perform I/O in the
      constructor of GcsObjectVersion, or in any of the operations that modify
      the state of the service.  Because sometimes the media is uploaded with
      chunked encoding, we need to do I/O before finishing the GcsObjectVersion
      creation. If we do this I/O after the GcsObjectVersion creation started,
      the the state of the application may change due to other I/O.
  
      :param request:flask.Request the HTTP request.
      :return: the full media of the request.
      :rtype: str
      """
      if request.environ.get("HTTP_TRANSFER_ENCODING", "") == "chunked":
          return request.environ.get("wsgi.input").read()
      return request.data
  
imports: import base64
  import error_response
  import hashlib
  import json
  import random
  import re
label_desc: Use image node_id 5 for calling a global function with example usage: extract_media(request) and returns: request, request