<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _snap_exec(commands):
 """ Execute snap commands. :param commands: List commands :return: Integer exit code """

    assert type(commands) == list

    retry_count = 0
    return_code = None

    while return_code is None or return_code == SNAP_NO_LOCK:
        try:
            return_code = subprocess.check_call(['snap'] + commands,
                                                env=os.environ)
        except subprocess.CalledProcessError as e:
            retry_count += + 1
            if retry_count > SNAP_NO_LOCK_RETRY_COUNT:
                raise CouldNotAcquireLockException(
                    'Could not aquire lock after {} attempts'
                    .format(SNAP_NO_LOCK_RETRY_COUNT))
            return_code = e.returncode
            log('Snap failed to acquire lock, trying again in {} seconds.'
                .format(SNAP_NO_LOCK_RETRY_DELAY, level='WARN'))
            sleep(SNAP_NO_LOCK_RETRY_DELAY)

    return return_code