def _to_jsonc_name(member_name):
    """Converts a Python style member name to a JSON-C style name.

    JSON-C uses camelCaseWithLower while Python tends to use
    lower_with_underscores so this method converts as follows:

    spam becomes spam
    spam_and_eggs becomes spamAndEggs

    Args:
      member_name: str or unicode The Python syle name which should be
                   converted to JSON-C style.

    Returns:
      The JSON-C style name as a str or unicode.
    """

    characters = []
    uppercase_next = False
    for character in member_name:
        if character == '_':
            uppercase_next = True
        elif uppercase_next:
            characters.append(character.upper())
            uppercase_next = False
        else:
            characters.append(character)
    return ''.join(characters)