def json(self):
        # Augment with the requisite URLs
        self.ActivityURLs = {svc: {} for svc in self.PendingDeletions.keys()}
        for svc_id, urls in self.ActivityURLs.items():
            svc = Service.FromID(svc_id)
            for upload in self.PendingDeletions[svc_id]:
                try:
                    urls[upload] = svc.UserUploadedActivityURL(upload)
                except __HOLE__:
                    pass
        self.PendingDeletionCount = sum([len(v) for k, v in self.PendingDeletions.items()])
        dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime.datetime)  or isinstance(obj, datetime.date) else str(obj)
        return json.dumps(self.__dict__, default=dthandler)
dataset/ETHPy150Open cpfair/tapiriik/tapiriik/services/rollback.py/RollbackTask.json