def _unpickle_method(func_name, obj, cls):
    """
    Author: Steven Bethard
    http://bytes.com/topic/python/answers/552476-why-cant-you-pickle-instancemethods
    """
    for cls in cls.mro():
        try:
            func = cls.__dict__[func_name]
        except __HOLE__:
            pass
        else:
            break
    return func.__get__(obj, cls)
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/sct_straighten_spinalcord.py/_unpickle_method