def testMachineId(user, machine_id, exists=True):
"""Parse, validate and check authorization for a given user and machine.
If exists is False, don't check that it exists.
"""
if machine_id is None:
def testMachineId(user, machine_id, exists=True):
"""Parse, validate and check authorization for a given user and machine.
If exists is False, don't check that it exists.
"""
if machine_id is None: