import re


def camelcase_to_snakecase(value: str) -> str:
    """
    Convert a string from snake_case to camelCase.

    >>> camelcase_to_snakecase('')
    ''

    >>> camelcase_to_snakecase('foo')
    'foo'

    >>> camelcase_to_snakecase('fooBarBaz')
    'foo_bar_baz'

    >>> camelcase_to_snakecase('foo_bar_baz')
    'foo_bar_baz'


    >>> camelcase_to_snakecase('_fooBarBaz')
    '_foo_bar_baz'

    >>> camelcase_to_snakecase('__fooBarBaz_')
    '__foo_bar_baz_'

    """
    value = re.sub(r"[\-\.\s]", "_", value)

    if not value:
        return value

    return value[0].lower() + re.sub(
        r"[A-Z]", lambda matched: "_" + matched.group(0).lower(), value[1:]
    )