def unpickle_instance_method(func_name, obj, cls):
    """Unpickle class instance method."""
    for cls in cls.mro():
        try:
            func = cls.__dict__[func_name]
        except KeyError:
            pass
        else:
            break
    return func.__get__(obj, cls)
