def generate_boto3_response(operation):
 def _boto3_request(method):
  @wraps(method)
  def f(self, *args, **kwargs):
   rendered = method(self, *args, **kwargs)
   if (u'json' in self.headers.get(u'Content-Type', [])):
    self.response_headers.update({u'x-amzn-requestid': u'2690d7eb-ed86-11dd-9877-6fad448a8419', u'date': datetime.now(pytz.utc).strftime(u'%a, %d %b %Y %H:%M:%S %Z'), u'content-type': u'application/x-amz-json-1.1'})
    resp = xml_to_json_response(self.aws_service_spec, operation, rendered)
    return (u'' if (resp is None) else json.dumps(resp))
   return rendered
  return f
 return _boto3_request

def generate_boto3_response ( operation ) : def _boto3_request ( method ) : @ wraps ( method ) def f ( self , * args , ** kwargs ) : rendered = method ( self , * args , ** kwargs ) if ( u'json' in self . headers . get ( u'Content-Type' , [ ] ) ) : self . response_headers . update ( { u'x-amzn-requestid' : u'2690d7eb-ed86-11dd-9877-6fad448a8419' , u'date' : datetime . now ( pytz . utc ) . strftime ( u'%a, %d %b %Y %H:%M:%S %Z' ) , u'content-type' : u'application/x-amz-json-1.1' } ) resp = xml_to_json_response ( self . aws_service_spec , operation , rendered ) return ( u'' if ( resp is None ) else json . dumps ( resp ) ) return rendered return f return _boto3_request
the decorator to convert an xml response to json .