def snake_to_camel_base(string: str, lower_first=True) ->str:
    """Base function to convert a snake-case string to camel-case string.

    if lower_first=True (default) it is lower camel case
    (initial lowercase letter, also known as Dromedary case)

    if lower_first=False it is upper camel case
    (initial uppercase letter, also known as Pascal case)"""
    res = []
    byte = string.encode('ascii')
    max_index = len(byte)
    _index = 0
    while _index < max_index and byte[_index] == 95:
        res.append(95)
        _index += 1
    while _index < max_index and not 65 <= byte[_index
        ] <= 90 and not 97 <= byte[_index] <= 122:
        if byte[_index] == 95:
            _index += 1
            continue
        res.append(byte[_index])
        _index += 1
    if lower_first:
        while _index < max_index:
            if 65 <= byte[_index] <= 90:
                res.append(byte[_index] + 32)
                _index += 1
            else:
                break
    elif _index < max_index and 97 <= byte[_index] <= 122:
        res.append(byte[_index] - 32)
        _index += 1
    while _index < max_index:
        if byte[_index] == 95:
            _index += 1
            while _index < max_index and byte[_index] == 95:
                _index += 1
            if _index >= max_index:
                break
            if 97 <= byte[_index] <= 122:
                res.append(byte[_index] - 32)
                _index += 1
            else:
                res.append(byte[_index])
                _index += 1
        else:
            res.append(byte[_index])
            _index += 1
    res = bytearray(res).decode('ascii')
    return res
