import six


def decode_response(resp, definition):
    """Decode the response if we know how to handle it"""
    if six.PY3:
        try:
            return resp.content.decode()
        except:
            return resp.content
    return resp.content