def flat(self, *types):
        if type(self) in types:
            return [self]
        return sum([c.flat(*types) for c in self.children], [])
dataset/ETHPy150Open benoitc/gaffer/gaffer/docopt.py/ParentPattern.flat/original