@classmethod
def parse_legacy_query(self, mode):
    if (mode in (None, False)):
        return None
    if (mode == 'read'):
        read = True
        nowait = False
    elif (mode == 'update'):
        read = nowait = False
    elif (mode == 'update_nowait'):
        nowait = True
        read = False
    else:
        raise sa_exc.ArgumentError(('Unknown with_lockmode argument: %r' % mode))
    return LockmodeArg(read=read, nowait=nowait)
@classmethod
def parse_legacy_query(self, mode):
    if (mode in (None, False)):
        return None
    if (mode == 'read'):
        read = True
        nowait = False
    elif (mode == 'update'):
        read = nowait = False
    elif (mode == 'update_nowait'):
        nowait = True
        read = False
    else:
        raise sa_exc.ArgumentError(('Unknown with_lockmode argument: %r' % mode))
    return LockmodeArg(read=read, nowait=nowait)