<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def middle_begin(self, index):
 """ Set the index where MIDDLE starts. :param int index: the new index for MIDDLE begin """

        if (index < 0) or (index > self.all_length):
            raise ValueError(u"The given index is not valid")
        self.__middle_begin = index