import re


def to_snake_case(s):
    """Convert a string to snake-case format

    Parameters
    ----------
    s: String
        String to convert to snake-case

    Returns
    -------
    String
        Snake-case formatted string

    Notes
    -----
    Adapted from https://gist.github.com/jaytaylor/3660565

    Examples
    --------
    >>> to_snake_case("snakesOnAPlane") == "snakes_on_a_plane"
    True
    >>> to_snake_case("SnakesOnAPlane") == "snakes_on_a_plane"
    True
    >>> to_snake_case("snakes_on_a_plane") == "snakes_on_a_plane"
    True
    >>> to_snake_case("IPhoneHysteria") == "i_phone_hysteria"
    True
    >>> to_snake_case("iPhoneHysteria") == "i_phone_hysteria"
    True
    """
    s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", s)
    return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()