<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_instance(self, inst, index=None):
 """ Adds the specified instance to the dataset. :param inst: the Instance to add :type inst: Instance :param index: the 0-based index where to add the Instance :type index: int """

        if index is None:
            self.__append_instance(inst.jobject)
        else:
            self.__insert_instance(index, inst.jobject)