code: def add_instance(self, inst, index=None):
          
          if index is None:
              self.__append_instance(inst.jobject)
          else:
              self.__insert_instance(index, inst.jobject)
docs: 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