code: def clean_response(response):
      '''Recurse through dictionary and replace any keys "self" with
      "self_"'''
      if type(response) is list:
          for elem in response:
              clean_response(elem)
      elif type(response) is dict:
          for key, val in response.items():
              if key == 'self':
                  val = response.pop('self')
                  response['self_'] = val
                  clean_response(val)
              else:
                  clean_response(response[key])
      return responsf clean_response(response):
      '''Recurse through dictionary and replace any keys "self" with
      "self_"'''
      if type(response) is list:
          for elem in response:
              clean_response(elem)
      elif type(response) is dict:
          for key, val in response.items():
              if key == 'self':
                  val = response.pop('self')
                  response['self_'] = val
                  clean_response(val)
              else:
                  clean_response(response[key])
      return response
docs: Recurse through dictionary and replace any keys "self" with
      "self_"