def files(self, itemId, sources=None):
        ret = {"added": [],
               "removed": []}

        files = self.get("item/{}/files".format(itemId))

        if self.module.params['state'] == 'present':

            file_dict = {f['name']: f for f in files}

            source_dict = {os.path.basename(s): {
                "path": s,
                "name": os.path.basename(s),
                "size": os.path.getsize(s)} for s in sources}

            source_names = set([(s['name'], s['size'])
                                for s in source_dict.values()])

            file_names = set([(f['name'], f['size'])
                              for f in file_dict.values()])

            for n, _ in (file_names - source_names):
                self.delete("file/{}".format(file_dict[n]['_id']))
                ret['removed'].append(file_dict[n])

            for n, _ in (file_names - source_names):
                self.uploadFileToItem(itemId, source_dict[n]['path'])
                ret['added'].append(source_dict[n])

        elif self.module.params['state'] == 'absent':
            for f in files:
                self.delete("file/{}".format(f['_id']))
                ret['removed'].append(f)

        if len(ret['added']) != 0 or len(ret['removed']) != 0:
            self.changed = True

        return ret
dataset/ETHPy150Open girder/girder/clients/ansible/girder.py/GirderClientModule.files/swapped operands of `-`