def _unpickle_method(func_name, obj, cls):
    for cls in cls.mro():
        try:
            func = cls.__dict__[func_name]
        except __HOLE__:
            pass
        else:
            break
        return func.__get__(obj, cls)

# https://bytes.com/topic/python/answers/552476-why-cant-you-pickle-instancemethods
dataset/ETHPy150Open dpkp/kafka-python/kafka/protocol/pickle.py/_unpickle_method