def snake2camel(string: str, capitalize: bool = True) -> str:
    """Convert a ``snake_cased`` string to a ``CamelCased`` one.


    :param string: String to be converted.
    :type string: str

    :param capitalize: Whether to capitalize the first word of the returned
                       string. When set to ``True`` the string is returned
                       as ``CamelCase`` otherwise when set to ``False``, the
                       string is returned as ``camelCase``.
    :type capitalize: bool


    :returns: The given string converted to camel case.
    :rtype: str

    """
    head, *tail = string.lower().split("_")
    return (head.capitalize() if capitalize else head) + "".join(
        map(str.capitalize, tail)
    )