def __init__(self, positions, end=None):
        self.positions = None  # to avoid warnings
        if end is None:
            self.positions = tuple(sorted(set([int(i) for i in positions])))
        else:                # positions was actually not a list, but only the start index
            try:
                if positions > end:
                    raise TypeError
                self.positions = tuple(range(positions, end+1))
            except TypeError:
                # let any kind of erroneous spec raise ValueError
                raise ValueError("illegal interval specification: (start={0}, end={1})".format(positions, end))

        # set property name given in subclass, or otherwise name of subclass
        self.PROPERTY_NAME = self.__class__.PROPERTY_NAME or self.__class__.__name__
Depth first search.
dataset/ETHPy150Open nltk/nltk/nltk/tbl/feature.py/Feature.__init__--crossover with--dataset/ETHPy150Open simpleai-team/simpleai/simpleai/search/traditional.py/depth_first