def update_contact_tags(self, contact_id, tags, action='add'):
        contact_data = self._get_contact(contact_id=contact_id, force_json=True)
        contact_data_dict = json.loads(contact_data)
        old_tags = contact_data_dict['contact']['tags_joined_by_comma'].split(', ')
        new_tags_list = tags.split(',')

        if action == 'add':
            new_tags = _list_to_tags(list(set(new_tags_list + old_tags)))
        elif action == 'remove':
            for elem in new_tags_list:
                try:
                    old_tags.remove(elem)
                except ValueError:
                    pass
            new_tags = _list_to_tags(old_tags)
        elif action == 'replace':
            new_tags = _list_to_tags(new_tags_list)

        person = not contact_data_dict['contact']['is_organisation']

        return self.update_contact(contact_info={'tag_list': new_tags}, contact_id=contact_id,
            person=person)
Initialize and close the logger based on the configuration
dataset/ETHPy150Open npinger/base-crm-api-client/base_client.py/BaseAPIService.update_contact_tags--crossover with--dataset/ETHPy150Open duerrp/pyexperiment/pyexperiment/experiment.py/logging_context