

def serialize(self):
    res = {
        'script': self.script,
    }
    if self.type:
        res['type'] = self.type
    if self.params:
        self['params'] = self.params
    if self.order:
        res['order'] = self.order
    res = {
        '_script': res,
    }
    return res

dataset/ETHPy150Open aparo/pyes/pyes/sort.py ScriptSortOrder.serialize/VarMisuse@47/54 `res`->`self`