def METHOD_NAME(self, data):
    if self.__get_data_type(data) == Instance:
        if not self.with_sample_id:
            _data = data.map(
                lambda k, v: (v.features[0], 1))
        else:
            _data = data.map(lambda k, v: (v.inst_id, v))
    else:
        _data = data.mapValues(lambda k, v: (v[0], 1))
    _data.schema = data.schema
    LOGGER.info("Finish recover real ids")
    return _data