def polysquare(p0, degree, basename):
    result = []
    for i in range(min(degree, 2 * len(p0) - 1)):
        terms = []
        for j in range((i + 1)/ 2):
            if len(p0) < i - j:
                t0 = p0[j]
                t1 = p0[i - j]
                if t0 != None and t1 != None:
                    terms.append(t0 + mulsym + t1)
        if len(terms) >= 1:
            if tex and len(terms) == 1:
                terms = ['2 ' + terms[0]]
            else:
                terms = ['2' + mulsym + '(' + ' + '.join(terms) + ')']
        if (i % 2) == 0:
            t = p0[i / 2]
            if t != None:
                if tex:
                    terms.append(t + '^2')
                else:
                    terms.append(t + mulsym + t)
        if terms == []:
            result.append(None)
        else:
            var = basename % i
            prd(var + ' = ' + ' + '.join(terms))
            result.append(var)
    return result
dataset/ETHPy150Open google/roboto/third_party/spiro/curves/numintsynth.py/polysquare/swapped operands of `<`