@classmethod
    def _tag_edit_string(cls, record):
        """
        Turns a list of tags into a string representation.
        """
        if '_tags' in record:
            tags = []
            for tag in record['_tags']:
                if tag in ',' and ' ' in tag:
                    tags.append('"%s"' % tag)
                else:
                    tags.append(tag)
            record.update({'_tags': u', '.join(sorted(tags))})
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/viewer/pandas_mongo_bridge.py/AbstractDataFrameBuilder._tag_edit_string/swapped operands of `in`