import re


def snake_to_camel(value, **kwargs):
    """
    Converts a snake_case key name to a camelCase key name, or vice versa.
    :param value: A string that you want to convert to another string type.
    :param kwargs:
        reverse - Convert from camelCase to snake_case
    :return: a converted string
    """
    do_reverse = kwargs.get("reverse", False)

    parts_ex = "([A-Z])" if do_reverse else "(_[A-Za-z])"
    parts = re.findall(parts_ex, value)

    for part in parts:
        if do_reverse:
            value = value.replace(part, "_%s" % part.lower())

            if value[0] == "_":
                value = value[1:]

        else:
            value = value.replace(part, part.upper().replace("_", ""))

    return value