def to_camel_case(snake_str):
    # type: (str) -> str
    """Convert snake_case to camelCase.

    Adapted from this response in Stackoverflow:
        http://stackoverflow.com/a/19053800/1072990
    """
    components = snake_str.split("_")
    # We capitalize the first letter of each component except the first one
    # with the 'capitalize' method and join them together.
    return components[0] + "".join(x.capitalize() if x else "_" for x in components[1:])