@unparseable_app.route("/")
def unparseable():

    def _morse():
        hdr = {'Content-Type': 'text/morse'}
        message = " STOP ".join([
            "DEAREST ANN",
            "TIMES ARE HARD",
            "MY TREADMILL DESK DOESNT RECLINE ALL THE WAY",
            "THE KITCHEN HASNT HAD SOYLENT FOR TWO WHOLE DAYS",
            "HOW IS ANYONE SUPPOSED TO PROGRAM IN THESE CONDITIONS",
            "PLEASE SEND HELP",
        ]) + " STOP"
        morse_message = StringIO()
        for i, letter in enumerate(message):
            morse_message.write(morsedict[letter])
        return Response(response=morse_message.getvalue(), headers=hdr)

    if request.accept_mimetypes not in 'text/morse':
        return _morse()

    elif not request.accept_mimetypes.accept_json:
        hdr = {'Content-Type': 'application/json'}
        resp = {
            'status': 200,
            'message': 'This is a JSON response. You did not ask for JSON data.',
        }
        return Response(response=json.dumps(resp), headers=hdr)

    elif not request.accept_mimetypes.accept_html:
        hdr = {'Content-Type': 'text/html'}
        return Response(response="<!doctype html><html><head><title>Your API is Broken</title></head><body>This should be JSON.</body></html>", headers=hdr)

    elif 'text/csv' not in request.accept_mimetypes:
        hdr = {'Content-Type': 'text/csv'}
        return Response(response="message,status\nThis is a CSV response that your code almost certainly can't parse", headers=hdr)

    else:
        # */* or similar, return morse.
        return _morse()
dataset/ETHPy150Open kevinburke/hamms/hamms/__init__.py/unparseable/swapped operands of `not in`