import string


def str2func(index: int, s: str) -> str:
    """Creates a unique c-function name from a string.
    Credit: https://stackoverflow.com/questions/34544784/arbitrary-string-to-valid-python-name
    """
    VALID_NAME_CHARACTERS = string.ascii_letters + string.digits
    PLACEHOLDER = "_"
    prefix = f"test_{index + 1}_"
    sym = ''.join(c.lower() if c in VALID_NAME_CHARACTERS else PLACEHOLDER for c in s)
    return prefix + sym