def fix_field_params_repr(params):
    """
    Fixes repr() of "field_params" for Python 2 with future unicode_literals.
    """
    class ReprUnicode(six.text_type):
        def __new__(cls, text):
            return unicode.__new__(cls, text)
        def __repr__(self):
            out = repr(unicode(self))
            return out[1:] if out.startswith("u'") or out.startswith('u"') else out
    class ReprChoices(list):
        def __new__(cls, choices):
            return list.__new__(cls, choices)
        def __repr__(self):
            out = []
            for x0, x1 in self:
                out.append('(%s, %s)' % (
                        repr(ReprUnicode(x0) if isinstance(x0, unicode) else x0),
                        repr(ReprUnicode(x1) if isinstance(x1, unicode) else x1)
                ))
            return (', '.join(out)) % '[%s]'
    if six.PY3:
        return params
    out = OrderedDict()
    for k, v in params.items():
        if k == 'choices' and v:
            v = ReprChoices(v)
        elif isinstance(v, unicode):
            v = ReprUnicode(v)
        out[k] = v
    return out
dataset/ETHPy150Open django-salesforce/django-salesforce/salesforce/management/commands/inspectdb.py/fix_field_params_repr/swapped operands of `%`