def credentialFieldCheck(
    credentials, expectedFields=['app_id', 'username', 'password']
):
    for keyword in expectedFields:
        retr = credentials.get(keyword, None)
        if not retr:
            response = HttpResponse()
            response.write(json.dumps({'msg': 'Expecting: %s'%(keyword)}))
            response.status_code = httpStatusCodes.BAD_REQUEST
            return response
dataset/ETHPy150Open odeke-em/restAssured/auth/views.py/credentialFieldCheck/original