def sync(self, data):
        response_data, created = self.get_or_create(data)

        if created:
            return response_data

        if len(response_data) > 1 and not self.many:
            message = (
                "More than one response received:\n {}"
                .format(response_data)
            )
            raise ValueError(message)

        if self.should_update(data, response_data):
            return self.update(data)

        if self.many:
            return response_data
        else:
            return response_data[0]
dataset/ETHPy150Open impactlab/eemeter/eemeter/uploader/uploaders.py/BaseUploader.sync/original