def _path_to_func_name(path):
    if path == '/':
        return 'root'

    # Replace any occurances of more than one underscore with a single
    # instance. (ex: path = '/#anchor' -> '__anchor')
    return MULTI_UNDERSCORE_R.sub(
        '_',
        # Replace any invalid method name characters with an underscore.
        INVALID_METHOD_R.sub(
            '_',
            path
        )
    ).strip('_')
Let's make the repr the command that would actually be used to
dataset/ETHPy150Open jjyr/zerotest/zerotest/utils/generator_helper.py/_path_to_func_name--crossover with--dataset/ETHPy150Open evennia/evennia/evennia/utils/ansi.py/ANSIString.__repr__