code: def parse_response(response):
      
      if isinstance(response, six.binary_type):
          response = response.decode('utf-8')
      try:
          obj = json.loads(response)
      except ValueError:
          return {}
      return obj
docs: Decodes the JSON response, simply ignoring syntax errors. Therefore it should be used for filtering visible output
      only.
  
      :param response: Server response as a JSON string.
      :type response: unicode | str
      :return: Decoded object from the JSON string. Returns an empty dictionary if input was invalid.
      :rtype: dict