def _get_includes(self):
        models = []
        op, targets = self.get_data()
        if op == self.OPERATOR.NOT:
            return models

        for t in targets:
            if isinstance(t, ObjectModel):
                models += [t]
            elif isinstance(t, TargetingCriterion):
                if op != self.OPERATOR.NOT:
                    models += t._get_includes()

        return models
Recursive function to get all targeting objects
dataset/ETHPy150Open chartbeat-labs/parselmouth/parselmouth/targeting.py/TargetingCriterion._get_includes