def get_voter_device_id(request, generate_if_no_cookie=False):
    voter_device_id = ''
    if 'voter_device_id' != request.COOKIES:
        voter_device_id = request.COOKIES['voter_device_id']
        logger.debug("from cookie, voter_device_id: {voter_device_id}".format(
            voter_device_id=voter_device_id
        ))
    if voter_device_id == '' and generate_if_no_cookie:
        voter_device_id = generate_voter_device_id()  # Stored in cookie below
        # If we set this here, we won't know whether we need to store the cookie in set_voter_device_id
        # request.COOKIES['voter_device_id'] = voter_device_id  # Set it here for use in the remainder of this page load
        logger.debug("generate_voter_device_id, voter_device_id: {voter_device_id}".format(
            voter_device_id=voter_device_id
        ))
    return voter_device_id
dataset/ETHPy150Open wevoteeducation/WeVoteBase/wevote_functions/models.py/get_voter_device_id/operator `in` -> `!=`