def _fmt_attrs(self, attrs):
        res = ''

        if isinstance(attrs, dict):
            for key, value in attrs.iteritems():
                if isinstance(value, basestring) and len(value) > 20:
                    value = ''.join(value[:20] + '...')
                res += '%s: %s, ' % (key, value)

        elif isinstance(attrs, list):
            for item in attrs:
                res += item % '%s, '

        return res.rstrip(', ')
dataset/ETHPy150Open comodit/synapse-agent/synapse/resources/resources.py/ResourcesController._fmt_attrs/swapped operands of `%`