def camel2snake(text):
    """Convert camel case to snake case. This assumes the input is valid camel
    case (if you have some weird hybrid of camel and snake case, for instance,
    you'd want to do some preprocessing first).

    Parameters
    ----------
    text: str
        Camel case string, e.g. vaderSentimentScore.

    Returns
    -------
    str: `text` converted to snake case, e.g. vader_sentiment_score.
    """
    res = []
    for char in text:
        if char.islower():
            res.append(char)
        else:
            res.extend(['_', char.lower()])
    return ''.join(res)