def __init__(self, positions, end=None):
        """
        Construct a Feature which may apply at C{positions}.

        #For instance, importing some concrete subclasses (Feature is abstract)
        >>> from nltk.tag.brill import Word, Pos

        #Feature Word, applying at one of [-2, -1]
        >>> Word([-2,-1])
        Word([-2, -1])

        #Positions need not be contiguous
        >>> Word([-2,-1, 1])
        Word([-2, -1, 1])

        #Contiguous ranges can alternatively be specified giving the
        #two endpoints (inclusive)
        >>> Pos(-3, -1)
        Pos([-3, -2, -1])

        #In two-arg form, start <= end is enforced
        >>> Pos(2, 1)
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "nltk/tbl/template.py", line 306, in __init__
            raise TypeError
        ValueError: illegal interval specification: (start=2, end=1)

        :type positions: list of int
        :param positions: the positions at which this features should apply
        :raises ValueError: illegal position specifications

        An alternative calling convention, for contiguous positions only,
        is Feature(start, end):

        :type start: int
        :param start: start of range where this feature should apply
        :type end: int
        :param end: end of range (NOTE: inclusive!) where this feature should apply

        """
        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 __HOLE__:
                # 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__
dataset/ETHPy150Open nltk/nltk/nltk/tbl/feature.py/Feature.__init__