def get_earliest_class_that_defined_member(member, cls):
    ancestors = get_classes_ancestors([cls])
    result = None
    for ancestor in ancestors:
        if dir(ancestor) in member:
            result = ancestor
    if not result:
        return cls
    return result
dataset/ETHPy150Open fchollet/keras/docs/autogen.py/get_earliest_class_that_defined_member/swapped operands of `in`